[webkit-reviews] review granted: [Bug 234758] [LFC][IFC] Take grapheme clusters into account when keeping the first "character" on the line : [Attachment 448115] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 31 00:47:23 PST 2021


Antti Koivisto <koivisto at iki.fi> has granted  review:
Bug 234758: [LFC][IFC] Take grapheme clusters into account when keeping the
first "character" on the line
https://bugs.webkit.org/show_bug.cgi?id=234758

Attachment 448115: Patch

https://bugs.webkit.org/attachment.cgi?id=448115&action=review




--- Comment #2 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 448115
  --> https://bugs.webkit.org/attachment.cgi?id=448115
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448115&action=review

> Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:296
> +    auto graphemeClustersIterator = NonSharedCharacterBreakIterator {
textContent };
> +    auto nextPosition = ubrk_following(graphemeClustersIterator,
inlineTextItem.start());
> +    if (nextPosition == UBRK_DONE)
> +	   return inlineTextItem.length();
> +    return nextPosition - inlineTextItem.start();

Isn't it slow to make the iterator repeatedly? Maybe we should cache it or make
it in the caller?


More information about the webkit-reviews mailing list