[librsvg: 9/17] Store the corresponding attribute in the Declaration



commit 6517fb0230cf18517e4541f9083a4757a8ac4ef0
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu May 2 18:53:16 2019 -0500

    Store the corresponding attribute in the Declaration
    
    This is a bit awkward; from the Declaration.property variant we should
    be able to figure out the corresponding attribute, but we can't do
    that right now.

 rsvg_internals/src/css.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/css.rs b/rsvg_internals/src/css.rs
index eec0d497..f488d2e9 100644
--- a/rsvg_internals/src/css.rs
+++ b/rsvg_internals/src/css.rs
@@ -20,6 +20,7 @@ use crate::properties::{
 use crate::util::utf8_cstr;
 
 struct Declaration {
+    attribute: Attribute,
     property: ParsedProperty,
     important: bool,
 }
@@ -132,6 +133,7 @@ impl CssRules {
 
             Entry::Vacant(v) => {
                 v.insert(Declaration {
+                    attribute: attr,
                     property,
                     important,
                 });
@@ -148,9 +150,9 @@ impl CssRules {
         important_styles: &mut HashSet<Attribute>,
     ) -> bool {
         if let Some(decl_list) = self.selectors_to_declarations.get(selector) {
-            for (attr, declaration) in decl_list.iter() {
+            for (_, declaration) in decl_list.iter() {
                 values.set_style_pair_from_parsed_property(
-                    *attr,
+                    declaration.attribute,
                     &declaration.property,
                     declaration.important,
                     important_styles,


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