Title: [209472] trunk
Revision
209472
Author
n_w...@apple.com
Date
2016-12-07 13:13:13 -0800 (Wed, 07 Dec 2016)

Log Message

AX: menu type toolbar should be mapped correctly on Mac
https://bugs.webkit.org/show_bug.cgi?id=165537

Reviewed by Chris Fleizach.

Source/WebCore:

The menu tag with a toolbar type should have the corresponding role.

Test: accessibility/mac/menu-type-toolbar.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):

LayoutTests:

* accessibility/mac/menu-type-toolbar-expected.txt: Added.
* accessibility/mac/menu-type-toolbar.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209471 => 209472)


--- trunk/LayoutTests/ChangeLog	2016-12-07 21:10:24 UTC (rev 209471)
+++ trunk/LayoutTests/ChangeLog	2016-12-07 21:13:13 UTC (rev 209472)
@@ -1,3 +1,13 @@
+2016-12-07  Nan Wang  <n_w...@apple.com>
+
+        AX: menu type toolbar should be mapped correctly on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=165537
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/menu-type-toolbar-expected.txt: Added.
+        * accessibility/mac/menu-type-toolbar.html: Added.
+
 2016-12-07  Geoffrey Garen  <gga...@apple.com>
 
         Fixed a test failure seen in web-timing-minimal-performance-now.html

Added: trunk/LayoutTests/accessibility/mac/menu-type-toolbar-expected.txt (0 => 209472)


--- trunk/LayoutTests/accessibility/mac/menu-type-toolbar-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/menu-type-toolbar-expected.txt	2016-12-07 21:13:13 UTC (rev 209472)
@@ -0,0 +1,12 @@
+menu toolbar
+This tests that menu type toolbar should be mapped correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS toolbar.role is 'AXRole: AXToolbar'
+PASS toolbar.roleDescription is 'AXRoleDescription: toolbar'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/menu-type-toolbar.html (0 => 209472)


--- trunk/LayoutTests/accessibility/mac/menu-type-toolbar.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/menu-type-toolbar.html	2016-12-07 21:13:13 UTC (rev 209472)
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="content">
+
+<menu id="toolbar" type="toolbar">menu toolbar</menu>
+
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that menu type toolbar should be mapped correctly.");
+
+    if (window.accessibilityController) {
+          var toolbar = accessibilityController.accessibleElementById("toolbar");
+          shouldBe("toolbar.role", "'AXRole: AXToolbar'");
+          shouldBe("toolbar.roleDescription", "'AXRoleDescription: toolbar'");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (209471 => 209472)


--- trunk/Source/WebCore/ChangeLog	2016-12-07 21:10:24 UTC (rev 209471)
+++ trunk/Source/WebCore/ChangeLog	2016-12-07 21:13:13 UTC (rev 209472)
@@ -1,3 +1,17 @@
+2016-12-07  Nan Wang  <n_w...@apple.com>
+
+        AX: menu type toolbar should be mapped correctly on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=165537
+
+        Reviewed by Chris Fleizach.
+
+        The menu tag with a toolbar type should have the corresponding role.
+
+        Test: accessibility/mac/menu-type-toolbar.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+
 2016-12-07  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Add a new project for recording and playing back editing commands in editable web content

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (209471 => 209472)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-12-07 21:10:24 UTC (rev 209471)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-12-07 21:13:13 UTC (rev 209472)
@@ -2791,6 +2791,10 @@
     if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag))
         return FooterRole;
     
+    // menu tags with toolbar type should have Toolbar role.
+    if (node && node->hasTagName(menuTag) && equalLettersIgnoringASCIICase(getAttribute(typeAttr), "toolbar"))
+        return ToolbarRole;
+    
     // If the element does not have role, but it has ARIA attributes, or accepts tab focus, accessibility should fallback to exposing it as a group.
     if (supportsARIAAttributes() || canSetFocusAttribute())
         return GroupRole;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to