mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Have transforms and filters be CBs for all descendants in layout_2020
This is a feature that was never properly implemented in the previous layout system. We still need to preserve their in-tree order in the display list though.
This commit is contained in:
parent
d42835b238
commit
8de55695e4
16 changed files with 354 additions and 217 deletions
|
@ -223,7 +223,8 @@ fn layout_block_level_children<'a>(
|
|||
})
|
||||
.collect()
|
||||
} else {
|
||||
let has_positioned_ancestor = positioning_context.has_positioned_ancestor();
|
||||
let collects_for_nearest_positioned_ancestor =
|
||||
positioning_context.collects_for_nearest_positioned_ancestor();
|
||||
let mut fragments = child_boxes
|
||||
.par_iter()
|
||||
.enumerate()
|
||||
|
@ -238,7 +239,7 @@ fn layout_block_level_children<'a>(
|
|||
/* float_context = */ None,
|
||||
)
|
||||
},
|
||||
|| PositioningContext::new_for_rayon(has_positioned_ancestor),
|
||||
|| PositioningContext::new_for_rayon(collects_for_nearest_positioned_ancestor),
|
||||
PositioningContext::append,
|
||||
)
|
||||
.collect();
|
||||
|
@ -275,7 +276,7 @@ impl BlockLevelBox {
|
|||
tag,
|
||||
style,
|
||||
contents,
|
||||
} => Fragment::Box(positioning_context.for_maybe_position_relative(
|
||||
} => Fragment::Box(positioning_context.layout_maybe_position_relative_fragment(
|
||||
layout_context,
|
||||
containing_block,
|
||||
style,
|
||||
|
@ -293,7 +294,7 @@ impl BlockLevelBox {
|
|||
},
|
||||
)),
|
||||
BlockLevelBox::Independent(contents) => {
|
||||
Fragment::Box(positioning_context.for_maybe_position_relative(
|
||||
Fragment::Box(positioning_context.layout_maybe_position_relative_fragment(
|
||||
layout_context,
|
||||
containing_block,
|
||||
&contents.style,
|
||||
|
@ -326,8 +327,7 @@ impl BlockLevelBox {
|
|||
))
|
||||
},
|
||||
BlockLevelBox::OutOfFlowFloatBox(_box_) => {
|
||||
// FIXME: call for_maybe_position_relative here
|
||||
// TODO
|
||||
// FIXME: call layout_maybe_position_relative_fragment here
|
||||
Fragment::Anonymous(AnonymousFragment::no_op(
|
||||
containing_block.style.writing_mode,
|
||||
))
|
||||
|
|
|
@ -137,7 +137,8 @@ impl BoxTreeRoot {
|
|||
};
|
||||
|
||||
let dummy_tree_rank = 0;
|
||||
let mut positioning_context = PositioningContext::new_for_initial_containing_block();
|
||||
let mut positioning_context =
|
||||
PositioningContext::new_for_containing_block_for_all_descendants();
|
||||
let mut independent_layout = self.0.layout(
|
||||
layout_context,
|
||||
&mut positioning_context,
|
||||
|
@ -145,7 +146,7 @@ impl BoxTreeRoot {
|
|||
dummy_tree_rank,
|
||||
);
|
||||
|
||||
positioning_context.layout_in_initial_containing_block(
|
||||
positioning_context.layout_initial_containing_block_children(
|
||||
layout_context,
|
||||
&initial_containing_block,
|
||||
&mut independent_layout.fragments,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue