mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 16:42:19 +02:00
For ASCII text, every character is its own grapheme - there are no combining characters or emoji sequences. This means grapheme boundary detection is trivial: next_boundary(i) is simply i+1. This commit adds AsciiGraphemeSegmenter, a simple Segmenter subclass that performs O(1) boundary lookups without any ICU overhead. TextNode::grapheme_segmenter() now checks if the text is ASCII and uses this fast path, avoiding expensive ICU BreakIterator cloning and boundary detection for the common case of ASCII-only text.
10 KiB
10 KiB