mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Linebreak the entire InlineFormattingContext at once (#32483)
Instead of linebreaking inside each single-font text segment, linebreak the entire inline formatting context at once. This has several benefits: 1. It allows us to use `icu_segmenter` (already in use from style), which is written against a newer version of the Unicode spec -- preventing breaking emoji clusters. 2. Opens up the possibility of changing the way that linebreaking and shaping work -- eventually allowing shaping across inline box boundaries and line breaking *after* shaping. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
This commit is contained in:
parent
43a7dd5da0
commit
bae9f6d844
50 changed files with 356 additions and 220 deletions
|
@ -131,8 +131,16 @@ impl InlineFormattingContextBuilder {
|
|||
ArcRefCell::new(InlineLevelBox::Atomic(independent_formatting_context));
|
||||
self.current_inline_level_boxes()
|
||||
.push(inline_level_box.clone());
|
||||
|
||||
// Push an object replacement character for this atomic, which will ensure that the line breaker
|
||||
// inserts a line breaking opportunity here.
|
||||
let string_to_push = "\u{fffc}";
|
||||
self.text_segments.push(string_to_push.to_owned());
|
||||
self.current_text_offset += string_to_push.len();
|
||||
|
||||
self.last_inline_box_ended_with_collapsible_white_space = false;
|
||||
self.on_word_boundary = true;
|
||||
|
||||
inline_level_box
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue