mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move some CSS properties from Box to Position
This commit is contained in:
parent
281e385ab2
commit
aae8919da4
5 changed files with 31 additions and 27 deletions
|
@ -165,10 +165,10 @@ impl PropertyAnimation {
|
|||
[MarginLeft; get_margin; margin_left],
|
||||
[MarginRight; get_margin; margin_right],
|
||||
[MarginTop; get_margin; margin_top],
|
||||
[MaxHeight; get_box; max_height],
|
||||
[MaxWidth; get_box; max_width],
|
||||
[MinHeight; get_box; min_height],
|
||||
[MinWidth; get_box; min_width],
|
||||
[MaxHeight; get_position; max_height],
|
||||
[MaxWidth; get_position; max_width],
|
||||
[MinHeight; get_position; min_height],
|
||||
[MinWidth; get_position; min_width],
|
||||
[Opacity; get_effects; opacity],
|
||||
[OutlineColor; get_outline; outline_color],
|
||||
[OutlineWidth; get_outline; outline_width],
|
||||
|
@ -182,7 +182,7 @@ impl PropertyAnimation {
|
|||
[VerticalAlign; get_box; vertical_align],
|
||||
[Visibility; get_inheritedbox; visibility],
|
||||
[Width; get_box; width],
|
||||
[ZIndex; get_box; z_index]);
|
||||
[ZIndex; get_position; z_index]);
|
||||
|
||||
let property_animation = PropertyAnimation {
|
||||
property: animated_property,
|
||||
|
@ -263,10 +263,10 @@ impl PropertyAnimation {
|
|||
[MarginLeft; mutate_margin; margin_left],
|
||||
[MarginRight; mutate_margin; margin_right],
|
||||
[MarginTop; mutate_margin; margin_top],
|
||||
[MaxHeight; mutate_box; max_height],
|
||||
[MaxWidth; mutate_box; max_width],
|
||||
[MinHeight; mutate_box; min_height],
|
||||
[MinWidth; mutate_box; min_width],
|
||||
[MaxHeight; mutate_position; max_height],
|
||||
[MaxWidth; mutate_position; max_width],
|
||||
[MinHeight; mutate_position; min_height],
|
||||
[MinWidth; mutate_position; min_width],
|
||||
[Opacity; mutate_effects; opacity],
|
||||
[OutlineColor; mutate_outline; outline_color],
|
||||
[OutlineWidth; mutate_outline; outline_width],
|
||||
|
@ -282,7 +282,7 @@ impl PropertyAnimation {
|
|||
[VerticalAlign; mutate_box; vertical_align],
|
||||
[Visibility; mutate_inheritedbox; visibility],
|
||||
[Width; mutate_box; width],
|
||||
[ZIndex; mutate_box; z_index]);
|
||||
[ZIndex; mutate_position; z_index]);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -588,6 +588,8 @@ pub mod longhands {
|
|||
|
||||
</%self:longhand>
|
||||
|
||||
${switch_to_style_struct("Position")}
|
||||
|
||||
<%self:longhand name="z-index">
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
|
@ -656,6 +658,8 @@ pub mod longhands {
|
|||
"computed::LengthOrPercentageOrAuto::Auto",
|
||||
"parse_non_negative")}
|
||||
|
||||
${switch_to_style_struct("Position")}
|
||||
|
||||
${predefined_type("min-width", "LengthOrPercentage",
|
||||
"computed::LengthOrPercentage::Length(Au(0))",
|
||||
"parse_non_negative")}
|
||||
|
@ -2509,7 +2513,7 @@ pub mod longhands {
|
|||
|
||||
// CSS Basic User Interface Module Level 3
|
||||
// http://dev.w3.org/csswg/css-ui/
|
||||
${switch_to_style_struct("Box")}
|
||||
${switch_to_style_struct("Position")}
|
||||
|
||||
${single_keyword("box-sizing", "content-box border-box")}
|
||||
|
||||
|
@ -6404,26 +6408,26 @@ impl ServoComputedValues {
|
|||
|
||||
#[inline]
|
||||
pub fn min_inline_size(&self) -> computed::LengthOrPercentage {
|
||||
let box_style = self.get_box();
|
||||
if self.writing_mode.is_vertical() { box_style.min_height } else { box_style.min_width }
|
||||
let position_style = self.get_position();
|
||||
if self.writing_mode.is_vertical() { position_style.min_height } else { position_style.min_width }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn min_block_size(&self) -> computed::LengthOrPercentage {
|
||||
let box_style = self.get_box();
|
||||
if self.writing_mode.is_vertical() { box_style.min_width } else { box_style.min_height }
|
||||
let position_style = self.get_position();
|
||||
if self.writing_mode.is_vertical() { position_style.min_width } else { position_style.min_height }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn max_inline_size(&self) -> computed::LengthOrPercentageOrNone {
|
||||
let box_style = self.get_box();
|
||||
if self.writing_mode.is_vertical() { box_style.max_height } else { box_style.max_width }
|
||||
let position_style = self.get_position();
|
||||
if self.writing_mode.is_vertical() { position_style.max_height } else { position_style.max_width }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn max_block_size(&self) -> computed::LengthOrPercentageOrNone {
|
||||
let box_style = self.get_box();
|
||||
if self.writing_mode.is_vertical() { box_style.max_width } else { box_style.max_height }
|
||||
let position_style = self.get_position();
|
||||
if self.writing_mode.is_vertical() { position_style.max_width } else { position_style.max_height }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue