mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -136,6 +136,20 @@ impl LayoutBox {
|
|||
.repair_style(context, node, new_style),
|
||||
}
|
||||
}
|
||||
|
||||
/// If this [`LayoutBox`] represents an unsplit (due to inline-block splits) inline
|
||||
/// level item, unwrap and return it. If not, return `None`.
|
||||
pub(crate) fn unsplit_inline_level_layout_box(self) -> Option<ArcRefCell<InlineItem>> {
|
||||
let LayoutBox::InlineLevel(inline_level_boxes) = self else {
|
||||
return None;
|
||||
};
|
||||
// If this element box has been subject to inline-block splitting, ignore it. It's
|
||||
// not useful currently for incremental box tree construction.
|
||||
if inline_level_boxes.len() != 1 {
|
||||
return None;
|
||||
}
|
||||
inline_level_boxes.into_iter().next()
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper for [`InnerDOMLayoutData`]. This is necessary to give the entire data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue