Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4cc311091515165d384c55e063c66346d17fb4a6
https://github.com/WebKit/WebKit/commit/4cc311091515165d384c55e063c66346d17fb4a6
Author: Wenson Hsieh <[email protected]>
Date: 2026-09-03 (Thu, 03 Sep 2026)
Changed paths:
M Source/WebCore/page/text-extraction/TextExtraction.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm
Log Message:
-----------
[Text Extraction] Some checkboxes on google.com are invisible to Safari MCP
https://bugs.webkit.org/show_bug.cgi?id=323270
rdar://186510338
Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.
On some google.com subdomains, checkboxes and radio buttons are implemented in
such a way where:
- The actual `input` elements are hidden (`opacity: 0;`).
- What (visually) looks like the checkbox or radio button is actually a plain
SVG icon, hidden
from the accessibility tree.
As a result, these elements are effectively hidden from the agent because the
accessible elements
are fully transparent, and the non-accessible elements are filtered out as
noise.
To fix this, augment the extraction heuristic to detect when transparent form
controls are overlaid
over or under with sibling elements of the same size (similar to how we detect
transparent controls
with visible labels in the DOM), and surface them anyways.
Test: TextExtractionTests.ExtractTransparentCheckboxOverVisualProxy
* Source/WebCore/page/text-extraction/TextExtraction.cpp:
(WebCore::TextExtraction::paintsVisibleContent):
(WebCore::TextExtraction::visualProxyForTransparentControl):
(WebCore::TextExtraction::extractItemData):
(WebCore::TextExtraction::extractRecursive):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/TextExtractionTests.mm:
(TestWebKitAPI::ExtractTransparentCheckboxOverVisualProxy)):
Canonical link: https://commits.webkit.org/320421@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications