mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -359,7 +359,7 @@ impl CandidateBSizeIterator {
|
|||
};
|
||||
|
||||
// If the style includes `box-sizing: border-box`, subtract the border and padding.
|
||||
let adjustment_for_box_sizing = match fragment.style.get_box().box_sizing {
|
||||
let adjustment_for_box_sizing = match fragment.style.get_position().box_sizing {
|
||||
box_sizing::T::border_box => fragment.border_padding.block_start_end(),
|
||||
box_sizing::T::content_box => Au(0),
|
||||
};
|
||||
|
@ -1308,7 +1308,7 @@ impl BlockFlow {
|
|||
let opaque_self = OpaqueFlow::from_flow(self);
|
||||
|
||||
// Calculate non-auto block size to pass to children.
|
||||
let box_border = match self.fragment.style().get_box().box_sizing {
|
||||
let box_border = match self.fragment.style().get_position().box_sizing {
|
||||
box_sizing::T::border_box => self.fragment.border_padding.block_start_end(),
|
||||
box_sizing::T::content_box => Au(0),
|
||||
};
|
||||
|
@ -2189,7 +2189,7 @@ pub trait ISizeAndMarginsComputer {
|
|||
parent_flow_inline_size,
|
||||
layout_context);
|
||||
let style = block.fragment.style();
|
||||
match (computed_inline_size, style.get_box().box_sizing) {
|
||||
match (computed_inline_size, style.get_position().box_sizing) {
|
||||
(MaybeAuto::Specified(size), box_sizing::T::border_box) => {
|
||||
computed_inline_size =
|
||||
MaybeAuto::Specified(size - block.fragment.border_padding.inline_start_end())
|
||||
|
|
|
@ -2192,7 +2192,7 @@ impl Fragment {
|
|||
// FIXME(pcwalton): Don't unconditionally form stacking contexts for `overflow_x: scroll`
|
||||
// and `overflow_y: scroll`. This needs multiple layers per stacking context.
|
||||
match (self.style().get_box().position,
|
||||
self.style().get_box().z_index,
|
||||
self.style().get_position().z_index,
|
||||
self.style().get_box().overflow_x,
|
||||
self.style().get_box().overflow_y.0) {
|
||||
(position::T::absolute,
|
||||
|
@ -2224,15 +2224,15 @@ impl Fragment {
|
|||
pub fn effective_z_index(&self) -> i32 {
|
||||
match self.style().get_box().position {
|
||||
position::T::static_ => {},
|
||||
_ => return self.style().get_box().z_index.number_or_zero(),
|
||||
_ => return self.style().get_position().z_index.number_or_zero(),
|
||||
}
|
||||
|
||||
if self.style().get_effects().transform.0.is_some() {
|
||||
return self.style().get_box().z_index.number_or_zero();
|
||||
return self.style().get_position().z_index.number_or_zero();
|
||||
}
|
||||
|
||||
match self.style().get_box().display {
|
||||
display::T::flex => self.style().get_box().z_index.number_or_zero(),
|
||||
display::T::flex => self.style().get_position().z_index.number_or_zero(),
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ pub fn compute_damage(old: Option<&Arc<ServoComputedValues>>, new: &ServoCompute
|
|||
get_border.border_bottom_style, get_border.border_left_style,
|
||||
get_border.border_top_left_radius, get_border.border_top_right_radius,
|
||||
get_border.border_bottom_left_radius, get_border.border_bottom_right_radius,
|
||||
get_box.z_index, get_box._servo_overflow_clip_box,
|
||||
get_position.z_index, get_box._servo_overflow_clip_box,
|
||||
get_inheritedtext._servo_text_decorations_in_effect,
|
||||
get_pointing.cursor, get_pointing.pointer_events,
|
||||
get_effects.box_shadow, get_effects.clip, get_inheritedtext.text_shadow, get_effects.filter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue