Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5060efe86a321543d57a2a1581de2ce2cd2e3a33
https://github.com/WebKit/WebKit/commit/5060efe86a321543d57a2a1581de2ce2cd2e3a33
Author: Vitor Roriz <[email protected]>
Date: 2024-04-23 (Tue, 23 Apr 2024)
Changed paths:
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/editing/TextIterator.cpp
M Source/WebCore/editing/TextIterator.h
Log Message:
-----------
TextIterator::emitText: cap textEndOffset to renderer's string length
https://bugs.webkit.org/show_bug.cgi?id=273090
rdar://125650526
Reviewed by Ryosuke Niwa.
With the use of text-transform, the renderer's text
can differ from the renderer's original text on
length.
For example, the German S sharp (ß) when text-transformed
to uppercase becomes "SS".
When TextIterator::emitText is requested to use the
original text due to TextIteratorBehavior::EmitsOriginalText,
the received textEndOffset can be potentially greater than
the render's original text.
In our example, we would get a textEndOffset of 2 and
originalText.length would be 1, given that originalText is ß.
For that reason, we cap the textEndOffset to
the string result's length. We are also using the original's
render text instead of render's text when EmitsOriginalText
is requested.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextRun):
(WebCore::TextIterator::emitText):
* Source/WebCore/editing/TextIterator.h:
(WebCore::TextIterator::rendererTextForBehavior const):
Canonical link: https://commits.webkit.org/277858@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes