Skip to content

Commit

Permalink
Implement gecko glue for column-gap and order properties
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Nov 22, 2016
1 parent 852fdca commit c8c7240
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
23 changes: 21 additions & 2 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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')}

</%self:impl_trait>

<% skip_outline_longhands = " ".join("outline-style outline-width".split() +
Expand Down Expand Up @@ -2244,7 +2254,7 @@ clip-path
</%self:impl_trait>

<%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 {
Expand All @@ -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')"></%call>

<% impl_app_units("_moz_column_rule_width", "mColumnRuleWidth", need_clone=True,
round_to_pixels=True) %>
</%self:impl_trait>
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/column.mako.rs
Expand Up @@ -169,7 +169,7 @@
</%helpers:longhand>

// 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;
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/position.mako.rs
Expand Up @@ -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 {}
Expand Down

0 comments on commit c8c7240

Please sign in to comment.