Add support for a stacking context pass to layout_2020

This adds an intermediary data structure that allows the display list
builder to move through the fragment tree in stacking context painting
order. Spatial nodes are built during this phase and all display list
items are added to the end of the display list.
This commit is contained in:
Martin Robinson 2020-02-13 11:47:47 +01:00
parent 6d6d16f7f4
commit 843df5b529
3 changed files with 180 additions and 78 deletions

View file

@ -181,9 +181,16 @@ impl BoxTreeRoot {
impl FragmentTreeRoot {
pub fn build_display_list(&self, builder: &mut crate::display_list::DisplayListBuilder) {
let mut stacking_context = Default::default();
for fragment in &self.children {
fragment.build_display_list(builder, &self.initial_containing_block)
fragment.build_stacking_context_tree(
builder,
&self.initial_containing_block,
&mut stacking_context,
);
}
stacking_context.build_display_list(builder);
}
pub fn print(&self) {