AX: Expose a new AXSubrole for explicit ARIA "group" role
authorjcraig@apple.com <jcraig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:13:21 +0000 (21:13 +0000)
committerjcraig@apple.com <jcraig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:13:21 +0000 (21:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169810
<rdar://problem/31039693>

Reviewed by Chris Fleizach.

Source/WebCore:

Split GroupRole into generics (GroupRole) and explicit groups
(ApplicationGroupRole) so we can expose a subrole on the explicit
groups. Account for the change in ARIA Tree and Menu hierachies.
Update the computedRoleValue for WebKit Inspector usage, too.

Updated existing tests.

Test: accessibility/list-detection2.html:
Test: accessibility/roles-computedRoleString.html:
Test: inspector/dom/getAccessibilityPropertiesForNode.html:
Test: inspector/dom/highlightFrame.html:
Test: inspector/dom/highlightSelector.html:

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
(WebCore::AccessibilityObject::ariaTreeItemContent):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

Source/WebKit/win:

Account for Windows platform role mapping.

* AccessibleBase.cpp:
(MSAARole):

LayoutTests:

* accessibility/list-detection2-expected.txt:
* accessibility/list-detection2.html:
* accessibility/roles-computedRoleString.html:
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
* inspector/dom/highlightFrame-expected.txt:
* inspector/dom/highlightSelector-expected.txt:
* platform/mac/accessibility/roles-computedRoleString-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/list-detection2-expected.txt
LayoutTests/accessibility/list-detection2.html
LayoutTests/accessibility/roles-computedRoleString.html
LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt
LayoutTests/inspector/dom/highlightFrame-expected.txt
LayoutTests/inspector/dom/highlightSelector-expected.txt
LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebKit/win/AccessibleBase.cpp
Source/WebKit/win/ChangeLog

index 23e8ed3..f6ce82e 100644 (file)
@@ -1,3 +1,20 @@
+2017-03-30  James Craig  <jcraig@apple.com>
+
+        AX: Expose a new AXSubrole for explicit ARIA "group" role
+        https://bugs.webkit.org/show_bug.cgi?id=169810
+        <rdar://problem/31039693>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/list-detection2-expected.txt:
+        * accessibility/list-detection2.html:
+        * accessibility/roles-computedRoleString.html:
+        * inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
+        * inspector/dom/highlightFrame-expected.txt:
+        * inspector/dom/highlightSelector-expected.txt:
+        * platform/mac/accessibility/roles-computedRoleString-expected.txt:
+        * platform/mac/accessibility/roles-exposed-expected.txt:
+
 2017-03-30  Youenn Fablet  <youenn@apple.com>
 
         webrtc/video-stats.html and webrtc/video-replace-track.html are flaky
index f5b35e3..56d7671 100644 (file)
@@ -17,9 +17,9 @@ PASS: ul w/ bullet content on ::before -> list.
 PASS: ul w/ bullet content on inline ::before -> list. 
 PASS: ol w/ counter content on ::before -> list. 
 PASS: ol w/ counter content on inline ::before -> list. 
-PASS: ul w/ background image (NOT A LIST) -> group
-PASS: ul w/ background on ::before (NOT A LIST) -> group
-PASS: ul w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST) -> group
-PASS: ol w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST) -> group
-PASS: ul w/o explicit role and no markers (NOT A LIST) -> group
+PASS: ul w/ background image (NOT A LIST) -> . 
+PASS: ul w/ background on ::before (NOT A LIST) -> . 
+PASS: ul w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST) -> . 
+PASS: ol w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST) -> . 
+PASS: ul w/o explicit role and no markers (NOT A LIST) -> . 
 
index 3b8add3..e910690 100644 (file)
 
 
     <h1>EXPLICIT FAILURE CASES: These next examples are <strong>NOT</strong> lists because these "list markers" are faked as background images. One is even a background image on a ::before pseudo-element, but that does not count as a listmarker. List markers should only be inferred by the <code>content</code> property or the <code>list-style</code> properties.</h1>
-    <ul data-role="group" class="ex nomarkers backgroundmarkers" data-note=" w/ background image (NOT A LIST)">
+    <ul data-role="" class="ex nomarkers backgroundmarkers" data-note=" w/ background image (NOT A LIST)">
         <li>foo</li>
         <li>bar</li>
         <li>baz</li>
     </ul>
-    <ul data-role="group" class="ex nomarkers backgroundmarkersbefore" data-note=" w/ background on ::before (NOT A LIST)">
+    <ul data-role="" class="ex nomarkers backgroundmarkersbefore" data-note=" w/ background on ::before (NOT A LIST)">
         <li>foo</li>
         <li>bar</li>
         <li>baz</li>
     </ul>
 
     <h1>EXPLICIT FAILURE CASES: These next examples are <strong>NOT</strong> there is no explicit role or any style or list markers to indicate this is actually intended as a list.</h1>
-    <ul data-role="group" class="ex inline" data-note=" w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST)">
+    <ul data-role="" class="ex inline" data-note=" w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST)">
         <li>foo</li>
         <li>bar</li>
         <li>baz</li>
     </ul>
-    <ol data-role="group" class="ex inline" data-note=" w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST)">
+    <ol data-role="" class="ex inline" data-note=" w/o explicit role and displayed inline, which defaults to no markers (NOT A LIST)">
         <li>foo</li>
         <li>bar</li>
         <li>baz</li>
     </ol>
-    <ul data-role="group" class="ex nomarkers" data-note=" w/o explicit role and no markers (NOT A LIST)">
+    <ul data-role="" class="ex nomarkers" data-note=" w/o explicit role and no markers (NOT A LIST)">
         <li>foo</li>
         <li>bar</li>
         <li>baz</li>
index daf14eb..d239e05 100644 (file)
 <!-- skipped <output> -->
 <p data-role="" class="ex">X</p>
 <!-- skipped <param> -->
-<pre data-role="group" class="ex">X</pre>
+<pre data-role="" class="ex">X</pre>
 <progress data-role="progressbar" class="ex" value="0.75">X</progress>
 <q data-role="" class="ex">X</q>
 <!-- skipped <ruby/rp/rt> -->
 <s data-role="" class="ex">X</s>
 <samp data-role="" class="ex">X</samp>
 <!-- skipped <script> -->
-<section data-role="group" class="ex" data-note=":not([aria-label]:not([aria-labelledby])">X</section>
+<section data-role="" class="ex" data-note=":not([aria-label]:not([aria-labelledby])">X</section>
 <section data-role="region" class="ex" aria-label="x" data-note="[aria-label]">X</section>
 <section data-role="region" class="ex" aria-labelledby="section-label" data-note="[aria-labelledby]">
     <h2 id="section-label">X</h2>
index 11e1dac..b694e60 100644 (file)
@@ -30,7 +30,7 @@ Total elements to be tested: 122.
         </ul>
     exists: true
     label: 
-    role: group
+    role: 
     childNodeIds.length: 1
     parentNodeId: exists
 
@@ -968,7 +968,7 @@ Total elements to be tested: 122.
 <script style="display:block;"></script>
     exists: true
     label: 
-    role: group
+    role: 
     ignored: true
     parentNodeId: exists
 
index ef2a007..04c411a 100644 (file)
@@ -11,10 +11,10 @@ PASS: Should not be a highlight yet.
 PASS: Should not be a highlight for the main frame.
 
 -- Running test case: HighlightChildFrame1
-Highlight Object: [{"scrollOffset":{"x":0,"y":0},"fragments":[{"quads":[[{"x":8,"y":50},{"x":312,"y":50},{"x":312,"y":204},{"x":8,"y":204}],[{"x":8,"y":50},{"x":312,"y":50},{"x":312,"y":204},{"x":8,"y":204}],[{"x":10,"y":52},{"x":310,"y":52},{"x":310,"y":202},{"x":10,"y":202}],[{"x":10,"y":52},{"x":310,"y":52},{"x":310,"y":202},{"x":10,"y":202}]],"contentColor":"rgba(0, 0, 0, 0)","contentOutlineColor":"rgba(0, 0, 0, 0)","paddingColor":"rgba(0, 0, 0, 0)","borderColor":"rgba(0, 0, 0, 0)","marginColor":"rgba(0, 0, 0, 0)"}],"elementData":{"tagName":"iframe","idValue":"frame-1","size":{"width":304,"height":154},"role":"group"}}]
+Highlight Object: [{"scrollOffset":{"x":0,"y":0},"fragments":[{"quads":[[{"x":8,"y":50},{"x":312,"y":50},{"x":312,"y":204},{"x":8,"y":204}],[{"x":8,"y":50},{"x":312,"y":50},{"x":312,"y":204},{"x":8,"y":204}],[{"x":10,"y":52},{"x":310,"y":52},{"x":310,"y":202},{"x":10,"y":202}],[{"x":10,"y":52},{"x":310,"y":52},{"x":310,"y":202},{"x":10,"y":202}]],"contentColor":"rgba(0, 0, 0, 0)","contentOutlineColor":"rgba(0, 0, 0, 0)","paddingColor":"rgba(0, 0, 0, 0)","borderColor":"rgba(0, 0, 0, 0)","marginColor":"rgba(0, 0, 0, 0)"}],"elementData":{"tagName":"iframe","idValue":"frame-1","size":{"width":304,"height":154},"role":""}}]
 
 -- Running test case: HighlightChildFrame2
-Highlight Object: [{"scrollOffset":{"x":0,"y":0},"fragments":[{"quads":[[{"x":316,"y":50},{"x":620,"y":50},{"x":620,"y":204},{"x":316,"y":204}],[{"x":316,"y":50},{"x":620,"y":50},{"x":620,"y":204},{"x":316,"y":204}],[{"x":318,"y":52},{"x":618,"y":52},{"x":618,"y":202},{"x":318,"y":202}],[{"x":318,"y":52},{"x":618,"y":52},{"x":618,"y":202},{"x":318,"y":202}]],"contentColor":"rgba(0, 0, 0, 0)","contentOutlineColor":"rgba(0, 0, 0, 0)","paddingColor":"rgba(0, 0, 0, 0)","borderColor":"rgba(0, 0, 0, 0)","marginColor":"rgba(0, 0, 0, 0)"}],"elementData":{"tagName":"iframe","idValue":"frame-2","size":{"width":304,"height":154},"role":"group"}}]
+Highlight Object: [{"scrollOffset":{"x":0,"y":0},"fragments":[{"quads":[[{"x":316,"y":50},{"x":620,"y":50},{"x":620,"y":204},{"x":316,"y":204}],[{"x":316,"y":50},{"x":620,"y":50},{"x":620,"y":204},{"x":316,"y":204}],[{"x":318,"y":52},{"x":618,"y":52},{"x":618,"y":202},{"x":318,"y":202}],[{"x":318,"y":52},{"x":618,"y":52},{"x":618,"y":202},{"x":318,"y":202}]],"contentColor":"rgba(0, 0, 0, 0)","contentOutlineColor":"rgba(0, 0, 0, 0)","paddingColor":"rgba(0, 0, 0, 0)","borderColor":"rgba(0, 0, 0, 0)","marginColor":"rgba(0, 0, 0, 0)"}],"elementData":{"tagName":"iframe","idValue":"frame-2","size":{"width":304,"height":154},"role":""}}]
 
 -- Running test case: BadFrameId
 PASS: Should produce an error.
index 00f0892..7e96716 100644 (file)
@@ -19,7 +19,7 @@ Highlighted Elements:
 PASS: Should highlight 2 element(s).
 Highlighted Elements:
 {"tagName":"div","idValue":"","classes":["class-one",".escaped"],"size":{"width":10,"height":20},"role":""}
-{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":"group"}
+{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":""}
 
 -- Running test case: MainFrameWithMultipleClassSelector
 - Frame: <main-frame>
@@ -42,14 +42,14 @@ PASS: Should highlight 3 element(s).
 Highlighted Elements:
 {"tagName":"div","idValue":"","classes":["class-one",".escaped"],"size":{"width":10,"height":20},"role":""}
 {"tagName":"div","idValue":"id-one","classes":["class-two"],"size":{"width":100,"height":200},"role":""}
-{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":"group"}
+{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":""}
 
 -- Running test case: MissingOptionalFrameIdShouldUseMainFrame
 - Frame: Not Provided
 - Selector: iframe.class-one
 PASS: Should highlight 1 element(s).
 Highlighted Elements:
-{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":"group"}
+{"tagName":"iframe","idValue":"","classes":["class-one"],"size":{"width":304,"height":154},"role":""}
 
 -- Running test case: MainFrameNonMatchingSelector
 - Frame: <main-frame>
index d581018..7bdde26 100644 (file)
@@ -49,10 +49,10 @@ PASS: nav -> navigation.
 PASS: ol -> list. 
 PASS: li -> listitem. 
 PASS: p -> . 
-PASS: pre -> group
+PASS: pre -> . 
 PASS: progress -> progressbar. 
 PASS: samp -> . 
-PASS: section:not([aria-label]:not([aria-labelledby]) -> group
+PASS: section:not([aria-label]:not([aria-labelledby]) -> . 
 PASS: section[aria-label] -> region. 
 PASS: section[aria-labelledby] -> region. 
 PASS: select:not([multiple]) -> button. 
index c14b51b..81845cc 100644 (file)
@@ -901,7 +901,7 @@ div[role=doc-backlink]
       
 div[role=doc-biblioentry]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-bibliography]
@@ -921,7 +921,7 @@ div[role=doc-chapter]
       
 div[role=doc-colophon]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-conclusion]
@@ -936,7 +936,7 @@ div[role=doc-cover]
       
 div[role=doc-credit]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-credits]
@@ -946,12 +946,12 @@ div[role=doc-credits]
       
 div[role=doc-dedication]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-endnote]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-endnotes]
@@ -961,7 +961,7 @@ div[role=doc-endnotes]
       
 div[role=doc-epigraph]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-epilogue]
@@ -976,12 +976,12 @@ div[role=doc-errata]
       
 div[role=doc-example]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-footnote]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-foreword]
@@ -1016,12 +1016,12 @@ div[role=doc-noteref]
       
 div[role=doc-notice]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-pagebreak]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-pagelist]
@@ -1046,12 +1046,12 @@ div[role=doc-prologue]
       
 div[role=doc-pullquote]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-qna]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-subtitle]
@@ -1061,7 +1061,7 @@ div[role=doc-subtitle]
       
 div[role=doc-tip]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=doc-toc]
@@ -1111,7 +1111,7 @@ div[role=gridcell]
       
 div[role=group]
       AXRole: AXGroup
-      AXSubrole: 
+      AXSubrole: AXApplicationGroup
       AXRoleDescription: group
       
 div[role=heading]
index 6bca76f..32e304a 100644 (file)
@@ -1,3 +1,42 @@
+2017-03-30  James Craig  <jcraig@apple.com>
+
+        AX: Expose a new AXSubrole for explicit ARIA "group" role
+        https://bugs.webkit.org/show_bug.cgi?id=169810
+        <rdar://problem/31039693>
+
+        Reviewed by Chris Fleizach.
+
+        Split GroupRole into generics (GroupRole) and explicit groups 
+        (ApplicationGroupRole) so we can expose a subrole on the explicit 
+        groups. Account for the change in ARIA Tree and Menu hierachies. 
+        Update the computedRoleValue for WebKit Inspector usage, too.
+
+        Updated existing tests.
+
+        Test: accessibility/list-detection2.html:
+        Test: accessibility/roles-computedRoleString.html:
+        Test: inspector/dom/getAccessibilityPropertiesForNode.html:
+        Test: inspector/dom/highlightFrame.html:
+        Test: inspector/dom/highlightSelector.html:
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::helpText):
+        (WebCore::AccessibilityNodeObject::hierarchicalLevel):
+        (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
+        (WebCore::AccessibilityObject::ariaTreeItemContent):
+        (WebCore::initializeRoleMap):
+        (WebCore::AccessibilityObject::computedRoleString):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (atkRole):
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (createAccessibilityRoleMap):
+        (-[WebAccessibilityObjectWrapper subrole]):
+
 2017-03-30  Chris Dumez  <cdumez@apple.com>
 
         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
index 7d08a65..a0db268 100644 (file)
@@ -1606,7 +1606,7 @@ String AccessibilityNodeObject::helpText() const
         AccessibilityObject* axObj = axObjectCache()->getOrCreate(ancestor);
         if (axObj) {
             AccessibilityRole role = axObj->roleValue();
-            if (role != GroupRole && role != UnknownRole)
+            if (role != ApplicationGroupRole && role != GroupRole && role != UnknownRole)
                 break;
         }
     }
@@ -1633,7 +1633,7 @@ unsigned AccessibilityNodeObject::hierarchicalLevel() const
     unsigned level = 1;
     for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
         AccessibilityRole parentRole = parent->ariaRoleAttribute();
-        if (parentRole == GroupRole)
+        if (parentRole == ApplicationGroupRole)
             level++;
         else if (parentRole == TreeRole)
             break;
@@ -2150,7 +2150,7 @@ AccessibilityRole AccessibilityNodeObject::remapAriaRoleDueToParent(Accessibilit
         if (role == ListBoxOptionRole && parentAriaRole == MenuRole)
             return MenuItemRole;
         // An aria "menuitem" may map to MenuButton or MenuItem depending on its parent.
-        if (role == MenuItemRole && parentAriaRole == GroupRole)
+        if (role == MenuItemRole && parentAriaRole == ApplicationGroupRole)
             return MenuButtonRole;
         
         // If the parent had a different role, then we don't need to continue searching up the chain.
index c6f94a9..86e3792 100644 (file)
@@ -300,6 +300,7 @@ bool AccessibilityObject::accessibleNameDerivesFromContent() const
     case ApplicationAlertRole:
     case ApplicationAlertDialogRole:
     case ApplicationDialogRole:
+    case ApplicationGroupRole:
     case ApplicationLogRole:
     case ApplicationMarqueeRole:
     case ApplicationStatusRole:
@@ -1829,7 +1830,7 @@ void AccessibilityObject::ariaTreeItemContent(AccessibilityChildrenVector& resul
     // The ARIA tree item content are the item that are not other tree items or their containing groups.
     for (const auto& child : children()) {
         AccessibilityRole role = child->roleValue();
-        if (role == TreeItemRole || role == GroupRole)
+        if (role == TreeItemRole || role == GroupRole || role == ApplicationGroupRole)
             continue;
         
         result.append(child);
@@ -2110,39 +2111,39 @@ static void initializeRoleMap()
         { "doc-afterword", LandmarkRegionRole },
         { "doc-appendix", LandmarkRegionRole },
         { "doc-backlink", WebCoreLinkRole },
-        { "doc-biblioentry", GroupRole },
+        { "doc-biblioentry", ApplicationGroupRole },
         { "doc-bibliography", LandmarkRegionRole },
         { "doc-biblioref", WebCoreLinkRole },
         { "doc-chapter", LandmarkRegionRole },
-        { "doc-colophon", GroupRole },
+        { "doc-colophon", ApplicationGroupRole },
         { "doc-conclusion", LandmarkRegionRole },
         { "doc-cover", ImageRole },
-        { "doc-credit", GroupRole },
+        { "doc-credit", ApplicationGroupRole },
         { "doc-credits", LandmarkRegionRole },
-        { "doc-dedication", GroupRole },
-        { "doc-endnote", GroupRole },
+        { "doc-dedication", ApplicationGroupRole },
+        { "doc-endnote", ApplicationGroupRole },
         { "doc-endnotes", LandmarkRegionRole },
-        { "doc-epigraph", GroupRole },
+        { "doc-epigraph", ApplicationGroupRole },
         { "doc-epilogue", LandmarkRegionRole },
         { "doc-errata", LandmarkRegionRole },
-        { "doc-example", GroupRole },
-        { "doc-footnote", GroupRole },
+        { "doc-example", ApplicationGroupRole },
+        { "doc-footnote", ApplicationGroupRole },
         { "doc-foreword", LandmarkRegionRole },
         { "doc-glossary", LandmarkRegionRole },
         { "doc-glossref", WebCoreLinkRole },
         { "doc-index", LandmarkNavigationRole },
         { "doc-introduction", LandmarkRegionRole },
         { "doc-noteref", WebCoreLinkRole },
-        { "doc-notice", GroupRole },
-        { "doc-pagebreak", GroupRole },
+        { "doc-notice", ApplicationGroupRole },
+        { "doc-pagebreak", ApplicationGroupRole },
         { "doc-pagelist", LandmarkNavigationRole },
         { "doc-part", LandmarkRegionRole },
         { "doc-preface", LandmarkRegionRole },
         { "doc-prologue", LandmarkRegionRole },
-        { "doc-pullquote", GroupRole },
-        { "doc-qna", GroupRole },
+        { "doc-pullquote", ApplicationGroupRole },
+        { "doc-qna", ApplicationGroupRole },
         { "doc-subtitle", HeadingRole },
-        { "doc-tip", GroupRole },
+        { "doc-tip", ApplicationGroupRole },
         { "doc-toc", LandmarkNavigationRole },
         { "grid", GridRole },
         { "gridcell", GridCellRole },
@@ -2154,7 +2155,7 @@ static void initializeRoleMap()
         { "document", DocumentRole },
         { "form", FormRole },
         { "rowheader", RowHeaderRole },
-        { "group", GroupRole },
+        { "group", ApplicationGroupRole },
         { "heading", HeadingRole },
         { "img", ImageRole },
         { "link", WebCoreLinkRole },
@@ -2244,6 +2245,8 @@ String AccessibilityObject::computedRoleString() const
 {
     // FIXME: Need a few special cases that aren't in the RoleMap: option, etc. http://webkit.org/b/128296
     AccessibilityRole role = roleValue();
+    if (role == GroupRole)
+        return ""; // Special-casing an empty value because generic block elements (GroupRole) are not the same as role="group" (ApplicationGroupRole).
     if (role == HorizontalRuleRole)
         role = SplitterRole;
     if (role == PopUpButtonRole || role == ToggleButtonRole)
index 63ea8c6..1c73331 100644 (file)
@@ -95,6 +95,7 @@ enum AccessibilityRole {
     ApplicationAlertRole,
     ApplicationAlertDialogRole,
     ApplicationDialogRole,
+    ApplicationGroupRole,
     ApplicationLogRole,
     ApplicationMarqueeRole,
     ApplicationStatusRole,
index a3f2a2b..a354041 100644 (file)
@@ -548,6 +548,7 @@ static AtkRole atkRole(AccessibilityObject* coreObject)
     case SVGRootRole:
     case TabPanelRole:
         return ATK_ROLE_PANEL;
+    case ApplicationGroupRole:
     case GroupRole:
         return coreObject->isStyleFormatGroup() ? ATK_ROLE_SECTION : ATK_ROLE_PANEL;
     case RowHeaderRole:
index 3ab45d6..79dd4b7 100644 (file)
@@ -833,6 +833,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
         case ApplicationAlertRole:
         case ApplicationAlertDialogRole:
         case ApplicationDialogRole:
+        case ApplicationGroupRole:
         case ApplicationLogRole:
         case ApplicationMarqueeRole:
         case ApplicationStatusRole:
index 7646bd3..c43d8f3 100644 (file)
@@ -1866,6 +1866,7 @@ static const AccessibilityRoleMap& createAccessibilityRoleMap()
         { ApplicationAlertRole, NSAccessibilityGroupRole },
         { ApplicationAlertDialogRole, NSAccessibilityGroupRole },
         { ApplicationDialogRole, NSAccessibilityGroupRole },
+        { ApplicationGroupRole, NSAccessibilityGroupRole },
         { ApplicationLogRole, NSAccessibilityGroupRole },
         { ApplicationMarqueeRole, NSAccessibilityGroupRole },
         { ApplicationStatusRole, NSAccessibilityGroupRole },
@@ -2023,6 +2024,8 @@ static NSString* roleValueToNSString(AccessibilityRole value)
             return @"AXApplicationAlertDialog";
         case ApplicationDialogRole:
             return @"AXApplicationDialog";
+        case ApplicationGroupRole:
+            return @"AXApplicationGroup";
         case ApplicationLogRole:
             return @"AXApplicationLog";
         case ApplicationMarqueeRole:
index c103b02..c53e84e 100644 (file)
@@ -887,6 +887,7 @@ static long MSAARole(AccessibilityRole role)
             return ROLE_SYSTEM_COLUMN;
         case WebCore::RowRole:
             return ROLE_SYSTEM_ROW;
+        case WebCore::ApplicationGroupRole:
         case WebCore::GroupRole:
         case WebCore::RadioGroupRole:
             return ROLE_SYSTEM_GROUPING;
index 717abf5..4159d91 100644 (file)
@@ -1,3 +1,16 @@
+2017-03-30  James Craig  <jcraig@apple.com>
+
+        AX: Expose a new AXSubrole for explicit ARIA "group" role
+        https://bugs.webkit.org/show_bug.cgi?id=169810
+        <rdar://problem/31039693>
+
+        Reviewed by Chris Fleizach.
+
+        Account for Windows platform role mapping.
+
+        * AccessibleBase.cpp:
+        (MSAARole):
+
 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop