Bug 1348615 - [stylo] gecko glue code for text-size-adjust. draft
authorJeremy Chen <jeremychen@mozilla.com>
Sun, 19 Mar 2017 11:36:14 +0800
changeset 501231 f5e93917df554d8a459bc8d3cfbf57c3901fe0fe
parent 501163 e1576dd8bd9d3a4ca418cf347133b8a4957ddeca
child 501232 3cf822a3642d15e1ac8777e5c962ca93fd3eafbe
push id49909
push userjichen@mozilla.com
push dateSun, 19 Mar 2017 03:36:58 +0000
bugs1348615
milestone55.0a1
Bug 1348615 - [stylo] gecko glue code for text-size-adjust. MozReview-Commit-ID: 4QyFX1gRUCT
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhand/inherited_text.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -2601,17 +2601,17 @@ fn static_assert() {
         self.gecko.mBorderSpacingRow = other.gecko.mBorderSpacingRow;
     }
 
 </%self:impl_trait>
 
 
 <%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") %>
     ${impl_keyword('text_align', 'mTextAlign', text_align_keyword, need_clone=False)}
 
     pub fn set_text_shadow(&mut self, v: longhands::text_shadow::computed_value::T) {
         self.gecko.mTextShadow.replace_with_new(v.0.len() as u32);
 
@@ -2784,16 +2784,20 @@ fn static_assert() {
             Either::First(au) => {
                 self.gecko.mTabSize.set(au);
             }
         }
     }
 
     <%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"
                   skip_longhands="text-decoration-line text-overflow"
                   skip_additionals="*">
 
     pub fn set_text_decoration_line(&mut self, v: longhands::text_decoration_line::computed_value::T) {
         let mut bits: u8 = 0;
--- a/servo/components/style/properties/longhand/inherited_text.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_text.mako.rs
@@ -164,16 +164,23 @@
                          animatable=False,
                          spec="https://drafts.csswg.org/css-text/#propdef-text-transform")}
 
 ${helpers.single_keyword("hyphens", "manual none auto",
                          gecko_enum_prefix="StyleHyphens",
                          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))",
                           animatable=True,
                           spec="https://drafts.csswg.org/css-text/#propdef-text-indent")}
 
 // Also known as "word-wrap" (which is more popular because of IE), but this is the preferred
 // name per CSS-TEXT 6.2.