Skip to content

Commit

Permalink
Auto merge of #14956 - upsuper:geometry-boxes, r=Manishearth
Browse files Browse the repository at this point in the history
Extend supported geometry box value for geckolib

<!-- Please describe your changes on the following line: -->
r? @Manishearth

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14956)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jan 11, 2017
2 parents 12c71c5 + 0a56ec3 commit e440a01
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
13 changes: 13 additions & 0 deletions components/style/properties/gecko.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
</%self:simple_image_array_property>

Expand All @@ -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
}
</%self:simple_image_array_property>

Expand Down
1 change: 1 addition & 0 deletions components/style/properties/longhand/background.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
6 changes: 2 additions & 4 deletions components/style/properties/longhand/svg.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,18 @@ ${helpers.single_keyword("mask-repeat",
}
</%helpers:vector_longhand>

// 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",
Expand Down
8 changes: 8 additions & 0 deletions components/style/properties/shorthand/mask.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit e440a01

Please sign in to comment.