mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Rework CB management during stacking context tree construction
Manage containing blocks and WebRender SpaceAndClip during stacking context tree constuction using the ContainingBlockInfo data structure. This will allow us to reuse this data structure whenever we traverse the fragment tree. In addition, StackingContextBuilder is no longer necessary at all. This change also fixes some bugs where fixed position fragments were not placed in the correct spatial node. Unfortunately, these fixes are difficult to test because of #29659.
This commit is contained in:
parent
0cffe557c2
commit
0c13fcb9f2
10 changed files with 466 additions and 322 deletions
|
@ -12,8 +12,7 @@ use crate::formatting_contexts::{
|
|||
IndependentFormattingContext, IndependentLayout, NonReplacedFormattingContext,
|
||||
};
|
||||
use crate::fragments::{
|
||||
AbsoluteOrFixedPositionedFragment, AnonymousFragment, BoxFragment, CollapsedBlockMargins,
|
||||
CollapsedMargin, Fragment, Tag,
|
||||
AnonymousFragment, BoxFragment, CollapsedBlockMargins, CollapsedMargin, Fragment, Tag,
|
||||
};
|
||||
use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
|
||||
|
@ -215,10 +214,7 @@ fn layout_block_level_children(
|
|||
placement_state.current_block_direction_position,
|
||||
inline: Length::new(0.),
|
||||
};
|
||||
fragment
|
||||
.hoisted_fragment
|
||||
.borrow_mut()
|
||||
.adjust_offsets(offset);
|
||||
fragment.borrow_mut().adjust_offsets(offset);
|
||||
},
|
||||
Fragment::Anonymous(_) => {},
|
||||
_ => unreachable!(),
|
||||
|
@ -380,10 +376,7 @@ impl BlockLevelBox {
|
|||
);
|
||||
let hoisted_fragment = hoisted_box.fragment.clone();
|
||||
positioning_context.push(hoisted_box);
|
||||
Fragment::AbsoluteOrFixedPositioned(AbsoluteOrFixedPositionedFragment {
|
||||
hoisted_fragment,
|
||||
position: box_.borrow().context.style().clone_position(),
|
||||
})
|
||||
Fragment::AbsoluteOrFixedPositioned(hoisted_fragment)
|
||||
},
|
||||
BlockLevelBox::OutOfFlowFloatBox(_box_) => {
|
||||
// FIXME: call layout_maybe_position_relative_fragment here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue