AX: Implement support for new ARIA roles: code, strong, emphasis, generic
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Oct 2019 02:34:00 +0000 (02:34 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Oct 2019 02:34:00 +0000 (02:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203257

Reviewed by Chris Fleizach.

Source/WebCore:

Create new internal AccessibilityRole types for the new roles.
Treat code, strong, and emphasis as internal format style groups,
which are equivalent to their corresponding HTML elements.

No new tests. Instead, added new roles to existing tests and updated
expectations.

* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::isStyleFormatGroup const):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/WebKitAccessible.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

LayoutTests:

Add new roles to existing role-related tests and update expectations.

* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-computedRoleString.html:
* accessibility/roles-exposed.html:
* platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt:
* platform/gtk/accessibility/roles-computedRoleString-expected.txt:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/mac-wk2/accessibility/roles-exposed-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@251469 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt
LayoutTests/accessibility/gtk/xml-roles-exposed.html
LayoutTests/accessibility/roles-computedRoleString.html
LayoutTests/accessibility/roles-exposed.html
LayoutTests/platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt
LayoutTests/platform/gtk/accessibility/roles-computedRoleString-expected.txt
LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac-wk2/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/atk/WebKitAccessible.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

index fccd69d..bb87cad 100644 (file)
@@ -1,3 +1,23 @@
+2019-10-22  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        AX: Implement support for new ARIA roles: code, strong, emphasis, generic
+        https://bugs.webkit.org/show_bug.cgi?id=203257
+
+        Reviewed by Chris Fleizach.
+
+        Add new roles to existing role-related tests and update expectations.
+
+        * accessibility/gtk/xml-roles-exposed-expected.txt:
+        * accessibility/gtk/xml-roles-exposed.html:
+        * accessibility/roles-computedRoleString.html:
+        * accessibility/roles-exposed.html:
+        * platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt:
+        * platform/gtk/accessibility/roles-computedRoleString-expected.txt:
+        * platform/gtk/accessibility/roles-exposed-expected.txt:
+        * platform/mac-wk2/accessibility/roles-exposed-expected.txt:
+        * platform/mac/accessibility/roles-computedRoleString-expected.txt:
+        * platform/mac/accessibility/roles-exposed-expected.txt:
+
 2019-10-22  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics (experimental): Block all third-party cookies
index 6df3e97..a533e2d 100644 (file)
@@ -174,6 +174,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:code, xml-roles:code, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXComboBox
 AXParent: AXWebArea
 AXChildren: 0
@@ -326,6 +345,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:document, xml-roles:document, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:emphasis, xml-roles:emphasis, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXGroup
 AXParent: AXWebArea
 AXChildren: 0
@@ -383,6 +421,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:form, xml-roles:form, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXSection
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:generic, xml-roles:generic, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXGroup
 AXParent: AXWebArea
 AXChildren: 0
@@ -840,6 +897,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: atomic:true, relevant:additions text, live:polite, container-live-role:status, container-atomic:true, container-relevant:additions text, container-live:polite, computed-role:status, xml-roles:status, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:strong, xml-roles:strong, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXSubscript
 AXParent: AXWebArea
 AXChildren: 0
index d6b9f6b..6760e52 100644 (file)
@@ -14,6 +14,7 @@
  <div role="button"></div>
  <div role="caption"></div>
  <div role="checkbox"></div>
+ <div role="code"></div>
  <div role="combobox"></div>
  <div role="complementary"></div>
  <div role="contentinfo"></div>
  <div role="dialog"></div>
  <div role="directory"></div>
  <div role="document"></div>
+ <div role="emphasis"></div>
  <div role="feed"></div>
  <div role="figure"></div>
  <div role="form"></div>
+ <div role="generic"></div>
  <div role="group"></div>
  <div role="heading"></div>
  <div role="img"></div>
@@ -50,6 +53,7 @@
  <div role="slider"></div>
  <div role="spinbutton"></div>
  <div role="status"></div>
+ <div role="strong"></div>
  <div role="subscript"></div>
  <div role="superscript"></div>
  <div role="switch"></div>
index 92a6082..044d2da 100644 (file)
 <article data-role="article" data-platform="atk,mac" class="ex">X</article>
 <aside data-role="complementary" data-platform="atk,mac" class="ex">X</aside>
 <button data-role="button" data-platform="atk,mac" class="ex">X</button>
-<del data-role="deletion" data-platform="atk,mac" class="ex">X</ins>
+<code data-role="code" data-platform="atk,mac" class="ex">X</code>
+<del data-role="deletion" data-platform="atk,mac" class="ex">X</del>
 <dfn data-role="definition" data-platform="atk,mac" class="ex">X</dfn>
 <dl data-role="" data-platform="atk,mac" class="ex">
     <dt>X</dt>
     <dd>X</dd>
 </dl>
+<em data-role="emphasis" data-platform="atk,mac" class="ex">X</em>
 <footer data-role="contentinfo" data-platform="atk,mac" class="ex">X</footer>
 <form data-role="form" data-platform="atk,mac" class="ex">X</form>
 <header data-role="banner" data-platform="atk,mac" class="ex">X</header>
 </select>
 <small data-role="" data-platform="atk,mac" class="ex">X</small>
 <span data-role="" data-platform="atk,mac" class="ex">X</span>
-<strong data-role="" data-platform="atk,mac" class="ex">X</strong>
+<strong data-role="strong" data-platform="atk,mac" class="ex">X</strong>
 <sub data-role="subscript" data-platform="atk,mac" class="ex">X</sub>
 <sup data-role="superscript" data-platform="atk,mac" class="ex">X</sup>
 <svg data-role="" data-platform="atk,mac" class="ex">X</svg>
 <div role="document"                 data-role="document" data-platform="atk,mac" class="ex">X</div>
 <div role="figure"                   data-role="figure" data-platform="atk,mac" class="ex">X</div>
 <div role="form"                     data-role="form" data-platform="atk,mac" class="ex">X</div>
+<div role="generic"                  data-role="generic" data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-document"        data-role="document" data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-object"          data-role="group" data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-symbol"          data-role="img" data-platform="atk,mac" class="ex">X</div>
index 894e176..048eb85 100644 (file)
 <div role="button"                   data-platform="atk,mac" class="ex">X</div>
 <div role="caption"                  data-platform="atk,mac" class="ex">X</div>
 <div role="checkbox"                 data-platform="atk,mac" class="ex">X</div>
+<div role="code"                     data-platform="atk,mac" class="ex">X</div>
 <div role="combobox"                 data-platform="atk,mac" class="ex">X</div>
 <div role="complementary"            data-platform="atk,mac" class="ex">X</div>
 <div role="contentinfo"              data-platform="atk,mac" class="ex">X</div>
 <div role="doc-tip"                  data-platform="atk,mac" class="ex">X</div>
 <div role="doc-toc"                  data-platform="atk,mac" class="ex">X</div>
 <div role="document"                 data-platform="atk,mac" class="ex">X</div>
+<div role="emphasis"                 data-platform="atk,mac" class="ex">X</div>
 <div role="figure"                   data-platform="atk,mac" class="ex">X</div>
 <div role="form"                     data-platform="atk,mac" class="ex">X</div>
+<div role="generic"                  data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-document"        data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-object"          data-platform="atk,mac" class="ex">X</div>
 <div role="graphics-symbol"          data-platform="atk,mac" class="ex">X</div>
 <div role="slider"                   data-platform="atk,mac" class="ex">X</div>
 <div role="spinbutton"               data-platform="atk,mac" class="ex">X</div>
 <div role="status"                   data-platform="atk,mac" class="ex">X</div>
+<div role="strong"                   data-platform="atk,mac" class="ex">X</div>
 <div role="subscript"                data-platform="atk,mac" class="ex">X</div>
 <div role="superscript"              data-platform="atk,mac" class="ex">X</div>
 <div role="switch"                   data-platform="atk,mac" class="ex">X</div>
index 431581f..3dc85f1 100644 (file)
@@ -174,6 +174,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:code, xml-roles:code, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXComboBox
 AXParent: AXWebArea
 AXChildren: 0
@@ -326,6 +345,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:document, xml-roles:document, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:emphasis, xml-roles:emphasis, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXGroup
 AXParent: AXWebArea
 AXChildren: 0
@@ -383,6 +421,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: computed-role:form, xml-roles:form, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXSection
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:generic, xml-roles:generic, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXGroup
 AXParent: AXWebArea
 AXChildren: 0
@@ -840,6 +897,25 @@ AXRequired: 0
 AXChecked: 0
 AXPlatformAttributes: atomic:true, relevant:additions text, live:polite, container-live-role:status, container-atomic:true, container-relevant:additions text, container-live:polite, computed-role:status, xml-roles:status, tag:div, toolkit:WebKitGtk
 ------------
+AXRole: AXStatic
+AXParent: AXWebArea
+AXChildren: 0
+AXPosition:  { 0.00000, 0.00000 }
+AXSize: { 0.00000, 0.00000 }
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: computed-role:strong, xml-roles:strong, tag:div, toolkit:WebKitGtk
+------------
 AXRole: AXSubscript
 AXParent: AXWebArea
 AXChildren: 0
index 4c53eca..9ce0038 100644 (file)
@@ -7,9 +7,11 @@ PASS: a[href] -> link.
 PASS: article -> article. 
 PASS: aside -> complementary. 
 PASS: button -> button. 
+PASS: code -> code. 
 PASS: del -> deletion. 
 PASS: dfn -> definition. 
 PASS: dl -> . 
+PASS: em -> emphasis. 
 PASS: footer -> contentinfo. 
 PASS: form -> form. 
 PASS: header -> banner. 
@@ -62,6 +64,7 @@ PASS: option -> option.
 PASS: optgroup -> option. 
 PASS: option -> option. 
 PASS: option -> option. 
+PASS: strong -> strong. 
 PASS: sub -> subscript. 
 PASS: sup -> superscript. 
 PASS: table -> table. 
@@ -115,6 +118,7 @@ PASS: div[role="directory"] -> list.
 PASS: div[role="document"] -> document. 
 PASS: div[role="figure"] -> figure. 
 PASS: div[role="form"] -> form. 
+PASS: div[role="generic"] -> generic. 
 PASS: div[role="graphics-document"] -> document. 
 PASS: div[role="graphics-object"] -> group. 
 PASS: div[role="graphics-symbol"] -> img. 
index 15fb7c1..b673d15 100644 (file)
@@ -71,7 +71,7 @@ div
       AXRole: AXSection
       
 em
-      AXRole: 
+      AXRole: AXStatic
       
 fieldset
       AXRole: AXGroup
@@ -386,7 +386,7 @@ span[onclick]
       AXRole: AXStatic
       
 strong
-      AXRole: 
+      AXRole: AXStatic
       
 sub
       AXRole: AXSubscript
@@ -514,6 +514,9 @@ div[role=caption]
 div[role=checkbox]
       AXRole: AXCheckBox
       
+div[role=code]
+      AXRole: AXStatic
+      
 div[role=combobox]
       AXRole: AXComboBox
       
@@ -655,12 +658,18 @@ div[role=doc-toc]
 div[role=document]
       AXRole: AXDocument
       
+div[role=emphasis]
+      AXRole: AXStatic
+      
 div[role=figure]
       AXRole: AXGroup
       
 div[role=form]
       AXRole: AXLandmarkForm
       
+div[role=generic]
+      AXRole: AXSection
+      
 div[role=graphics-document]
       AXRole: AXDocument
       
@@ -808,6 +817,9 @@ div[role=spinbutton]
 div[role=status]
       AXRole: AXStatusBar
       
+div[role=strong]
+      AXRole: AXStatic
+      
 div[role=subscript]
       AXRole: AXSubscript
       
index b9e326e..b24be76 100644 (file)
@@ -115,9 +115,9 @@ div
       AXRoleDescription: group
       
 em
-      AXRole: 
-      AXSubrole: 
-      AXRoleDescription: 
+      AXRole: AXGroup
+      AXSubrole: AXEmphasisStyleGroup
+      AXRoleDescription: group
       
 fieldset
       AXRole: AXGroup
@@ -645,9 +645,9 @@ span[onclick]
       AXRoleDescription: 
       
 strong
-      AXRole: 
-      AXSubrole: 
-      AXRoleDescription: 
+      AXRole: AXGroup
+      AXSubrole: AXStrongStyleGroup
+      AXRoleDescription: group
       
 sub
       AXRole: AXGroup
@@ -859,6 +859,11 @@ div[role=checkbox]
       AXSubrole: 
       AXRoleDescription: checkbox
       
+div[role=code]
+      AXRole: AXGroup
+      AXSubrole: AXCodeStyleGroup
+      AXRoleDescription: group
+      
 div[role=combobox]
       AXRole: AXComboBox
       AXSubrole: 
@@ -1094,6 +1099,11 @@ div[role=document]
       AXSubrole: AXDocument
       AXRoleDescription: document
       
+div[role=emphasis]
+      AXRole: AXGroup
+      AXSubrole: AXEmphasisStyleGroup
+      AXRoleDescription: group
+      
 div[role=figure]
       AXRole: AXGroup
       AXSubrole: 
@@ -1104,6 +1114,11 @@ div[role=form]
       AXSubrole: 
       AXRoleDescription: group
       
+div[role=generic]
+      AXRole: AXGroup
+      AXSubrole: 
+      AXRoleDescription: group
+      
 div[role=graphics-document]
       AXRole: AXGroup
       AXSubrole: AXDocument
@@ -1349,6 +1364,11 @@ div[role=status]
       AXSubrole: AXApplicationStatus
       AXRoleDescription: application status
       
+div[role=strong]
+      AXRole: AXGroup
+      AXSubrole: AXStrongStyleGroup
+      AXRoleDescription: group
+      
 div[role=subscript]
       AXRole: AXGroup
       AXSubrole: AXSubscriptStyleGroup
index ccf4230..37ba8a3 100644 (file)
@@ -7,9 +7,11 @@ PASS: a[href] -> link.
 PASS: article -> article. 
 PASS: aside -> complementary. 
 PASS: button -> button. 
+PASS: code -> code. 
 PASS: del -> deletion. 
 PASS: dfn -> definition. 
 PASS: dl -> . 
+PASS: em -> emphasis. 
 PASS: footer -> contentinfo. 
 PASS: form -> form. 
 PASS: header -> banner. 
@@ -62,6 +64,7 @@ PASS: option -> option.
 PASS: optgroup -> option. 
 PASS: option -> option. 
 PASS: option -> option. 
+PASS: strong -> strong. 
 PASS: sub -> subscript. 
 PASS: sup -> superscript. 
 PASS: table -> table. 
@@ -114,6 +117,7 @@ PASS: div[role="directory"] -> list.
 PASS: div[role="document"] -> document. 
 PASS: div[role="figure"] -> figure. 
 PASS: div[role="form"] -> form. 
+PASS: div[role="generic"] -> generic. 
 PASS: div[role="graphics-document"] -> document. 
 PASS: div[role="graphics-object"] -> group. 
 PASS: div[role="graphics-symbol"] -> img. 
index 25e8b3b..7d76d3a 100644 (file)
@@ -115,9 +115,9 @@ div
       AXRoleDescription: group
       
 em
-      AXRole: 
-      AXSubrole: 
-      AXRoleDescription: 
+      AXRole: AXGroup
+      AXSubrole: AXEmphasisStyleGroup
+      AXRoleDescription: group
       
 fieldset
       AXRole: AXGroup
@@ -645,9 +645,9 @@ span[onclick]
       AXRoleDescription: 
       
 strong
-      AXRole: 
-      AXSubrole: 
-      AXRoleDescription: 
+      AXRole: AXGroup
+      AXSubrole: AXStrongStyleGroup
+      AXRoleDescription: group
       
 sub
       AXRole: AXGroup
@@ -859,6 +859,11 @@ div[role=checkbox]
       AXSubrole: 
       AXRoleDescription: checkbox
       
+div[role=code]
+      AXRole: AXGroup
+      AXSubrole: AXCodeStyleGroup
+      AXRoleDescription: group
+      
 div[role=combobox]
       AXRole: AXComboBox
       AXSubrole: 
@@ -1094,6 +1099,11 @@ div[role=document]
       AXSubrole: AXDocument
       AXRoleDescription: document
       
+div[role=emphasis]
+      AXRole: AXGroup
+      AXSubrole: AXEmphasisStyleGroup
+      AXRoleDescription: group
+      
 div[role=figure]
       AXRole: AXGroup
       AXSubrole: 
@@ -1104,6 +1114,11 @@ div[role=form]
       AXSubrole: 
       AXRoleDescription: group
       
+div[role=generic]
+      AXRole: AXGroup
+      AXSubrole: 
+      AXRoleDescription: group
+      
 div[role=graphics-document]
       AXRole: AXGroup
       AXSubrole: AXDocument
@@ -1349,6 +1364,11 @@ div[role=status]
       AXSubrole: AXApplicationStatus
       AXRoleDescription: application status
       
+div[role=strong]
+      AXRole: AXGroup
+      AXSubrole: AXStrongStyleGroup
+      AXRoleDescription: group
+      
 div[role=subscript]
       AXRole: AXGroup
       AXSubrole: AXSubscriptStyleGroup
index 7851e18..56a15a4 100644 (file)
@@ -1,3 +1,31 @@
+2019-10-22  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        AX: Implement support for new ARIA roles: code, strong, emphasis, generic
+        https://bugs.webkit.org/show_bug.cgi?id=203257
+
+        Reviewed by Chris Fleizach.
+
+        Create new internal AccessibilityRole types for the new roles.
+        Treat code, strong, and emphasis as internal format style groups,
+        which are equivalent to their corresponding HTML elements.
+
+        No new tests. Instead, added new roles to existing tests and updated
+        expectations.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::initializeRoleMap):
+        (WebCore::AccessibilityObject::isStyleFormatGroup const):
+        * accessibility/AccessibilityObjectInterface.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/atk/WebKitAccessible.cpp:
+        (atkRole):
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (createAccessibilityRoleMap):
+        (-[WebAccessibilityObjectWrapper subrole]):
+
 2019-10-22  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics (experimental): Block all third-party cookies
index e8aa69b..9bcb561 100644 (file)
@@ -2414,6 +2414,7 @@ static void initializeRoleMap()
         { "button", AccessibilityRole::Button },
         { "caption", AccessibilityRole::Caption },
         { "checkbox", AccessibilityRole::CheckBox },
+        { "code", AccessibilityRole::Code },
         { "complementary", AccessibilityRole::LandmarkComplementary },
         { "contentinfo", AccessibilityRole::LandmarkContentInfo },
         { "deletion", AccessibilityRole::Deletion },
@@ -2473,9 +2474,11 @@ static void initializeRoleMap()
         { "combobox", AccessibilityRole::ComboBox },
         { "definition", AccessibilityRole::Definition },
         { "document", AccessibilityRole::Document },
+        { "emphasis", AccessibilityRole::Emphasis },
         { "feed", AccessibilityRole::Feed },
         { "form", AccessibilityRole::Form },
         { "rowheader", AccessibilityRole::RowHeader },
+        { "generic", AccessibilityRole::Generic },
         { "group", AccessibilityRole::ApplicationGroup },
         { "heading", AccessibilityRole::Heading },
         { "img", AccessibilityRole::Image },
@@ -2513,6 +2516,7 @@ static void initializeRoleMap()
         { "slider", AccessibilityRole::Slider },
         { "spinbutton", AccessibilityRole::SpinButton },
         { "status", AccessibilityRole::ApplicationStatus },
