From 0a56ec3477528e3a763b3378f7c7b14c3fd87144 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 11 Jan 2017 21:14:13 +1100 Subject: [PATCH] Extend supported geometry box value for geckolib --- components/style/properties/gecko.mako.rs | 13 +++++++++++++ .../style/properties/longhand/background.mako.rs | 1 + components/style/properties/longhand/svg.mako.rs | 6 ++---- components/style/properties/shorthand/mask.mako.rs | 8 ++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 31d87340066..4d3b1c999ca 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1565,6 +1565,14 @@ fn static_assert() { T::border_box => StyleGeometryBox::Border, T::padding_box => StyleGeometryBox::Padding, T::content_box => StyleGeometryBox::Content, + % if shorthand == "mask": + T::fill_box => StyleGeometryBox::Fill, + T::stroke_box => StyleGeometryBox::Stroke, + T::view_box => StyleGeometryBox::View, + T::no_clip => StyleGeometryBox::NoClip, + % elif shorthand == "background": + T::text => StyleGeometryBox::Text, + % endif } @@ -1576,6 +1584,11 @@ fn static_assert() { T::border_box => StyleGeometryBox::Border, T::padding_box => StyleGeometryBox::Padding, T::content_box => StyleGeometryBox::Content, + % if shorthand == "mask": + T::fill_box => StyleGeometryBox::Fill, + T::stroke_box => StyleGeometryBox::Stroke, + T::view_box => StyleGeometryBox::View, + % endif } diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index 780a4d174e5..a69f6fe6de6 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -203,6 +203,7 @@ ${helpers.single_keyword("background-attachment", ${helpers.single_keyword("background-clip", "border-box padding-box content-box", + extra_gecko_values="text", vector=True, extra_prefixes="webkit", spec="https://drafts.csswg.org/css-backgrounds/#the-background-clip", animatable=False)} diff --git a/components/style/properties/longhand/svg.mako.rs b/components/style/properties/longhand/svg.mako.rs index d6a9e288273..5e294b0b77f 100644 --- a/components/style/properties/longhand/svg.mako.rs +++ b/components/style/properties/longhand/svg.mako.rs @@ -158,20 +158,18 @@ ${helpers.single_keyword("mask-repeat", } -// missing: margin-box fill-box stroke-box view-box no-clip -// (gecko doesn't implement these) ${helpers.single_keyword("mask-clip", "content-box padding-box border-box", + extra_gecko_values="fill-box stroke-box view-box no-clip", vector=True, products="gecko", extra_prefixes="webkit", animatable=False, spec="https://drafts.fxtf.org/css-masking/#propdef-mask-clip")} -// missing: margin-box fill-box stroke-box view-box -// (gecko doesn't implement these) ${helpers.single_keyword("mask-origin", "content-box padding-box border-box", + extra_gecko_values="fill-box stroke-box view-box", vector=True, products="gecko", extra_prefixes="webkit", diff --git a/components/style/properties/shorthand/mask.mako.rs b/components/style/properties/shorthand/mask.mako.rs index de43370089e..2846cd15b9f 100644 --- a/components/style/properties/shorthand/mask.mako.rs +++ b/components/style/properties/shorthand/mask.mako.rs @@ -20,6 +20,14 @@ mask_clip::single_value::SpecifiedValue::padding_box, mask_origin::single_value::SpecifiedValue::border_box => mask_clip::single_value::SpecifiedValue::border_box, + % if product == "gecko": + mask_origin::single_value::SpecifiedValue::fill_box => + mask_clip::single_value::SpecifiedValue::fill_box, + mask_origin::single_value::SpecifiedValue::stroke_box => + mask_clip::single_value::SpecifiedValue::stroke_box, + mask_origin::single_value::SpecifiedValue::view_box => + mask_clip::single_value::SpecifiedValue::view_box, + % endif } } }