Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 777dd2c83c0ea4748670a4ab0a06bef0581f1a4a
      
https://github.com/WebKit/WebKit/commit/777dd2c83c0ea4748670a4ab0a06bef0581f1a4a
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    A 
LayoutTests/fast/text-extraction/debug-text-extraction-button-like-div-expected.txt
    A 
LayoutTests/fast/text-extraction/debug-text-extraction-button-like-div.html
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Source/WebKit/Shared/TextExtractionToStringConversion.cpp

  Log Message:
  -----------
  [Text Extraction] Treat small, visually-distinct elements as clickable for 
the purpose of simulating clicks
https://bugs.webkit.org/show_bug.cgi?id=320777
rdar://183765548

Reviewed by Abrar Rahman Protyasha.

Adjust the text extraction `looksVisuallyClickable` heuristic, to not require 
potential targets to
have `cursor: pointer;` as
long as:

- The target is short
- The target contains a small amount of rendered text
- The target passes the `hasVisuallyDistinctStyling` check.

Test: fast/text-extraction/debug-text-extraction-button-like-div.html

* 
LayoutTests/fast/text-extraction/debug-text-extraction-button-like-div-expected.txt:
 Added.
* LayoutTests/fast/text-extraction/debug-text-extraction-button-like-div.html: 
Added.
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::containsInteractiveDescendant):
(WebCore::TextExtraction::looksLikeButton):
(WebCore::TextExtraction::looksVisuallyClickable):
* Source/WebKit/Shared/TextExtractionToStringConversion.cpp:
(WebKit::shouldEmitClickableToken):
(WebKit::addPartsForItem):

Also make a slight adjustment here, to avoid emitting `clickable` for 
visually-clickable elements if
they already have an accessibility role that clearly suggests it's clickable.

Canonical link:
https://flagged.apple.com:443/proxy?t2=DB0B7q6fX0&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE4NDczQG1haW4=&emid=48fe944b-f387-433e-8f9f-be561f93e9c5&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to