From c8c7240dc21d4e9d8998deecbe504ea4046bf02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 22 Nov 2016 01:01:15 +0300 Subject: [PATCH] Implement gecko glue for column-gap and order properties --- components/style/properties/gecko.mako.rs | 23 +++++++++++++++++-- .../style/properties/longhand/column.mako.rs | 2 +- .../properties/longhand/position.mako.rs | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 20fa243d3f4f..c84de932be18 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -810,7 +810,7 @@ fn static_assert() { <% skip_position_longhands = " ".join(x.ident for x in SIDES) %> <%self:impl_trait style_struct_name="Position" - skip_longhands="${skip_position_longhands} z-index box-sizing"> + skip_longhands="${skip_position_longhands} z-index box-sizing order"> % for side in SIDES: <% impl_split_style_coord("%s" % side.ident, @@ -860,6 +860,16 @@ fn static_assert() { } ${impl_simple_copy('box_sizing', 'mBoxSizing')} + pub fn set_order(&mut self, v: longhands::order::computed_value::T) { + self.gecko.mOrder = v; + } + + pub fn clone_order(&self) -> longhands::order::computed_value::T { + self.gecko.mOrder + } + + ${impl_simple_copy('order', 'mOrder')} + <% skip_outline_longhands = " ".join("outline-style outline-width".split() + @@ -2244,7 +2254,7 @@ clip-path <%self:impl_trait style_struct_name="Column" - skip_longhands="column-width column-count -moz-column-rule-width"> + skip_longhands="column-width column-count column-gap -moz-column-rule-width"> pub fn set_column_width(&mut self, v: longhands::column_width::computed_value::T) { match v.0 { @@ -2269,6 +2279,15 @@ clip-path ${impl_simple_copy('column_count', 'mColumnCount')} + pub fn set_column_gap(&mut self, v: longhands::column_gap::computed_value::T) { + match v.0 { + Some(len) => self.gecko.mColumnGap.set(len), + None => self.gecko.mColumnGap.set_value(CoordDataValue::Normal), + } + } + + <%call expr="impl_coord_copy('column_gap', 'mColumnGap')"> + <% impl_app_units("_moz_column_rule_width", "mColumnRuleWidth", need_clone=True, round_to_pixels=True) %> diff --git a/components/style/properties/longhand/column.mako.rs b/components/style/properties/longhand/column.mako.rs index 6f6ca6da816c..3df4d8e25269 100644 --- a/components/style/properties/longhand/column.mako.rs +++ b/components/style/properties/longhand/column.mako.rs @@ -169,7 +169,7 @@ // FIXME: This prop should be animatable. -<%helpers:longhand name="column-gap" experimental="True" products="servo" animatable="False"> +<%helpers:longhand name="column-gap" experimental="True" animatable="False"> use std::fmt; use style_traits::ToCss; use values::HasViewportPercentage; diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index 716c4f81ac84..a02790931165 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -107,7 +107,7 @@ ${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center animatable=False)} // https://drafts.csswg.org/css-flexbox/#propdef-order -<%helpers:longhand name="order" products="servo" animatable="True"> +<%helpers:longhand name="order" animatable="True"> use values::computed::ComputedValueAsSpecified; impl ComputedValueAsSpecified for SpecifiedValue {}