mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
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>
This commit is contained in:
parent
c9d25963a7
commit
95e32f8372
13 changed files with 127 additions and 163 deletions
|
@ -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
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue