mirror of
https://github.com/servo/servo.git
synced 2025-07-17 04:13:42 +01:00
layout: Add incremental box tree construction for inline atomics (#37866)
This changes extend the incremental box tree construction for inline atomic 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
291b42f6e9
commit
75e5c1bced
2 changed files with 33 additions and 7 deletions
|
@ -290,7 +290,7 @@ impl<'dom, 'style> BlockContainerBuilder<'dom, 'style> {
|
|||
|
||||
if inline_table {
|
||||
self.ensure_inline_formatting_context_builder()
|
||||
.push_atomic(ifc);
|
||||
.push_atomic(|| ArcRefCell::new(ifc), None);
|
||||
} else {
|
||||
let table_block = ArcRefCell::new(BlockLevelBox::Independent(ifc));
|
||||
|
||||
|
@ -472,15 +472,20 @@ impl<'dom> BlockContainerBuilder<'dom, '_> {
|
|||
// If this inline element is an atomic, handle it and return.
|
||||
let context = self.context;
|
||||
let propagated_data = self.propagated_data;
|
||||
let atomic = self.ensure_inline_formatting_context_builder().push_atomic(
|
||||
IndependentFormattingContext::construct(
|
||||
|
||||
let construction_callback = || {
|
||||
ArcRefCell::new(IndependentFormattingContext::construct(
|
||||
context,
|
||||
info,
|
||||
display_inside,
|
||||
contents,
|
||||
propagated_data,
|
||||
),
|
||||
);
|
||||
))
|
||||
};
|
||||
let old_layout_box = box_slot.take_layout_box_if_undamaged(info.damage);
|
||||
let atomic = self
|
||||
.ensure_inline_formatting_context_builder()
|
||||
.push_atomic(construction_callback, old_layout_box);
|
||||
box_slot.set(LayoutBox::InlineLevel(vec![atomic]));
|
||||
return;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue