Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6c9721632fc5a1379b9e26ad416d22e37c67f7d4
https://github.com/WebKit/WebKit/commit/6c9721632fc5a1379b9e26ad416d22e37c67f7d4
Author: Yoel Hawa <[email protected]>
Date: 2026-01-08 (Thu, 08 Jan 2026)
Changed paths:
M Source/WebCore/Configurations/WebCore.xcconfig
M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.h
M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Log Message:
-----------
Include Image Controls in accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=304218
rdar://166549601
Reviewed by Joshua Hoffman.
This change makes images with controls return NO from
isAccessibilityElement, causing the controls to appear as children in
the accessibility tree. To preserve the image's alt text accessibility,
we create a mock UIAccessibilityElement that copies the image's
properties, then prepend it to the children array at index 0.
VoiceOver can now navigate to both the image content (via the mock
element) and the interactive controls.
* Source/WebCore/Configurations/WebCore.xcconfig:
Added conditional UIKit framework linking when
ENABLE_SPATIAL_IMAGE_CONTROLS is defined.
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
Added m_cachedMockImageElement to cache the mock element.
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
Added UIAccessibilityElement forward declaration and interface.
(mockImageElement):
Creates and caches mock element with image properties.
(determineIsAccessibilityElement):
Return NO for images with controls.
(accessibilityElements):
Prepend mock element to children array.
(accessibilityElementCount):
(accessibilityElementAtIndex):
(indexOfAccessibilityElement):
Mock element is at index 0, other indices shifted by +1.
(detach):
(_clearCachedIsAccessibilityElementState):
Clear cached mock element.
Canonical link: https://commits.webkit.org/305315@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications