[librsvg: 1/4] No need to handle filterUnits specially anymore




commit 59e8c8bdf310e9a9fe01c487d9473671be5c73d3
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Nov 11 17:07:50 2021 -0600

    No need to handle filterUnits specially anymore
    
    It used to be that the x/y/width/height attributes were validated
    based on the filterUnits attribute, but this was a mis-reading of the
    spec.  So, just process filterUnits as a normal attribute.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/631>

 src/filter.rs | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/src/filter.rs b/src/filter.rs
index 97e2600bc..660beb41e 100644
--- a/src/filter.rs
+++ b/src/filter.rs
@@ -71,18 +71,9 @@ impl Filter {
 
 impl SetAttributes for Filter {
     fn set_attributes(&mut self, attrs: &Attributes) -> ElementResult {
-        // Parse filterUnits first as it affects x, y, width, height checks.
-        let result = attrs
-            .iter()
-            .find(|(attr, _)| attr.expanded() == expanded_name!("", "filterUnits"))
-            .and_then(|(attr, value)| attr.parse(value).ok());
-        if let Some(filter_units) = result {
-            self.filter_units = filter_units
-        }
-
-        // Parse the rest of the attributes.
         for (attr, value) in attrs.iter() {
             match attr.expanded() {
+                expanded_name!("", "filterUnits") => self.filter_units = attr.parse(value)?,
                 expanded_name!("", "x") => self.x = attr.parse(value)?,
                 expanded_name!("", "y") => self.y = attr.parse(value)?,
                 expanded_name!("", "width") => self.width = attr.parse(value)?,


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