Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REGRESSION (253685@main): [ Monterey wk2 ] fast/images/text-recognition/mac/cursor-types-for-recognized-text.html is a consistent failure #3680

Conversation

vitorroriz
Copy link
Contributor

@vitorroriz vitorroriz commented Aug 25, 2022

543df0e

REGRESSION (253685@main): [ Monterey wk2 ] fast/images/text-recognition/mac/cursor-types-for-recognized-text.html is a consistent failure
https://bugs.webkit.org/show_bug.cgi?id=244272
<rdar://99051044>

Reviewed by Wenson Hsieh.

Test was failing because (253685@main) sets cursor:pointer for <a> with links,
since this behavior can't be obtained from cursor:auto according to specification.

Our live-text feature creates a overlay (a <div>) on the shadow DOM tree that depends on
cursor:auto behavior to render a IBeam cursor while hovering the text on top
of the image on the overlay. In this test, we had a <img> inside a <a>. After (253685@main)
the div overlay was inheriting cursor:pointer from the <a> and therefore, we would not
render a IBeam cursor for it.

Solution: We are now styling the div#image-overlay in imageOverlay.css with cursor:auto.
In that way, user can still style the wrapper image, and we preserve cursor:auto by default
for div#image-overlay.

* LayoutTests/fast/images/text-recognition/mac/cursor-types-for-recognized-text-expected.txt:
* LayoutTests/fast/images/text-recognition/mac/cursor-types-for-recognized-text.html:
testImage now tests the cursor hovering on the image area out of the text area.
testOverlayDivFromImage tests the cursor hovering the overlay div on the text area.

We have now 6 tests:
1. cursor on the image inside a link, out of text area, should be "Hand".
2. cursor on the image, with custom cursor, out of text area, should custom cursor.
3. cursor on the image, with user-select-none, inside a link, should be "Hand".
4. cursor on text area of overlay from image [1] should be "IBeam" (hinting selection).
5. cursor on text area of overlay from image [2] should be "IBeam" (hinting selection).
6. cursor on text area of overlay from image [3] should be Default (in our code called Pointer),
since [3] has user-select-none.

* Source/WebCore/html/shadow/imageOverlay.css:
(div#image-overlay):
Adding cursor:auto to div#image-overlay so we can hint text selection with IBeam cursor.

Canonical link: https://commits.webkit.org/253823@main

889ca70

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac   πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@vitorroriz vitorroriz force-pushed the eng/REGRESSION-253685main--Monterey-wk2--fastimagestext-recognitionmaccursor-types-for-recognized-text-html-is-a-consistent-failure branch from 7f8d50b to 889ca70 Compare August 25, 2022 23:31
@vitorroriz vitorroriz changed the title REGRESSION (253685@main): [ Monterey wk2 ] fast/images/text-recogniti… REGRESSION (253685@main): [ Monterey wk2 ] fast/images/text-recognition/mac/cursor-types-for-recognized-text.html is a consistent failure Aug 25, 2022
@vitorroriz vitorroriz self-assigned this Aug 25, 2022
@vitorroriz vitorroriz added New Bugs Unclassified bugs are placed in this component until the correct component can be determined. WebKit Nightly Build labels Aug 25, 2022
@karlrackler karlrackler added the merge-queue Applied to send a pull request to merge-queue label Aug 26, 2022
…on/mac/cursor-types-for-recognized-text.html is a consistent failure

https://bugs.webkit.org/show_bug.cgi?id=244272
<rdar://99051044>

Reviewed by Wenson Hsieh.

Test was failing because (253685@main) sets cursor:pointer for <a> with links,
since this behavior can't be obtained from cursor:auto according to specification.

Our live-text feature creates a overlay (a <div>) on the shadow DOM tree that depends on
cursor:auto behavior to render a IBeam cursor while hovering the text on top
of the image on the overlay. In this test, we had a <img> inside a <a>. After (253685@main)
the div overlay was inheriting cursor:pointer from the <a> and therefore, we would not
render a IBeam cursor for it.

Solution: We are now styling the div#image-overlay in imageOverlay.css with cursor:auto.
In that way, user can still style the wrapper image, and we preserve cursor:auto by default
for div#image-overlay.

* LayoutTests/fast/images/text-recognition/mac/cursor-types-for-recognized-text-expected.txt:
* LayoutTests/fast/images/text-recognition/mac/cursor-types-for-recognized-text.html:
testImage now tests the cursor hovering on the image area out of the text area.
testOverlayDivFromImage tests the cursor hovering the overlay div on the text area.

We have now 6 tests:
1. cursor on the image inside a link, out of text area, should be "Hand".
2. cursor on the image, with custom cursor, out of text area, should custom cursor.
3. cursor on the image, with user-select-none, inside a link, should be "Hand".
4. cursor on text area of overlay from image [1] should be "IBeam" (hinting selection).
5. cursor on text area of overlay from image [2] should be "IBeam" (hinting selection).
6. cursor on text area of overlay from image [3] should be Default (in our code called Pointer),
since [3] has user-select-none.

* Source/WebCore/html/shadow/imageOverlay.css:
(div#image-overlay):
Adding cursor:auto to div#image-overlay so we can hint text selection with IBeam cursor.

Canonical link: https://commits.webkit.org/253823@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/REGRESSION-253685main--Monterey-wk2--fastimagestext-recognitionmaccursor-types-for-recognized-text-html-is-a-consistent-failure branch from 889ca70 to 543df0e Compare August 26, 2022 17:16
@webkit-commit-queue
Copy link
Collaborator

Committed 253823@main (543df0e): https://commits.webkit.org/253823@main

Reviewed commits have been landed. Closing PR #3680 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 543df0e into WebKit:main Aug 26, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 26, 2022
@vitorroriz vitorroriz deleted the eng/REGRESSION-253685main--Monterey-wk2--fastimagestext-recognitionmaccursor-types-for-recognized-text-html-is-a-consistent-failure branch September 14, 2022 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
5 participants