AX: Need to expose frames to iOS Accessibility
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Dec 2016 18:46:31 +0000 (18:46 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Dec 2016 18:46:31 +0000 (18:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166571
<rdar://problem/29823724>

Reviewed by Darin Adler.

To support navigation by frame for VoiceOver on iOS, we need to expose the frame ancestor.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

index c83743e..f7f3bc9 100644 (file)
@@ -1,3 +1,16 @@
+2016-12-29  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Need to expose frames to iOS Accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=166571
+        <rdar://problem/29823724>
+
+        Reviewed by Darin Adler.
+
+        To support navigation by frame for VoiceOver on iOS, we need to expose the frame ancestor. 
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):
+
 2016-12-09  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-grid] Move Grid into GridSizingData
index 63c7499..7b38fea 100644 (file)
@@ -583,6 +583,16 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     return nil;
 }
 
+- (AccessibilityObjectWrapper*)_accessibilityFrameAncestor
+{
+    auto* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) {
+        return object.isWebArea();
+    });
+    if (!parent)
+        return nil;
+    return parent->wrapper();
+}
+
 - (uint64_t)_accessibilityTraitsFromAncestors
 {
     uint64_t traits = 0;