[librsvg: 2/13] Store the stylesheets in the Document



commit 9e4be3342094025df2eef9ad752c0557136c1f93
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Jan 16 19:16:10 2020 -0600

    Store the stylesheets in the Document
    
    Instead of discarding them after DocumentBuilder performs the initial
    cascade.
    
    We'll use the saved stylesheets to re-cascade if needed.

 rsvg_internals/src/document.rs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/rsvg_internals/src/document.rs b/rsvg_internals/src/document.rs
index db188591..9841a619 100644
--- a/rsvg_internals/src/document.rs
+++ b/rsvg_internals/src/document.rs
@@ -39,6 +39,9 @@ pub struct Document {
 
     /// Used to load referenced resources.
     load_options: LoadOptions,
+
+    /// Stylesheets defined in the document
+    stylesheets: Vec<Stylesheet>,
 }
 
 impl Document {
@@ -355,6 +358,7 @@ impl DocumentBuilder {
                         externs: RefCell::new(Resources::new()),
                         images: RefCell::new(Images::new()),
                         load_options: load_options.clone(),
+                        stylesheets,
                     })
                 } else {
                     Err(LoadingError::RootElementIsNotSvg)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]