layout: Clean up inline layout data types a bit (#34563)

- Remove the `LayoutBox::InlineBox` variant that was only used for
  inline level boxes. Now they are stored in `LayoutBox::InlineLevel`
  along with other kinds of out-of-flow and atomic inline items.
- Reduce the size of `InlineItem` by 260 bytes per item by using atomic
  indirection / pointers. This adds a bit of overhead to access items in
  exchange for a lot of memory saved.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-12-11 15:40:34 +01:00 committed by GitHub
parent f1b8d49e77
commit 9d11d584f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 35 deletions

View file

@ -185,7 +185,6 @@ impl BoxTree {
},
_ => return None,
},
LayoutBox::InlineBox(_) => return None,
LayoutBox::InlineLevel(inline_level_box) => match &*inline_level_box.borrow() {
InlineItem::OutOfFlowAbsolutelyPositionedBox(_, text_offset_index)
if box_style.position.is_absolutely_positioned() =>