Skip to content

Commit

Permalink
Auto merge of #16036 - chenpighead:text-size-adjust, r=upsuper
Browse files Browse the repository at this point in the history
Stylo: Add support for text-size-adjust property

<!-- Please describe your changes on the following line: -->

Gecko supports -{moz,webkit}-text-size-adjust properties, but it only supports auto and none value.
Implement parsing/serialization for text-size-adjust property and its gecko glue.

---
<!-- 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
- [X] These changes fix #16002 (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/16036)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Mar 20, 2017
2 parents 8d25dcb + 615c8cb commit 103e827
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/style/properties/gecko.mako.rs
Expand Up @@ -2606,7 +2606,7 @@ fn static_assert() {

<%self:impl_trait style_struct_name="InheritedText"
skip_longhands="text-align text-emphasis-style text-shadow line-height letter-spacing word-spacing
-webkit-text-stroke-width text-emphasis-position -moz-tab-size">
-webkit-text-stroke-width text-emphasis-position -moz-tab-size -moz-text-size-adjust">

<% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
"-moz-right match-parent char") %>
Expand Down Expand Up @@ -2789,6 +2789,10 @@ fn static_assert() {

<%call expr="impl_coord_copy('_moz_tab_size', 'mTabSize')"></%call>

<% text_size_adjust_keyword = Keyword("text-size-adjust", "auto none") %>

${impl_keyword('_moz_text_size_adjust', 'mTextSizeAdjust', text_size_adjust_keyword, need_clone=False)}

</%self:impl_trait>

<%self:impl_trait style_struct_name="Text"
Expand Down
7 changes: 7 additions & 0 deletions components/style/properties/longhand/inherited_text.mako.rs
Expand Up @@ -169,6 +169,13 @@ ${helpers.single_keyword("hyphens", "manual none auto",
products="gecko", animatable=False, extra_prefixes="moz",
spec="https://drafts.csswg.org/css-text/#propdef-hyphens")}

// TODO: Support <percentage>
${helpers.single_keyword("-moz-text-size-adjust", "auto none",
gecko_constant_prefix="NS_STYLE_TEXT_SIZE_ADJUST",
products="gecko", animatable=False,
spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control",
alias="-webkit-text-size-adjust")}

${helpers.predefined_type("text-indent",
"LengthOrPercentage",
"computed::LengthOrPercentage::Length(Au(0))",
Expand Down

0 comments on commit 103e827

Please sign in to comment.