Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6a3930a0038082ecf2006593e6fd37f8b2468d2c
https://github.com/WebKit/WebKit/commit/6a3930a0038082ecf2006593e6fd37f8b2468d2c
Author: Wenson Hsieh <[email protected]>
Date: 2026-07-23 (Thu, 23 Jul 2026)
Changed paths:
M Source/WebCore/page/text-extraction/TextExtraction.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Automatically Fix Passwords: agent is occasionally unable
to click the "05 Settings" link on www.zara.com
https://bugs.webkit.org/show_bug.cgi?id=320137
rdar://183072168
Reviewed by Abrar Rahman Protyasha.
When handling a click interaction with a valid `uid` and `text`, we attempt to
search within the
`uid` for the given text, and reject the interaction if the search text can't
be found. In the case
where text in a click target spans two block-level elements, producing a text
extraction like the
following:
```
link uid=123 url=/settings
'05'
'SETTINGS'
…
```
...if the agent issues `click(uid="123", text="05 SETTINGS")`, this ends up
failing because we
expect `05\nSETTINGS` instead. Avoid this failure mode by relaxing the
heuristic for text-search-
based interactions, so that it's generally agnostic to whitespace (in this case
where an explicit
target was specified).
Test: TextExtractionTests.InteractionWithSearchTextSpanningBlockBoundary
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::searchTextMatchesElementLabelOrRenderedText):
(WebCore::TextExtraction::resolveMouseTarget):
(WebCore::TextExtraction::textDescription):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests,
InteractionWithSearchTextSpanningBlockBoundary)):
Canonical link: https://commits.webkit.org/317838@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications