diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-04 19:52:25 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-04 19:52:25 -0700 |
commit | 8bc4785bed662f87149260d87e030471c326ec88 (patch) | |
tree | 1c99cf3c7051a5d3bf0ee87997bd1674ddd9c464 /components/style | |
parent | ec5f826d18adabbb0cf8d07b879b616dc5caa1aa (diff) | |
parent | 550d780e17860c463220246dcae1e84841c83887 (diff) | |
download | servo-8bc4785bed662f87149260d87e030471c326ec88.tar.gz servo-8bc4785bed662f87149260d87e030471c326ec88.zip |
Auto merge of #10999 - heycam:move-width-height, r=SimonSapin
Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10999)
<!-- Reviewable:end -->
Diffstat (limited to 'components/style')
-rw-r--r-- | components/style/animation.rs | 8 | ||||
-rw-r--r-- | components/style/properties/longhand/box.mako.rs | 10 | ||||
-rw-r--r-- | components/style/properties/longhand/position.mako.rs | 10 | ||||
-rw-r--r-- | components/style/properties/properties.mako.rs | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/components/style/animation.rs b/components/style/animation.rs index 9c0242aa971..08ae32baf0c 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -158,7 +158,7 @@ impl PropertyAnimation { [Color; get_color; color], [FontSize; get_font; font_size], [FontWeight; get_font; font_weight], - [Height; get_box; height], + [Height; get_position; height], [Left; get_position; left], [LineHeight; get_inheritedtext; line_height], [MarginBottom; get_margin; margin_bottom], @@ -181,7 +181,7 @@ impl PropertyAnimation { [Top; get_position; top], [VerticalAlign; get_box; vertical_align], [Visibility; get_inheritedbox; visibility], - [Width; get_box; width], + [Width; get_position; width], [ZIndex; get_position; z_index]); let property_animation = PropertyAnimation { @@ -256,7 +256,7 @@ impl PropertyAnimation { [Color; mutate_color; color], [FontSize; mutate_font; font_size], [FontWeight; mutate_font; font_weight], - [Height; mutate_box; height], + [Height; mutate_position; height], [Left; mutate_position; left], [LineHeight; mutate_inheritedtext; line_height], [MarginBottom; mutate_margin; margin_bottom], @@ -281,7 +281,7 @@ impl PropertyAnimation { [Transform; mutate_effects; transform], [VerticalAlign; mutate_box; vertical_align], [Visibility; mutate_inheritedbox; visibility], - [Width; mutate_box; width], + [Width; mutate_position; width], [ZIndex; mutate_position; z_index]); } diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index f1e3cfb5be5..a88db8bf03e 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -122,16 +122,6 @@ ${helpers.single_keyword("clear", "none left right both", gecko_ffi_name="mBreak </%helpers:longhand> -${helpers.predefined_type("width", - "LengthOrPercentageOrAuto", - "computed::LengthOrPercentageOrAuto::Auto", - "parse_non_negative")} - -${helpers.predefined_type("height", - "LengthOrPercentageOrAuto", - "computed::LengthOrPercentageOrAuto::Auto", - "parse_non_negative")} - <%helpers:longhand name="vertical-align"> use cssparser::ToCss; use std::fmt; diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index 41dc76ee3b6..c4ea596758d 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -96,6 +96,16 @@ ${helpers.predefined_type("flex-basis", ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse", products="gecko")} +${helpers.predefined_type("width", + "LengthOrPercentageOrAuto", + "computed::LengthOrPercentageOrAuto::Auto", + "parse_non_negative")} + +${helpers.predefined_type("height", + "LengthOrPercentageOrAuto", + "computed::LengthOrPercentageOrAuto::Auto", + "parse_non_negative")} + ${helpers.predefined_type("min-width", "LengthOrPercentage", "computed::LengthOrPercentage::Length(Au(0))", diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 6582d5a6020..0299b3a4276 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -972,18 +972,18 @@ impl ServoComputedValues { #[inline] pub fn content_inline_size(&self) -> computed::LengthOrPercentageOrAuto { - let box_style = self.get_box(); + let position_style = self.get_position(); if self.writing_mode.is_vertical() { - box_style.height + position_style.height } else { - box_style.width + position_style.width } } #[inline] pub fn content_block_size(&self) -> computed::LengthOrPercentageOrAuto { - let box_style = self.get_box(); - if self.writing_mode.is_vertical() { box_style.width } else { box_style.height } + let position_style = self.get_position(); + if self.writing_mode.is_vertical() { position_style.width } else { position_style.height } } #[inline] |