[webkit-changes] [WebKit/WebKit] 2b0a31: "Look Up" popover is not attached to highlighted w...
Alan Baradlay
noreply at github.com
Fri Feb 16 08:02:49 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2b0a31814c1c6c323a5b8d4694a22d6aadfc3325
https://github.com/WebKit/WebKit/commit/2b0a31814c1c6c323a5b8d4694a22d6aadfc3325
Author: Alan Baradlay <zalan at apple.com>
Date: 2024-02-16 (Fri, 16 Feb 2024)
Changed paths:
M LayoutTests/accessibility/element-line-rects-and-text.html
M LayoutTests/editing/text-iterator/sequential-collapsed-ranges-expected.txt
M LayoutTests/editing/text-iterator/sequential-collapsed-ranges.html
M LayoutTests/editing/text-iterator/subrange-with-trailing-collapsed-whitespace-expected.txt
M LayoutTests/editing/text-iterator/subrange-with-trailing-collapsed-whitespace.html
M LayoutTests/platform/ios-simulator-wk2/accessibility/visible-character-range-height-changes-expected.txt
M LayoutTests/platform/ios-simulator-wk2/accessibility/visible-character-range-width-changes-expected.txt
M LayoutTests/platform/ios/accessibility/element-line-rects-and-text-expected.txt
M LayoutTests/platform/mac/accessibility/element-line-rects-and-text-expected.txt
M LayoutTests/platform/mac/accessibility/visible-character-range-height-changes-expected.txt
M LayoutTests/platform/mac/accessibility/visible-character-range-scrolling-expected.txt
M LayoutTests/platform/mac/accessibility/visible-character-range-width-changes-expected.txt
M Source/WebCore/editing/TextIterator.cpp
M Source/WebCore/editing/TextIteratorBehavior.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIMenus.mm
Log Message:
-----------
"Look Up" popover is not attached to highlighted words at the end of a line on New York Times
https://bugs.webkit.org/show_bug.cgi?id=269341
<rdar://120695659>
Reviewed by Ryosuke Niwa.
This patch ensures that we _always_ bail out of iterating the text content when beyond the range end position,
even when we are at a previously collapsed (trimmed) whitespace.
- remove TextIteratorBehavior::IgnoresWhiteSpaceAtEndOfRun workaround
- check for _range_ end (and not run end what IgnoresWhiteSpaceAtEndOfRun does) to see if we need to emit a whitespace
accessibility/element-line-rects-and-text.html seems to expect preserved trailing whitespace (the -expected.html change is unrelated to this patch
and is caused by continuation.
* LayoutTests/editing/text-iterator/sequential-collapsed-ranges.html:
* LayoutTests/editing/text-iterator/subrange-with-trailing-collapsed-whitespace.html:
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextRun):
* Source/WebCore/editing/TextIteratorBehavior.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::locationFromRange):
(WebCore::Internals::lengthFromRange):
(WebCore::Internals::statesOfTextIterator):
(WebCore::toTextIteratorBehaviors): Deleted.
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
(WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
Canonical link: https://commits.webkit.org/274829@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list