mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
f1b8d49e77
commit
9d11d584f6
6 changed files with 35 additions and 35 deletions
|
@ -448,7 +448,8 @@ where
|
|||
|
||||
// Otherwise, this is just a normal inline box. Whatever happened before, all we need to do
|
||||
// before recurring is to remember this ongoing inline level box.
|
||||
self.inline_formatting_context_builder
|
||||
let inline_item = self
|
||||
.inline_formatting_context_builder
|
||||
.start_inline_box(InlineBox::new(info));
|
||||
|
||||
if is_list_item {
|
||||
|
@ -467,9 +468,8 @@ where
|
|||
|
||||
self.finish_anonymous_table_if_needed();
|
||||
|
||||
box_slot.set(LayoutBox::InlineBox(
|
||||
self.inline_formatting_context_builder.end_inline_box(),
|
||||
));
|
||||
self.inline_formatting_context_builder.end_inline_box();
|
||||
box_slot.set(LayoutBox::InlineLevel(inline_item));
|
||||
}
|
||||
|
||||
fn handle_block_level_element(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue