Skip to content

Commit

Permalink
Merge r222822 - AX: [ATK] ARIA menuitems should be exposed with ATK_R…
Browse files Browse the repository at this point in the history
…OLE_MENU_ITEM even when it's the child of group role

https://bugs.webkit.org/show_bug.cgi?id=177811

Reviewed by Chris Fleizach.

Source/WebCore:

AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
the ATK code was not handling that remapped role value. As a result, the element
was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
types exposed as ATK_ROLE_MENU_ITEM.

Test: accessibility/gtk/menu-with-group-child-tree.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

* accessibility/gtk/menu-with-group-child-tree-expected.txt: Added.
* accessibility/gtk/menu-with-group-child-tree.html: Added.
  • Loading branch information
joanmarie authored and carlosgcampos committed Oct 17, 2017
1 parent a5bcc98 commit b2cf496
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
https://bugs.webkit.org/show_bug.cgi?id=177811

Reviewed by Chris Fleizach.

* accessibility/gtk/menu-with-group-child-tree-expected.txt: Added.
* accessibility/gtk/menu-with-group-child-tree.html: Added.

2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

AX: [ATK] aria-rowindex set on row element is not being exposed
Expand Down
@@ -0,0 +1,13 @@
AXRole: AXMenu AXTitle:
AXRole: AXGroup AXTitle:
AXRole: AXMenuItem AXTitle: content 1
AXRole: AXMenuItem AXTitle: content 2
This verifies the accessibility tree of a menu with a group child.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS successfullyParsed is true

TEST COMPLETE

28 changes: 28 additions & 0 deletions LayoutTests/accessibility/gtk/menu-with-group-child-tree.html
@@ -0,0 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="../../resources/accessibility-helper.js"></script>
</head>
<body id="body">
<div id="content">
<div role="menu" id="menu">
<div role="group"><div role="menuitem">content 1</div></div>
<div role="menuitem">content 2</div>
</div>
</div>
</div>
<pre id="tree"></pre>
<p id="description"></p>
<div id="console"></div>
<script>
description("This verifies the accessibility tree of a menu with a group child.");
if (window.accessibilityController) {
var menu = accessibilityController.accessibleElementById("menu");
dumpAccessibilityTree(menu, null, 0, false, true);
}
document.getElementById("content").style.visibility = "hidden";
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
https://bugs.webkit.org/show_bug.cgi?id=177811

Reviewed by Chris Fleizach.

AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
the ATK code was not handling that remapped role value. As a result, the element
was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
types exposed as ATK_ROLE_MENU_ITEM.

Test: accessibility/gtk/menu-with-group-child-tree.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

AX: [ATK] aria-rowindex set on row element is not being exposed
Expand Down
Expand Up @@ -650,6 +650,7 @@ static AtkRole atkRole(AccessibilityObject* coreObject)
return ATK_ROLE_MENU;
case MenuListOptionRole:
case MenuItemRole:
case MenuButtonRole:
return ATK_ROLE_MENU_ITEM;
case MenuItemCheckboxRole:
return ATK_ROLE_CHECK_MENU_ITEM;
Expand Down

0 comments on commit b2cf496

Please sign in to comment.