Implement gecko glue for column-gap and order properties

This commit is contained in:
Nazım Can Altınova 2016-11-22 01:01:15 +03:00
parent 852fdca1c5
commit c8c7240dc2
3 changed files with 23 additions and 4 deletions

View file

@ -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')}
</%self:impl_trait>
<% skip_outline_longhands = " ".join("outline-style outline-width".split() +
@ -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 {
@ -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>

View file

@ -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;

View file

@ -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 {}