mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
aef85a83bd
commit
f0105b473b
34
Tests/LibWeb/Layout/expected/multi-code-point-graphemes.txt
Normal file
34
Tests/LibWeb/Layout/expected/multi-code-point-graphemes.txt
Normal file
@@ -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]
|
||||
@@ -0,0 +1,3 @@
|
||||
<p>🧑🚒</p>
|
||||
<p>🏴☠️</p>
|
||||
<p>🧑🧑🧒🧒</p>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user