Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46b1da1ae7896695deaf55f14b3a51a1f17f50e0
      
https://github.com/WebKit/WebKit/commit/46b1da1ae7896695deaf55f14b3a51a1f17f50e0
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-07-19 (Sun, 19 Jul 2026)

  Changed paths:
    M Source/WebCore/page/text-extraction/TextExtraction.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm

  Log Message:
  -----------
  [Text Extraction] Interactions with both text & uid should work as long as 
the text matches accessibility label
https://bugs.webkit.org/show_bug.cgi?id=319786
rdar://182656863

Reviewed by Richard Robinson.

Allow a text extraction interaction such as `{ type: "click", text: "Edit 
Password", uid: "4805" }`
to perform a click over the Edit button in the following extraction results:

```
    role=tabpanel labelledby='Security & Login'
        'Password'
        '**********'
        button uid=4805 label='Edit Password' 'Edit'
…
```

Currently, this fails because we try to search the target element (4805) for 
the given text ("Edit
Password"), which fails because the only rendered text is "Edit". Make this 
interaction more robust
by allowing the click to go through even if the text search fails, as long as 
the text is a
substring of the accessibility label text.

Test: TextExtractionTests.InteractionSearchTextMatchesAccessibilityLabel

* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::resolveMouseTarget):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests, 
InteractionSearchTextMatchesAccessibilityLabel)):

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



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

Reply via email to