+        { "strong", AccessibilityRole::Strong },
         { "subscript", AccessibilityRole::Subscript },
         { "superscript", AccessibilityRole::Superscript },
         { "switch", AccessibilityRole::Switch },
@@ -3585,7 +3589,8 @@ bool AccessibilityObject::isStyleFormatGroup() const
     || node->hasTagName(preTag) || node->hasTagName(sampTag)
     || node->hasTagName(varTag) || node->hasTagName(citeTag)
     || node->hasTagName(insTag) || node->hasTagName(delTag)
-    || node->hasTagName(supTag) || node->hasTagName(subTag);
+    || node->hasTagName(supTag) || node->hasTagName(subTag)
+    || node->hasTagName(emTag) || node->hasTagName(strongTag);
 }
 
 bool AccessibilityObject::isFigureElement() const
index 98ffb31..07c3f90 100644 (file)
@@ -70,6 +70,7 @@ enum class AccessibilityRole {
     Caption,
     Cell,
     CheckBox,
+    Code,
     ColorWell,
     Column,
     ColumnHeader,
@@ -89,11 +90,13 @@ enum class AccessibilityRole {
     DocumentNote,
     Drawer,
     EditableText,
+    Emphasis,
     Feed,
     Figure,
     Footer,
     Footnote,
     Form,
+    Generic,
     GraphicsDocument,
     GraphicsObject,
     GraphicsSymbol,
@@ -168,6 +171,7 @@ enum class AccessibilityRole {
     SplitGroup,
     Splitter,
     StaticText,
+    Strong,
     Subscript,
     Summary,
     Superscript,
index 5334dc7..b70ed1e 100644 (file)
@@ -2816,10 +2816,16 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
         return AccessibilityRole::SVGRoot;
     
     if (isStyleFormatGroup()) {
+        if (node->hasTagName(codeTag))
+            return AccessibilityRole::Code;
         if (node->hasTagName(delTag))
             return AccessibilityRole::Deletion;
+        if (node->hasTagName(emTag))
+            return AccessibilityRole::Emphasis;
         if (node->hasTagName(insTag))
             return AccessibilityRole::Insertion;
+        if (node->hasTagName(strongTag))
+            return AccessibilityRole::Strong;
         if (node->hasTagName(subTag))
             return AccessibilityRole::Subscript;
         if (node->hasTagName(supTag))
index 12ae435..bf41508 100644 (file)
@@ -728,6 +728,7 @@ static AtkRole atkRole(AccessibilityObject* coreObject)
 #endif
     case AccessibilityRole::ApplicationTextGroup:
     case AccessibilityRole::Div:
+    case AccessibilityRole::Generic:
     case AccessibilityRole::Pre:
     case AccessibilityRole::SVGText:
     case AccessibilityRole::TextGroup:
@@ -818,7 +819,10 @@ static AtkRole atkRole(AccessibilityObject* coreObject)
         return ATK_ROLE_SUBSCRIPT;
     case AccessibilityRole::Superscript:
         return ATK_ROLE_SUPERSCRIPT;
+    case AccessibilityRole::Code:
+    case AccessibilityRole::Emphasis:
     case AccessibilityRole::Inline:
+    case AccessibilityRole::Strong:
     case AccessibilityRole::SVGTextPath:
     case AccessibilityRole::SVGTSpan:
     case AccessibilityRole::Time:
index bccf37e..a4da9b8 100644 (file)
@@ -945,6 +945,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     case AccessibilityRole::Canvas:
     case AccessibilityRole::Caption:
     case AccessibilityRole::Cell:
+    case AccessibilityRole::Code:
     case AccessibilityRole::Column:
     case AccessibilityRole::ColumnHeader:
     case AccessibilityRole::Definition:
@@ -960,11 +961,13 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     case AccessibilityRole::DocumentNote:
     case AccessibilityRole::Drawer:
     case AccessibilityRole::EditableText:
+    case AccessibilityRole::Emphasis:
     case AccessibilityRole::Feed:
     case AccessibilityRole::Figure:
     case AccessibilityRole::Footer:
     case AccessibilityRole::Footnote:
     case AccessibilityRole::Form:
+    case AccessibilityRole::Generic:
     case AccessibilityRole::GraphicsDocument:
     case AccessibilityRole::GraphicsObject:
     case AccessibilityRole::GraphicsSymbol:
@@ -1015,6 +1018,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     case AccessibilityRole::SpinButtonPart:
     case AccessibilityRole::SplitGroup:
     case AccessibilityRole::Splitter:
+    case AccessibilityRole::Strong:
     case AccessibilityRole::Subscript:
     case AccessibilityRole::Superscript:
     case AccessibilityRole::Summary:
index 0150fca..93c57eb 100644 (file)
@@ -2199,6 +2199,10 @@ static AccessibilityRoleMap createAccessibilityRoleMap()
         { AccessibilityRole::Insertion, NSAccessibilityGroupRole },
         { AccessibilityRole::Subscript, NSAccessibilityGroupRole },
         { AccessibilityRole::Superscript, NSAccessibilityGroupRole },
+        { AccessibilityRole::Code, NSAccessibilityGroupRole },
+        { AccessibilityRole::Emphasis, NSAccessibilityGroupRole },
+        { AccessibilityRole::Strong, NSAccessibilityGroupRole },
+        { AccessibilityRole::Generic, NSAccessibilityGroupRole },
     };
     AccessibilityRoleMap roleMap;
     for (auto& role : roles)
@@ -2412,13 +2416,17 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         return @"AXSuperscriptStyleGroup";
     if (role == AccessibilityRole::Subscript)
         return @"AXSubscriptStyleGroup";
+    if (role == AccessibilityRole::Code)
+        return @"AXCodeStyleGroup";
+    if (role == AccessibilityRole::Emphasis)
+        return @"AXEmphasisStyleGroup";
+    if (role == AccessibilityRole::Strong)
+        return @"AXStrongStyleGroup";
 
     if (m_object->isStyleFormatGroup()) {
         if (Node* node = m_object->node()) {
             if (node->hasTagName(kbdTag))
                 return @"AXKeyboardInputStyleGroup";
-            if (node->hasTagName(codeTag))
-                return @"AXCodeStyleGroup";
             if (node->hasTagName(preTag))
                 return @"AXPreformattedStyleGroup";
             if (node->hasTagName(sampTag))