layout: Flatten inline box storage in InlineFormattingContexts (#32539)

This accomplishes two things:

1. Makes it easier to iterate through all inline formatting context
   items.
2. Will make it possible to easily move back and forth through the tree
   of inline boxes, in order to enable reordering and splitting inline
   boxes on lines -- necessary for BiDi.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
This commit is contained in:
Martin Robinson 2024-06-19 10:51:10 +02:00 committed by GitHub
parent 4803514196
commit e74075255b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 225 additions and 253 deletions

View file

@ -22,7 +22,7 @@ use crate::cell::ArcRefCell;
use crate::context::LayoutContext;
use crate::dom_traversal::WhichPseudoElement;
use crate::flexbox::FlexLevelBox;
use crate::flow::inline::InlineLevelBox;
use crate::flow::inline::{InlineBox, InlineItem};
use crate::flow::BlockLevelBox;
use crate::geom::PhysicalSize;
use crate::replaced::{CanvasInfo, CanvasSource};
@ -39,7 +39,9 @@ pub struct InnerDOMLayoutData {
pub(super) enum LayoutBox {
DisplayContents,
BlockLevel(ArcRefCell<BlockLevelBox>),
InlineLevel(ArcRefCell<InlineLevelBox>),
#[allow(dead_code)]
InlineBox(ArcRefCell<InlineBox>),
InlineLevel(ArcRefCell<InlineItem>),
FlexLevel(ArcRefCell<FlexLevelBox>),
}