mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
This commit is contained in:
parent
2c69278067
commit
550d780e17
7 changed files with 25 additions and 25 deletions
|
@ -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;
|
||||
|
|
|
@ -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))",
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue