Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d4e39a7b23f05a89946768376a788b9e5812cce7
https://github.com/WebKit/WebKit/commit/d4e39a7b23f05a89946768376a788b9e5812cce7
Author: Wenson Hsieh <[email protected]>
Date: 2026-06-16 (Tue, 16 Jun 2026)
Changed paths:
M Source/WebCore/page/text-extraction/TextExtraction.cpp
M Tools/TestWebKitAPI/Resources/cocoa/debug-text-extraction.html
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Include context about enclosing buttons and links when
collecting interaction information for images
https://bugs.webkit.org/show_bug.cgi?id=317245
rdar://179860950
Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.
Images inside buttons and links sometimes lack sufficient context to convey
their actual purpose
(beyond presentational information, based on the image source URL); try to
remedy this by always
walking up to the nearest ancestor link or button when extracting context for
an image, and include
that context even in the case where the image itself already contains a source
URL or alt text.
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::closestLinkOrButtonAncestor):
(WebCore::TextExtraction::textDescription):
* Tools/TestWebKitAPI/Resources/cocoa/debug-text-extraction.html:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::TEST(TextExtractionTests, InteractionDebugDescription)):
Canonical link: https://commits.webkit.org/315343@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications