Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ea2579d9114edeb63671b57fb5ef7db5f1db245e
https://github.com/WebKit/WebKit/commit/ea2579d9114edeb63671b57fb5ef7db5f1db245e
Author: Wenson Hsieh <[email protected]>
Date: 2026-09-12 (Sat, 12 Sep 2026)
Changed paths:
M Source/WebCore/page/text-extraction/TextExtraction.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Include more sibling context to interaction descriptions
that only have a single word as rendered text
https://bugs.webkit.org/show_bug.cgi?id=324023
rdar://187255119
Reviewed by Abrar Rahman Protyasha.
For links that both:
1. Don't have any semantically interesting information in the `href`.
2. Have at most 1 single word in their rendered text.
…instead of surfacing them in interaction summaries as:
```
Click on link with href “#”, with rendered text “Edit”
```
…make sure that we include predecessor context, similar to how we handle `svg`
image icons and other
text-less controls:
```
Click on link with href “#” after rendered text “Your password ••••••••••”,
with rendered text “Edit”
```
This allows Automatically Fix Passwords' supervision agent to (reliably)
approve this interaction.
Test:
TextExtractionTests.InteractionDescriptionUsesAdjacentTextForSingleWordLinkWithoutDestination
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::hrefLacksEnoughContext):
(WebCore::TextExtraction::containsMultipleWords):
(WebCore::TextExtraction::textDescription):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::extractNodeIdentifier):
(TestWebKitAPI::TEST(TextExtractionTests,
InteractionDescriptionUsesAdjacentTextForSingleWordLinkWithoutDestination)):
Canonical link: https://commits.webkit.org/320995@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications