diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-07-03 17:15:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 15:15:31 +0000 |
commit | 4e79ac57018039b2d3f76e4a4616574e5d90505f (patch) | |
tree | 4bf2be5b94636e81b67b6bae8c2c55737a45703f /components/layout_2020/flow/inline/construct.rs | |
parent | 4357751f285c79bf37a8e7a02d4c8dc4f7a8ae69 (diff) | |
download | servo-4e79ac57018039b2d3f76e4a4616574e5d90505f.tar.gz servo-4e79ac57018039b2d3f76e4a4616574e5d90505f.zip |
layout: Allow rendering LineItems independent of inline box (#32666)
Refactor inline layout to allow rendering line items in the second stage
to be rendered in any order, independent of their parent inline box.
This will allow line items to be reordered, effectively allowing the
splitting of inline boxes, for the purposes of BiDi and any other inline
reordering feature.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
Diffstat (limited to 'components/layout_2020/flow/inline/construct.rs')
-rw-r--r-- | components/layout_2020/flow/inline/construct.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/components/layout_2020/flow/inline/construct.rs b/components/layout_2020/flow/inline/construct.rs index 88b86961564..02751e356de 100644 --- a/components/layout_2020/flow/inline/construct.rs +++ b/components/layout_2020/flow/inline/construct.rs @@ -165,12 +165,15 @@ impl InlineFormattingContextBuilder { } fn end_inline_box_internal(&mut self) -> InlineBoxIdentifier { - self.inline_boxes.end_inline_box(); + let identifier = self + .inline_box_stack + .pop() + .expect("Ended non-existent inline box"); self.inline_items .push(ArcRefCell::new(InlineItem::EndInlineBox)); - self.inline_box_stack - .pop() - .expect("Ended non-existent inline box") + + self.inline_boxes.end_inline_box(identifier); + identifier } pub(crate) fn push_text<'dom, Node: NodeExt<'dom>>( |