aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-10-25 17:54:44 +0200
committerGitHub <noreply@github.com>2023-10-25 15:54:44 +0000
commit95e32f83727bb56978ae5aca8ac1424afc75afce (patch)
treed7b765cd1d6ea33d57c4851c78c98c5f6f9b2bf5 /components/layout_2020/flow/construct.rs
parentc9d25963a776014d75ccf1a6c7118875681263b3 (diff)
downloadservo-95e32f83727bb56978ae5aca8ac1424afc75afce.tar.gz
servo-95e32f83727bb56978ae5aca8ac1424afc75afce.zip
Make LineItems a token stream on the root (#30608)
Flattening the LineItem tree into a token stream will allow for handling the case where an unbreakable line segment spans multiple inline boxes which might have different hierarchies. This change also fixes the handling of the second anonymous fragment of a block-in-inline-split. Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r--components/layout_2020/flow/construct.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index dec184b9529..e2ef5c2aa52 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -475,8 +475,8 @@ where
self.ongoing_inline_boxes_stack.push(InlineBox {
base_fragment_info: info.into(),
style: info.style.clone(),
- first_fragment: true,
- last_fragment: false,
+ is_first_fragment: true,
+ is_last_fragment: false,
children: vec![],
});
@@ -498,7 +498,7 @@ where
.ongoing_inline_boxes_stack
.pop()
.expect("no ongoing inline level box found");
- inline_box.last_fragment = true;
+ inline_box.is_last_fragment = true;
ArcRefCell::new(InlineLevelBox::InlineBox(inline_box))
} else {
self.ongoing_inline_formatting_context.ends_with_whitespace = false;
@@ -537,13 +537,13 @@ where
let fragmented = InlineBox {
base_fragment_info: ongoing.base_fragment_info,
style: ongoing.style.clone(),
- first_fragment: ongoing.first_fragment,
+ is_first_fragment: ongoing.is_first_fragment,
// The fragmented boxes before the block level element
// are obviously not the last fragment.
- last_fragment: false,
+ is_last_fragment: false,
children: std::mem::take(&mut ongoing.children),
};
- ongoing.first_fragment = false;
+ ongoing.is_first_fragment = false;
fragmented
});