haikuwebkit/LayoutTests/fast/images/text-recognition/mac
Wenson Hsieh 73ad7e50c2 [Live Text] Use iBeam cursor when hovering over selectable text inside image links
https://bugs.webkit.org/show_bug.cgi?id=228700
rdar://81210248

Reviewed by Tim Horton.

Source/WebCore:

Make a couple of small adjustments to allow the cursor to change to an I-beam when hovering over selectable Live
Text inside images in links, but only in the case where the computed cursor type is Auto. Currently, this always
results in a Hand cursor type because of the link ancestor, despite the injected Live Text being selectable.

Test: fast/images/text-recognition/mac/cursor-types-for-recognized-text.html

* html/HTMLElement.cpp:
(WebCore::HTMLElement::updateWithTextRecognitionResult):

Drive-by fix an adjacent bug, wherein we try to check whether the image element has `user-select: none;` before
the style has been resolved, which results in injecting selectable Live Text even when the page has explicitly
disabled text selection on the image element. Instead, move this code to right after we update layout after
ensuring the UA shadow DOM structure for Live Text, so that the bool flag is meaningful.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):

LayoutTests:

Add a layout test that hovers over Live Text in several different image elements, and checks their respective
cursor types.

* fast/images/text-recognition/mac/cursor-types-for-recognized-text-expected.txt: Added.
* fast/images/text-recognition/mac/cursor-types-for-recognized-text.html: Added.


Canonical link: https://commits.webkit.org/240175@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-02 18:56:17 +00:00
..
copy-image-overlay-text-with-context-menu-expected.txt
copy-image-overlay-text-with-context-menu.html
cursor-types-for-recognized-text-expected.txt [Live Text] Use iBeam cursor when hovering over selectable text inside image links 2021-08-02 18:56:17 +00:00
cursor-types-for-recognized-text.html [Live Text] Use iBeam cursor when hovering over selectable text inside image links 2021-08-02 18:56:17 +00:00
image-overlay-maintain-selection-during-size-change-expected.txt
image-overlay-maintain-selection-during-size-change.html
image-overlay-text-disables-app-highlight-menu-items-expected.txt
image-overlay-text-disables-app-highlight-menu-items.html
select-image-overlay-in-link-with-mouse-drag-expected.txt
select-image-overlay-in-link-with-mouse-drag.html
select-image-overlay-with-mouse-drag-2-expected.html
select-image-overlay-with-mouse-drag-2.html
select-image-overlay-with-mouse-drag-does-not-fire-click-expected.txt
select-image-overlay-with-mouse-drag-does-not-fire-click.html
select-image-overlay-with-mouse-drag-expected-mismatch.html
select-image-overlay-with-mouse-drag.html
select-rotated-transparent-image-overlay-expected.html
select-rotated-transparent-image-overlay.html
select-word-in-draggable-image-overlay-expected-mismatch.html
select-word-in-draggable-image-overlay.html
select-word-in-transparent-image-overlay-expected-mismatch.html
select-word-in-transparent-image-overlay.html