From 1a915fa07cfb5b198f91a6f64a589497330ca4a1 Mon Sep 17 00:00:00 2001 From: daisuke Date: Mon, 29 May 2017 16:12:35 +0900 Subject: [PATCH] Implements svg related discrete animatable properties --- components/style/properties/gecko.mako.rs | 23 ++----------------- .../style/properties/longhand/svg.mako.rs | 8 +++---- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index af454a4c631b..bcbf1a7946b0 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -4049,27 +4049,8 @@ clip-path skip_additionals="*"> <% impl_common_image_layer_properties("mask") %> - - <%self:simple_image_array_property name="mode" shorthand="mask" field_name="mMaskMode"> - use properties::longhands::mask_mode::single_value::computed_value::T; - - match servo { - T::alpha => structs::NS_STYLE_MASK_MODE_ALPHA as u8, - T::luminance => structs::NS_STYLE_MASK_MODE_LUMINANCE as u8, - T::match_source => structs::NS_STYLE_MASK_MODE_MATCH_SOURCE as u8, - } - - <%self:simple_image_array_property name="composite" shorthand="mask" field_name="mComposite"> - use properties::longhands::mask_composite::single_value::computed_value::T; - - match servo { - T::add => structs::NS_STYLE_MASK_COMPOSITE_ADD as u8, - T::subtract => structs::NS_STYLE_MASK_COMPOSITE_SUBTRACT as u8, - T::intersect => structs::NS_STYLE_MASK_COMPOSITE_INTERSECT as u8, - T::exclude => structs::NS_STYLE_MASK_COMPOSITE_EXCLUDE as u8, - } - - + <% impl_simple_image_array_property("mode", "mask", "mMask", "mMaskMode", "SVG") %> + <% impl_simple_image_array_property("composite", "mask", "mMask", "mComposite", "SVG") %> <% impl_shape_source("clip_path", "mClipPath") %> diff --git a/components/style/properties/longhand/svg.mako.rs b/components/style/properties/longhand/svg.mako.rs index db5ab6dcde0e..c9704795b8a9 100644 --- a/components/style/properties/longhand/svg.mako.rs +++ b/components/style/properties/longhand/svg.mako.rs @@ -67,7 +67,7 @@ ${helpers.single_keyword("mask-mode", "match-source alpha luminance", vector=True, products="gecko", - animation_value_type="none", + animation_value_type="discrete", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode")} <%helpers:vector_longhand name="mask-repeat" products="gecko" animation_value_type="none" extra_prefixes="webkit" @@ -104,7 +104,7 @@ ${helpers.single_keyword("mask-clip", products="gecko", extra_prefixes="webkit", gecko_enum_prefix="StyleGeometryBox", - animation_value_type="none", + animation_value_type="discrete", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-clip")} ${helpers.single_keyword("mask-origin", @@ -114,7 +114,7 @@ ${helpers.single_keyword("mask-origin", products="gecko", extra_prefixes="webkit", gecko_enum_prefix="StyleGeometryBox", - animation_value_type="none", + animation_value_type="discrete", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-origin")} <%helpers:longhand name="mask-size" products="gecko" animation_value_type="ComputedValue" extra_prefixes="webkit" @@ -139,7 +139,7 @@ ${helpers.single_keyword("mask-composite", vector=True, products="gecko", extra_prefixes="webkit", - animation_value_type="none", + animation_value_type="discrete", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-composite")} ${helpers.predefined_type("mask-image", "ImageLayer",