servo: Merge #13450 - Make use of Servo's border-spacing in Stylo (from Wafflespeanut:border_spacing); r=Manishearth
authorRavi Shankar <wafflespeanut@gmail.com>
Fri, 30 Sep 2016 00:25:08 -0500
changeset 339780 e8a71b34c922ee2da331d84231a8e60b3597f031
parent 339779 901376bd662f228eb270df232a0d771b1d1bc6d5
child 339781 164955232a8734c9dae47841439a3bf4fb34ce95
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
servo: Merge #13450 - Make use of Servo's border-spacing in Stylo (from Wafflespeanut:border_spacing); r=Manishearth <!-- Please describe your changes on the following line: --> --- <!-- 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 <!-- Either: --> - [x] These changes have been tested manually ![screenshot](https://cloud.githubusercontent.com/assets/6691262/18867760/1fa46376-84c3-11e6-8e63-9fce042f5bb0.png) r? @Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 76092c437c267baf4f5d14da63d2ebaa25125a94
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhand/inherited_table.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1437,16 +1437,32 @@ fn static_assert() {
                 color: Color::RGBA(convert_nscolor_to_rgba(shadow.mColor)),
             }
         }).collect();
         longhands::box_shadow::computed_value::T(buf)
     }
 </%self:impl_trait>
 
 
+<%self:impl_trait style_struct_name="InheritedTable"
+                  skip_longhands="border-spacing">
+
+    pub fn set_border_spacing(&mut self, v: longhands::border_spacing::computed_value::T) {
+        self.gecko.mBorderSpacingCol = v.horizontal.0;
+        self.gecko.mBorderSpacingRow = v.vertical.0;
+    }
+
+    pub fn copy_border_spacing_from(&mut self, other: &Self) {
+        self.gecko.mBorderSpacingCol = other.gecko.mBorderSpacingCol;
+        self.gecko.mBorderSpacingRow = other.gecko.mBorderSpacingRow;
+    }
+
+</%self:impl_trait>
+
+
 <%self:impl_trait style_struct_name="InheritedText"
                   skip_longhands="text-align text-shadow line-height word-spacing">
 
     <% text_align_keyword = Keyword("text-align", "start end left right center justify -moz-center -moz-left " +
                                                   "-moz-right match-parent") %>
     ${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) {
--- a/servo/components/style/properties/longhand/inherited_table.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_table.mako.rs
@@ -11,17 +11,17 @@
                          animatable=False)}
 ${helpers.single_keyword("empty-cells", "show hide",
                          gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS",
                          animatable=False)}
 ${helpers.single_keyword("caption-side", "top bottom",
                          extra_gecko_values="right left top-outside bottom-outside",
                          animatable=False)}
 
-<%helpers:longhand name="border-spacing" products="servo" animatable="False">
+<%helpers:longhand name="border-spacing" animatable="False">
     use app_units::Au;
     use values::LocalToCss;
     use values::HasViewportPercentage;
 
     use cssparser::ToCss;
     use std::fmt;
 
     pub mod computed_value {