Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3f30614bd4ead34b1686dc3ec0341678f7a5c02a
https://github.com/WebKit/WebKit/commit/3f30614bd4ead34b1686dc3ec0341678f7a5c02a
Author: Wenson Hsieh <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M Source/WebCore/page/text-extraction/TextExtraction.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Add more context before SVG icons without any relevant
accessibility attributes
https://bugs.webkit.org/show_bug.cgi?id=319142
rdar://181959554
Reviewed by Abrar Rahman Protyasha and Richard Robinson.
Make a couple of adjustments when handling SVG images during text extraction,
to give agents more
context when reasoning about clickable icons with no accessibility attributes:
- Surface them as `image` items (similar to the `img` element), but without a
`src` attribute.
- When producing an interaction description for an SVG, if there are no
relevant accessibility
attributes in any ancestor element or descendants, fall back to collecting
text samples from
immediately preceding rendered text.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::extractItemData):
(WebCore::TextExtraction::containsLetterOrDigit):
(WebCore::TextExtraction::precedingRenderedTextLabel):
(WebCore::TextExtraction::textDescription):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests,
InteractionDescriptionUsesAdjacentTextForUnlabeledIcon)):
Canonical link: https://commits.webkit.org/316956@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications