[webkit-changes] [WebKit/WebKit] 51e91d: "Look Up" popover is not attached to highlighted w...
Alan Baradlay
noreply at github.com
Wed Feb 14 15:47:05 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 51e91d1ab3d410f7a84180cad93c22ccbec7f64f
https://github.com/WebKit/WebKit/commit/51e91d1ab3d410f7a84180cad93c22ccbec7f64f
Author: Alan Baradlay <zalan at apple.com>
Date: 2024-02-14 (Wed, 14 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/ios/accessibility/visible-character-range-basic-expected.txt
M LayoutTests/platform/ios/accessibility/visible-character-range-height-changes-expected.txt
M LayoutTests/platform/ios/accessibility/visible-character-range-width-changes-expected.txt
M LayoutTests/platform/mac/accessibility/element-line-rects-and-text-expected.txt
M LayoutTests/platform/mac/accessibility/visible-character-range-basic-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
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/274668@main
More information about the webkit-changes
mailing list