Auto merge of #15662 - canaltinova:column, r=Manishearth

Fix parsing methods of column-{gap,width}

<!-- Please describe your changes on the following line: -->
They weren't accepting {normal, auto} keywords. Fixed parsing methods of these properties.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15088 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/15662)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-20 10:28:03 -08:00 committed by GitHub
commit f86e711506
5 changed files with 76 additions and 15 deletions

View file

@ -628,6 +628,7 @@ impl Debug for ${style_struct.gecko_struct_name} {
# Types used with predefined_type()-defined properties that we can auto-generate.
predefined_types = {
"length::LengthOrAuto": impl_style_coord,
"length::LengthOrNormal": impl_style_coord,
"Length": impl_absolute_length,
"Position": impl_position,
"LengthOrPercentage": impl_style_coord,
@ -3041,7 +3042,7 @@ clip-path
</%self:impl_trait>
<%self:impl_trait style_struct_name="Column"
skip_longhands="column-count column-gap column-rule-width">
skip_longhands="column-count column-rule-width">
#[allow(unused_unsafe)]
pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) {
@ -3057,17 +3058,6 @@ clip-path
${impl_simple_copy('column_count', 'mColumnCount')}
pub fn set_column_gap(&mut self, v: longhands::column_gap::computed_value::T) {
use values::Either;
match v {
Either::First(len) => self.gecko.mColumnGap.set(len),
Either::Second(_normal) => self.gecko.mColumnGap.set_value(CoordDataValue::Normal),
}
}
<%call expr="impl_coord_copy('column_gap', 'mColumnGap')"></%call>
<% impl_app_units("column_rule_width", "mColumnRuleWidth", need_clone=True,
round_to_pixels=True) %>
</%self:impl_trait>