mirror of
https://github.com/servo/servo.git
synced 2025-07-18 04:43:41 +01:00
layout: Add incremental box tree construction for inline floats and abspos (#37868)
This changes extend the incremental box tree construction for inline out-of-flow-box, including the `InlineItem::OutOfFlowAbsolutelyPositionedBox` and `InlineItem::OutOfFlowFloatBox`. Testing: This should not change observable behavior and is thus covered by existing WPT tests. Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
This commit is contained in:
parent
5eb7c397fe
commit
19ceccc8eb
3 changed files with 66 additions and 28 deletions
|
@ -604,13 +604,17 @@ impl<'dom> BlockContainerBuilder<'dom, '_> {
|
|||
) {
|
||||
if let Some(builder) = self.inline_formatting_context_builder.as_mut() {
|
||||
if !builder.is_empty() {
|
||||
let inline_level_box =
|
||||
builder.push_absolutely_positioned_box(AbsolutelyPositionedBox::construct(
|
||||
let constructor = || {
|
||||
ArcRefCell::new(AbsolutelyPositionedBox::construct(
|
||||
self.context,
|
||||
info,
|
||||
display_inside,
|
||||
contents,
|
||||
));
|
||||
))
|
||||
};
|
||||
let old_layout_box = box_slot.take_layout_box_if_undamaged(info.damage);
|
||||
let inline_level_box =
|
||||
builder.push_absolutely_positioned_box(constructor, old_layout_box);
|
||||
box_slot.set(LayoutBox::InlineLevel(vec![inline_level_box]));
|
||||
return;
|
||||
}
|
||||
|
@ -637,13 +641,17 @@ impl<'dom> BlockContainerBuilder<'dom, '_> {
|
|||
) {
|
||||
if let Some(builder) = self.inline_formatting_context_builder.as_mut() {
|
||||
if !builder.is_empty() {
|
||||
let inline_level_box = builder.push_float_box(FloatBox::construct(
|
||||
self.context,
|
||||
info,
|
||||
display_inside,
|
||||
contents,
|
||||
self.propagated_data,
|
||||
));
|
||||
let constructor = || {
|
||||
ArcRefCell::new(FloatBox::construct(
|
||||
self.context,
|
||||
info,
|
||||
display_inside,
|
||||
contents,
|
||||
self.propagated_data,
|
||||
))
|
||||
};
|
||||
let old_layout_box = box_slot.take_layout_box_if_undamaged(info.damage);
|
||||
let inline_level_box = builder.push_float_box(constructor, old_layout_box);
|
||||
box_slot.set(LayoutBox::InlineLevel(vec![inline_level_box]));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue