mirror of
https://github.com/servo/servo.git
synced 2025-07-16 20:03:39 +01:00
layout: Add incremental box tree construction for inline floats and abspos (#37892)
Layout: Add incremental box tree construction for inline floats and abspos Due to false positives in the memory benchmark on CI, the previous PR [37868](https://github.com/servo/servo/pull/37868) reverted. Now it is resubmitted. Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
This commit is contained in:
parent
c65cd1eadd
commit
864c877be5
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