Diff
Modified: trunk/LayoutTests/ChangeLog (279828 => 279829)
--- trunk/LayoutTests/ChangeLog 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/ChangeLog 2021-07-12 16:14:28 UTC (rev 279829)
@@ -1,3 +1,28 @@
+2021-07-12 Tyler Wilcock <[email protected]>
+
+ AX: Add ARIA role "image" as a new role, and leave "img" as a synonym
+ https://bugs.webkit.org/show_bug.cgi?id=224615
+
+ Reviewed by Chris Fleizach.
+
+ The "image" role is replacing the "img" role (though "img" is not
+ going away), so "image" should be returned from `computedRoleString`.
+
+ * accessibility/image-role-is-synonomous-with-img-role-expected.txt: Added.
+ * accessibility/image-role-is-synonomous-with-img-role.html: Added.
+
+ * accessibility/roles-computedRoleString-expected.txt:
+ * accessibility/roles-computedRoleString.html:
+ * inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
+ * platform/glib/accessibility/roles-computedRoleString-expected.txt:
+ * platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt:
+ * platform/gtk/accessibility/image-link-expected.txt:
+ * platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
+ * platform/mac/accessibility/roles-computedRoleString-expected.txt:
+ * platform/wpe/accessibility/image-link-expected.txt:
+ All the tests in this group have been updated to expect "image"
+ instead of "img".
+
2021-07-12 Arcady Goldmints-Orlov <[email protected]>
[GTK] media/playlist-inherits-user-gesture.html is timing out
Added: trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role-expected.txt (0 => 279829)
--- trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -0,0 +1,11 @@
+This test ensures that role="image" and role="img" are synonyms.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS img.role is 'AXRole: AXImage'
+PASS image.role is 'AXRole: AXImage'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role.html (0 => 279829)
--- trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role.html (rev 0)
+++ trunk/LayoutTests/accessibility/image-role-is-synonomous-with-img-role.html 2021-07-12 16:14:28 UTC (rev 279829)
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+ <script src=""
+ <script src=""
+</head>
+<body>
+<div id="content">
+ <div id="img" role="img">This div should have a role of image.</div>
+ <div id="image" role="image">This div should also have a role of image.</div>
+</div>
+<script>
+ description("This test ensures that role=\"image\" and role=\"img\" are synonyms.");
+ if (window.accessibilityController) {
+ var img = accessibilityController.accessibleElementById("img");
+ var image = accessibilityController.accessibleElementById("image");
+ shouldBe("img.role", "'AXRole: AXImage'");
+ shouldBe("image.role", "'AXRole: AXImage'");
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt (279828 => 279829)
--- trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -19,7 +19,7 @@
PASS: h5 -> heading.
PASS: h5 -> heading.
PASS: hr -> separator.
-PASS: img[alt='X'] -> img.
+PASS: img[alt='X'] -> image.
PASS: input[type='button'] -> button.
PASS: input[type='checkbox'] -> checkbox.
PASS: input[type='date'] -> .
@@ -117,7 +117,7 @@
PASS: div[role="gridcell"] -> gridcell.
PASS: div[role="group"] -> group.
PASS: div[role="heading"] -> heading.
-PASS: div[role="img"] -> img.
+PASS: div[role="img"] -> image.
PASS: div[role="link"] -> link.
PASS: div[role="list"] -> list.
PASS: div[role="listitem"] -> listitem.
@@ -170,16 +170,16 @@
PASS: div[role="foo
button
bar"] -> .
-PASS: img[role="foo"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
+PASS: img[role="foo"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
PASS: img[role="foo
-bar"] -> img.
+bar"] -> image.
PASS: img[role="text"] -> text.
PASS: img[role="text img"] -> text.
-PASS: img[role="img text"] -> img.
-PASS: img[role="presentation"][aria-label] -> img.
+PASS: img[role="img text"] -> image.
+PASS: img[role="presentation"][aria-label] -> image.
PASS: a[role="foo bar"] -> link.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/accessibility/roles-computedRoleString.html (279828 => 279829)
--- trunk/LayoutTests/accessibility/roles-computedRoleString.html 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/accessibility/roles-computedRoleString.html 2021-07-12 16:14:28 UTC (rev 279829)
@@ -28,10 +28,10 @@
<h5 data-role="heading" data-platform="atk,mac" class="ex">X</h5>
<h5 data-role="heading" data-platform="atk,mac" class="ex">X</h6>
<hr data-role="separator" data-platform="atk,mac" class="ex">
-<img data-role="img" data-platform="atk,mac" class="ex" data-note=":not([src]):not([alt])">
+<img data-role="image" data-platform="atk,mac" class="ex" data-note=":not([src]):not([alt])">
<img data-role="" data-platform="atk,mac" class="ex" alt="" data-note="[alt='']">
-<img data-role="img" data-platform="atk,mac" class="ex" src="" data-note="[src]:not([alt])">
-<img data-role="img" data-platform="atk,mac" class="ex" alt="X" data-note="[alt='X']">
+<img data-role="image" data-platform="atk,mac" class="ex" src="" data-note="[src]:not([alt])">
+<img data-role="image" data-platform="atk,mac" class="ex" alt="X" data-note="[alt='X']">
<input type="button" value="X" data-role="button" data-platform="atk,mac" class="ex" data-note="[type='button']">
<input type="checkbox" data-role="checkbox" data-platform="atk,mac" class="ex" data-note="[type='checkbox']">
<input type="date" data-role=""data-platform="atk,mac" class="ex" data-note="[type='date']">
@@ -190,7 +190,7 @@
<div role="form" data-role="form" 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>
+<div role="graphics-symbol" data-role="image" data-platform="atk,mac" class="ex">X</div>
<div role="grid" data-role="grid" data-platform="atk,mac" class="ex">
<div role="rowgroup" data-role="rowgroup" data-platform="atk,mac" class="ex">
<div role="row" data-role="row" data-platform="atk,mac" class="ex">
@@ -203,7 +203,7 @@
<div role="feed" data-role="feed" data-platform="atk,mac" class="ex">X</div>
<div role="group" data-role="group" data-platform="atk,mac" class="ex">X</div>
<div role="heading" data-role="heading" data-platform="atk,mac" class="ex">X</div>
-<div role="img" data-role="img" data-platform="atk,mac" class="ex">X</div>
+<div role="img" data-role="image" data-platform="atk,mac" class="ex">X</div>
<div role="insertion" data-role="insertion" data-platform="atk,mac" class="ex">X</div>
<div role="link" data-role="link" data-platform="atk,mac" class="ex">X</div>
<div role="list" data-role="list" data-platform="atk,mac" class="ex">
@@ -293,16 +293,16 @@
<!-- ==================================================================================================== -->
<!-- implicit role parsing tests -->
<!-- ==================================================================================================== -->
-<img role="foo" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex">
-<img role="foo bar" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex">
-<img role="foo bar" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Two spaces in role string -->
-<img role="foo bar" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Newline in role string -->
+<img role="foo" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex">
+<img role="foo bar" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex">
+<img role="foo bar" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Two spaces in role string -->
+<img role="foo bar" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Newline in role string -->
<img role="foo
-bar" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Tab char in role string -->
+bar" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex"><!-- [sic] Tab char in role string -->
<img role="text" src="" data-role="text" alt="X" data-platform="atk,mac" class="ex">
<img role="text img" src="" data-role="text" alt="X" data-platform="atk,mac" class="ex">
-<img role="img text" src="" data-role="img" alt="X" data-platform="atk,mac" class="ex">
-<img role="presentation" data-role="img" data-note="[aria-label]" alt="X" src="" aria-label="X" data-platform="atk,mac" class="ex"><!-- presentation with global attr should fallback to implicit role -->
+<img role="img text" src="" data-role="image" alt="X" data-platform="atk,mac" class="ex">
+<img role="presentation" data-role="image" data-note="[aria-label]" alt="X" src="" aria-label="X" data-platform="atk,mac" class="ex"><!-- presentation with global attr should fallback to implicit role -->
<a href="" role="foo bar" data-role="link" data-platform="atk,mac" class="ex">X</a>
</div>
Modified: trunk/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt (279828 => 279829)
--- trunk/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -339,7 +339,7 @@
<img src="" alt="x">
exists: true
label: x
- role: img
+ role: image
<img src="" alt="">
exists: true
@@ -350,7 +350,7 @@
<img src=""
exists: true
label:
- role: img
+ role: image
<img src=""
exists: true
@@ -613,7 +613,7 @@
<div role="doc-cover">doc-cover</div>
exists: true
label:
- role: img
+ role: image
parentNodeId: exists
<div role="doc-conclusion">doc-conclusion</div>
Modified: trunk/LayoutTests/platform/glib/accessibility/roles-computedRoleString-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/glib/accessibility/roles-computedRoleString-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/glib/accessibility/roles-computedRoleString-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -20,7 +20,7 @@
PASS: h5 -> heading.
PASS: h5 -> heading.
PASS: hr -> separator.
-PASS: img[alt='X'] -> img.
+PASS: img[alt='X'] -> image.
PASS: input[type='button'] -> button.
PASS: input[type='checkbox'] -> checkbox.
PASS: input[type='date'] -> .
@@ -117,7 +117,7 @@
PASS: div[role="form"] -> form.
PASS: div[role="graphics-document"] -> document.
PASS: div[role="graphics-object"] -> group.
-PASS: div[role="graphics-symbol"] -> img.
+PASS: div[role="graphics-symbol"] -> image.
PASS: div[role="grid"] -> grid.
PASS: div[role="row"] -> row.
PASS: div[role="rowheader"] -> rowheader.
@@ -126,7 +126,7 @@
PASS: div[role="feed"] -> feed.
PASS: div[role="group"] -> group.
PASS: div[role="heading"] -> heading.
-PASS: div[role="img"] -> img.
+PASS: div[role="img"] -> image.
PASS: div[role="insertion"] -> insertion.
PASS: div[role="link"] -> link.
PASS: div[role="list"] -> list.
@@ -187,16 +187,16 @@
PASS: div[role="foo
button
bar"] -> .
-PASS: img[role="foo"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
+PASS: img[role="foo"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
PASS: img[role="foo
-bar"] -> img.
+bar"] -> image.
PASS: img[role="text"] -> text.
PASS: img[role="text img"] -> text.
-PASS: img[role="img text"] -> img.
-PASS: img[role="presentation"][aria-label] -> img.
+PASS: img[role="img text"] -> image.
+PASS: img[role="presentation"][aria-label] -> image.
PASS: a[role="foo bar"] -> link.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -438,7 +438,7 @@
AXExpanded: 0
AXRequired: 0
AXChecked: 0
-AXPlatformAttributes: computed-role:img, xml-roles:img, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:image, xml-roles:img, tag:div, toolkit:WebKitGtk
------------
AXRole: AXInsertion
AXParent: AXWebArea
@@ -1239,7 +1239,7 @@
AXExpanded: 0
AXRequired: 0
AXChecked: 0
-AXPlatformAttributes: computed-role:img, xml-roles:doc-cover, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:image, xml-roles:doc-cover, tag:div, toolkit:WebKitGtk
------------
AXRole: AXSection
AXParent: AXWebArea
@@ -1811,7 +1811,7 @@
AXExpanded: 0
AXRequired: 0
AXChecked: 0
-AXPlatformAttributes: computed-role:img, xml-roles:graphics-symbol, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:image, xml-roles:graphics-symbol, tag:div, toolkit:WebKitGtk
------------
AXRole: AXParagraph
AXParent: AXWebArea
Modified: trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -41,6 +41,6 @@
AXRequired: 0
AXChecked: 0
AXURL: LayoutTests/accessibility/resources/cake.png
-AXPlatformAttributes: computed-role:img, tag:img, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:image, tag:img, toolkit:WebKitGtk
Modified: trunk/LayoutTests/platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -325,7 +325,7 @@
<img src="" alt="x">
exists: true
label: x
- role: img
+ role: image
<img src="" alt="">
exists: true
@@ -336,7 +336,7 @@
<img src=""
exists: true
label:
- role: img
+ role: image
<img src=""
exists: true
@@ -573,7 +573,7 @@
<div role="doc-cover">doc-cover</div>
exists: true
label:
- role: img
+ role: image
parentNodeId: exists
<div role="doc-conclusion">doc-conclusion</div>
Modified: trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -20,7 +20,7 @@
PASS: h5 -> heading.
PASS: h5 -> heading.
PASS: hr -> separator.
-PASS: img[alt='X'] -> img.
+PASS: img[alt='X'] -> image.
PASS: input[type='button'] -> button.
PASS: input[type='checkbox'] -> checkbox.
PASS: input[type='date'] -> .
@@ -116,7 +116,7 @@
PASS: div[role="form"] -> form.
PASS: div[role="graphics-document"] -> document.
PASS: div[role="graphics-object"] -> group.
-PASS: div[role="graphics-symbol"] -> img.
+PASS: div[role="graphics-symbol"] -> image.
PASS: div[role="grid"] -> grid.
PASS: div[role="row"] -> row.
PASS: div[role="rowheader"] -> rowheader.
@@ -125,7 +125,7 @@
PASS: div[role="feed"] -> feed.
PASS: div[role="group"] -> group.
PASS: div[role="heading"] -> heading.
-PASS: div[role="img"] -> img.
+PASS: div[role="img"] -> image.
PASS: div[role="insertion"] -> insertion.
PASS: div[role="link"] -> link.
PASS: div[role="list"] -> list.
@@ -186,16 +186,16 @@
PASS: div[role="foo
button
bar"] -> .
-PASS: img[role="foo"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
-PASS: img[role="foo bar"] -> img.
+PASS: img[role="foo"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
+PASS: img[role="foo bar"] -> image.
PASS: img[role="foo
-bar"] -> img.
+bar"] -> image.
PASS: img[role="text"] -> text.
PASS: img[role="text img"] -> text.
-PASS: img[role="img text"] -> img.
-PASS: img[role="presentation"][aria-label] -> img.
+PASS: img[role="img text"] -> image.
+PASS: img[role="presentation"][aria-label] -> image.
PASS: a[role="foo bar"] -> link.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/platform/wpe/accessibility/image-link-expected.txt (279828 => 279829)
--- trunk/LayoutTests/platform/wpe/accessibility/image-link-expected.txt 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/LayoutTests/platform/wpe/accessibility/image-link-expected.txt 2021-07-12 16:14:28 UTC (rev 279829)
@@ -41,6 +41,6 @@
AXRequired: 0
AXChecked: 0
AXURL: LayoutTests/accessibility/resources/cake.png
-AXPlatformAttributes: computed-role:img, tag:img, toolkit:WPEWebKit
+AXPlatformAttributes: computed-role:image, tag:img, toolkit:WPEWebKit
Modified: trunk/Source/WebCore/ChangeLog (279828 => 279829)
--- trunk/Source/WebCore/ChangeLog 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/Source/WebCore/ChangeLog 2021-07-12 16:14:28 UTC (rev 279829)
@@ -1,3 +1,20 @@
+2021-07-12 Tyler Wilcock <[email protected]>
+
+ AX: Add ARIA role "image" as a new role, and leave "img" as a synonym
+ https://bugs.webkit.org/show_bug.cgi?id=224615
+
+ Reviewed by Chris Fleizach.
+
+ Test: accessibility/image-role-is-synonomous-with-img-role.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::initializeRoleMap):
+ Add "image" ARIA role as a synonym for the "img" ARIA role, both of
+ which map to the AccessibilityRole::Image WebCore representation.
+
+ Also hardcode the ARIA reverse role map to return "image" for
+ the AccessibilityRole::Image key.
+
2021-07-12 Alexander Mikhaylenko <[email protected]>
[GTK][WPE] Support drawing scrollbar corner
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (279828 => 279829)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-07-12 15:41:52 UTC (rev 279828)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-07-12 16:14:28 UTC (rev 279829)
@@ -2124,6 +2124,8 @@
{ "rowheader"_s, AccessibilityRole::RowHeader },
{ "group"_s, AccessibilityRole::ApplicationGroup },
{ "heading"_s, AccessibilityRole::Heading },
+ // The "image" role is synonymous with the "img" role. https://w3c.github.io/aria/#image
+ { "image"_s, AccessibilityRole::Image },
{ "img"_s, AccessibilityRole::Image },
{ "insertion"_s, AccessibilityRole::Insertion },
{ "link"_s, AccessibilityRole::WebCoreLink },
@@ -2184,6 +2186,7 @@
gAriaRoleMap->set(roles[i].ariaRole, roles[i].webcoreRole);
gAriaReverseRoleMap->set(static_cast<int>(roles[i].webcoreRole), roles[i].ariaRole);
}
+ gAriaReverseRoleMap->set(static_cast<int>(AccessibilityRole::Image), "image"_s);
}
static ARIARoleMap& ariaRoleMap()