From 99aee290dbee2a38c3a4c133f910c4ee11526c63 Mon Sep 17 00:00:00 2001 From: Lucjan Suski Date: Wed, 22 Mar 2017 11:08:31 +0100 Subject: [PATCH] Stylo: Add gecko glue for grid-auto-flow --- components/style/properties/gecko.mako.rs | 23 ++++++++++++++++++- .../properties/longhand/position.mako.rs | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 3c84ea6e402..753a3db5f68 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -953,7 +953,7 @@ fn static_assert() { <%self:impl_trait style_struct_name="Position" skip_longhands="${skip_position_longhands} z-index box-sizing order align-content justify-content align-self justify-self align-items - justify-items grid-auto-rows grid-auto-columns"> + justify-items grid-auto-rows grid-auto-columns grid-auto-flow"> % for side in SIDES: <% impl_split_style_coord("%s" % side.ident, "mOffset", @@ -1103,6 +1103,27 @@ fn static_assert() { } % endfor + pub fn set_grid_auto_flow(&mut self, v: longhands::grid_auto_flow::computed_value::T) { + use gecko_bindings::structs::NS_STYLE_GRID_AUTO_FLOW_ROW; + use gecko_bindings::structs::NS_STYLE_GRID_AUTO_FLOW_COLUMN; + use gecko_bindings::structs::NS_STYLE_GRID_AUTO_FLOW_DENSE; + use properties::longhands::grid_auto_flow::computed_value::AutoFlow::{Row, Column}; + + self.gecko.mGridAutoFlow = 0; + + let value = match v.autoflow { + Row => NS_STYLE_GRID_AUTO_FLOW_ROW, + Column => NS_STYLE_GRID_AUTO_FLOW_COLUMN, + }; + + self.gecko.mGridAutoFlow |= value as u8; + + if v.dense { + self.gecko.mGridAutoFlow |= NS_STYLE_GRID_AUTO_FLOW_DENSE as u8; + } + } + + ${impl_simple_copy('grid_auto_flow', 'mGridAutoFlow')} <% skip_outline_longhands = " ".join("outline-style outline-width".split() + diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index 602be097ec2..db4aeb518be 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -326,7 +326,7 @@ ${helpers.predefined_type("object-position", <%helpers:longhand name="grid-auto-flow" spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow" - products="none" + products="gecko" animatable="False"> use std::fmt; use style_traits::ToCss;