Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implements svg related discrete animatable properties
  • Loading branch information
daisuke authored and daisuke committed May 29, 2017
1 parent 23e673f commit 1a915fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
23 changes: 2 additions & 21 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -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>
<%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,
}
</%self:simple_image_array_property>

<% 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") %>
</%self:impl_trait>

Expand Down
8 changes: 4 additions & 4 deletions components/style/properties/longhand/svg.mako.rs
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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"
Expand All @@ -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",
Expand Down

0 comments on commit 1a915fa

Please sign in to comment.