AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messag...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 17:00:29 +0000 (17:00 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 17:00:29 +0000 (17:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170330
<rdar://problem/31366105>

Reviewed by Joanmarie Diggs.

Source/WebCore:

Add a search ability for the "article" role.

Test: accessibility/mac/search-predicate-article.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(createAccessibilitySearchKeyMap):

LayoutTests:

* accessibility/mac/search-predicate-article-expected.txt:
* accessibility/mac/search-predicate-article.html:

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

LayoutTests/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm

index 855f1e0..00f24be 100644 (file)
@@ -1,3 +1,14 @@
+2017-04-11  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=170330
+        <rdar://problem/31366105>
+
+        Reviewed by Joanmarie Diggs.
+
+        * accessibility/mac/search-predicate-article-expected.txt:
+        * accessibility/mac/search-predicate-article.html:
+
 2017-04-11  Joseph Pecoraro  <pecoraro@apple.com>
 
         test262: test262/test/annexB/language/comments/multi-line-html-close.js
index bce9f47..db6eed3 100644 (file)
@@ -1,5 +1,25 @@
 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
 
+        AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=170330
+        <rdar://problem/31366105>
+
+        Reviewed by Joanmarie Diggs.
+
+        Add a search ability for the "article" role.
+
+        Test: accessibility/mac/search-predicate-article.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
+        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+        (createAccessibilitySearchKeyMap):
+
+2017-04-11  Chris Fleizach  <cfleizach@apple.com>
+
         AX: PDF plugin needs to support PDF-DOM Mode
         https://bugs.webkit.org/show_bug.cgi?id=170589
 
index d285f04..dbf75f7 100644 (file)
@@ -128,6 +128,9 @@ bool AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex(AccessibilityO
     case AnyTypeSearchKey:
         return true;
         
+    case ArticleSearchKey:
+        return axObject->roleValue() == DocumentArticleRole;
+            
     case BlockquoteSameLevelSearchKey:
         return criteria->startObject
             && axObject->isBlockquote()
index 1c73331..472a22c 100644 (file)
@@ -315,6 +315,7 @@ enum AccessibilitySearchDirection {
 
 enum AccessibilitySearchKey {
     AnyTypeSearchKey = 1,
+    ArticleSearchKey,
     BlockquoteSameLevelSearchKey,
     BlockquoteSearchKey,
     BoldFontSearchKey,
index 79dd4b7..71c2338 100644 (file)
@@ -555,6 +555,15 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     return nil;
 }
 
+- (AccessibilityObjectWrapper*)_accessibilityArticleAncestor
+{
+    if (const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [self] (const AccessibilityObject& object) {
+        return object.roleValue() == DocumentArticleRole;
+    }))
+        return parent->wrapper();
+    return nil;
+}
+
 - (AccessibilityObjectWrapper*)_accessibilityLandmarkAncestor
 {
     if (const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [self] (const AccessibilityObject& object) {
index 36ef9b8..7a531f0 100644 (file)
@@ -72,6 +72,10 @@ using namespace HTMLNames;
 #define NSAccessibilityAnyTypeSearchKey @"AXAnyTypeSearchKey"
 #endif
 
+#ifndef NSAccessibilityArticleSearchKey
+#define NSAccessibilityArticleSearchKey @"AXArticleSearchKey"
+#endif
+
 #ifndef NSAccessibilityBlockquoteSameLevelSearchKey
 #define NSAccessibilityBlockquoteSameLevelSearchKey @"AXBlockquoteSameLevelSearchKey"
 #endif
@@ -649,6 +653,7 @@ static AccessibilitySearchKeyMap* createAccessibilitySearchKeyMap()
 {
     const SearchKeyEntry searchKeys[] = {
         { NSAccessibilityAnyTypeSearchKey, AnyTypeSearchKey },
+        { NSAccessibilityArticleSearchKey, ArticleSearchKey },
         { NSAccessibilityBlockquoteSameLevelSearchKey, BlockquoteSameLevelSearchKey },
         { NSAccessibilityBlockquoteSearchKey, BlockquoteSearchKey },
         { NSAccessibilityBoldFontSearchKey, BoldFontSearchKey },