-
-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Iterate over text chunks using a grapheme-aware segmenter
Our current text iterator is not aware of multi-code point graphemes. Instead of simply incrementing an iterator one code point at a time, use our Unicode grapheme segmenter to break text into fragments.
- Loading branch information
1 parent
aef85a8
commit f0105b4
Showing
5 changed files
with
84 additions
and
32 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
Tests/LibWeb/Layout/expected/multi-code-point-graphemes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline | ||
BlockContainer <body> at (8,16) content-size 784x83 children: not-inline | ||
BlockContainer <p> at (8,16) content-size 784x17 children: inline | ||
frag 0 from TextNode start: 0, length: 11, rect: [8,16 20.3125x17] baseline: 13.296875 | ||
"🧑🚒" | ||
TextNode <#text> | ||
BlockContainer <(anonymous)> at (8,49) content-size 784x0 children: inline | ||
TextNode <#text> | ||
BlockContainer <p> at (8,49) content-size 784x17 children: inline | ||
frag 0 from TextNode start: 0, length: 13, rect: [8,49 20.3125x17] baseline: 13.296875 | ||
"🏴☠️" | ||
TextNode <#text> | ||
BlockContainer <(anonymous)> at (8,82) content-size 784x0 children: inline | ||
TextNode <#text> | ||
BlockContainer <p> at (8,82) content-size 784x17 children: inline | ||
frag 0 from TextNode start: 0, length: 25, rect: [8,82 20.3125x17] baseline: 13.296875 | ||
"🧑🧑🧒🧒" | ||
TextNode <#text> | ||
BlockContainer <(anonymous)> at (8,115) content-size 784x0 children: inline | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<BODY>) [8,16 784x83] overflow: [8,16 784x99] | ||
PaintableWithLines (BlockContainer<P>) [8,16 784x17] | ||
TextPaintable (TextNode<#text>) | ||
PaintableWithLines (BlockContainer(anonymous)) [8,49 784x0] | ||
PaintableWithLines (BlockContainer<P>) [8,49 784x17] | ||
TextPaintable (TextNode<#text>) | ||
PaintableWithLines (BlockContainer(anonymous)) [8,82 784x0] | ||
PaintableWithLines (BlockContainer<P>) [8,82 784x17] | ||
TextPaintable (TextNode<#text>) | ||
PaintableWithLines (BlockContainer(anonymous)) [8,115 784x0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>🧑🚒</p> | ||
<p>🏴☠️</p> | ||
<p>🧑🧑🧒🧒</p> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters