diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-10-10 09:37:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 09:37:29 -0500 |
commit | aef6054dc64043860e90ca962b60c51c683789f2 (patch) | |
tree | 3d2688cd2097875af4141c2603c2a0051adbf550 | |
parent | 960d884fd4dd2ad5dabfb4dd9d52e50f9d5c292c (diff) | |
parent | 4271167f82ae4e0c047732ec1936c778b8676c74 (diff) | |
download | servo-aef6054dc64043860e90ca962b60c51c683789f2.tar.gz servo-aef6054dc64043860e90ca962b60c51c683789f2.zip |
Auto merge of #13674 - Manishearth:column_count, r=emilio
Implement column-count in stylo
Unblocks column-fill easy property
r? @emilio
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13674)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/properties/gecko.mako.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 3c61bba4577..add67265fdf 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -468,8 +468,6 @@ impl Debug for ${style_struct.gecko_struct_name} { # transition "transition-duration", "transition-timing-function", "transition-property", "transition-delay", - - "column-count", # column ] # Types used with predefined_type()-defined properties that we can auto-generate. @@ -1911,7 +1909,7 @@ clip-path </%self:impl_trait> <%self:impl_trait style_struct_name="Column" - skip_longhands="column-width"> + skip_longhands="column-width column-count"> pub fn set_column_width(&mut self, v: longhands::column_width::computed_value::T) { match v.0 { @@ -1921,6 +1919,17 @@ clip-path } ${impl_coord_copy('column_width', 'mColumnWidth')} + + pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) { + use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount}; + + self.gecko.mColumnCount = match v.0 { + Some(number) => cmp::min(number, nsStyleColumn_kMaxColumnCount), + None => NS_STYLE_COLUMN_COUNT_AUTO + }; + } + + ${impl_simple_copy('column_count', 'mColumnCount')} </%self:impl_trait> <%self:impl_trait style_struct_name="Counters" |