[librsvg: 1/3] (#771): Fix incorrect default for the flood-color property




commit d081263a9f9f115ea659c7164a2314fd0f1d638c
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Jul 27 19:01:02 2021 -0500

    (#771): Fix incorrect default for the flood-color property
    
    Per the spec, the default is opaque black.  However, librsvg's default
    value was all-zeros, or transparent black.
    
    43499a14af1ad06620d500462ac0c8ad6fd8bec5 refactored the feFlood
    primitive to pass an already resolved color to
    SharedImageSurface::flood().  Prior to that, the code in flood() was
    incorrectly using just the RGB values from the flood-color property,
    but an alpha value equal to the flood-opacity - instead of first
    resolving the whole RGBA flood-color with the flood-opacity.
    
    Now that the flood-color is resolved properly, it turns out that the
    default was wrong.
    
    Fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/771
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/573>

 src/property_defs.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/property_defs.rs b/src/property_defs.rs
index c8e5ec40..f0832101 100644
--- a/src/property_defs.rs
+++ b/src/property_defs.rs
@@ -368,11 +368,11 @@ make_property!(
 make_property!(
     /// `flood-color` property, for `feFlood` and `feDropShadow` filter elements.
     ///
-    /// https://www.w3.org/TR/SVG/filters.html#FloodColorProperty
+    /// https://www.w3.org/TR/SVG11/filters.html#feFloodElement
     ///
     /// https://www.w3.org/TR/filter-effects/#FloodColorProperty
     FloodColor,
-    default: cssparser::Color::RGBA(cssparser::RGBA::new(0, 0, 0, 0)),
+    default: cssparser::Color::RGBA(cssparser::RGBA::new(0, 0, 0, 255)),
     inherits_automatically: false,
     newtype_parse: cssparser::Color,
 );
@@ -380,7 +380,7 @@ make_property!(
 make_property!(
     /// `flood-opacity` property, for `feFlood` and `feDropShadow` filter elements.
     ///
-    /// https://www.w3.org/TR/SVG/filters.html#FloodOpacityProperty
+    /// https://www.w3.org/TR/SVG11/filters.html#feFloodElement
     ///
     /// https://www.w3.org/TR/filter-effects/#FloodOpacityProperty
     FloodOpacity,


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