From b2cf496c6453bd9b04a5f7b538e343289c52a949 Mon Sep 17 00:00:00 2001 From: Joanmarie Diggs Date: Tue, 17 Oct 2017 09:39:52 +0000 Subject: [PATCH] Merge r222822 - 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. 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. --- LayoutTests/ChangeLog | 10 +++++++ .../menu-with-group-child-tree-expected.txt | 13 +++++++++ .../gtk/menu-with-group-child-tree.html | 28 +++++++++++++++++++ Source/WebCore/ChangeLog | 18 ++++++++++++ .../atk/WebKitAccessibleWrapperAtk.cpp | 1 + 5 files changed, 70 insertions(+) create mode 100644 LayoutTests/accessibility/gtk/menu-with-group-child-tree-expected.txt create mode 100644 LayoutTests/accessibility/gtk/menu-with-group-child-tree.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 086b97fe63c3..4d6483a27c0c 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2017-10-03 Joanmarie Diggs + + 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 AX: [ATK] aria-rowindex set on row element is not being exposed diff --git a/LayoutTests/accessibility/gtk/menu-with-group-child-tree-expected.txt b/LayoutTests/accessibility/gtk/menu-with-group-child-tree-expected.txt new file mode 100644 index 000000000000..f24e4abf72c3 --- /dev/null +++ b/LayoutTests/accessibility/gtk/menu-with-group-child-tree-expected.txt @@ -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 + diff --git a/LayoutTests/accessibility/gtk/menu-with-group-child-tree.html b/LayoutTests/accessibility/gtk/menu-with-group-child-tree.html new file mode 100644 index 000000000000..3e1bfb247e2e --- /dev/null +++ b/LayoutTests/accessibility/gtk/menu-with-group-child-tree.html @@ -0,0 +1,28 @@ + + + + + + + +
+ +
+ +

+

+
+ + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 21921456a80c..b90ff94789bf 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,21 @@ +2017-10-03 Joanmarie Diggs + + 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 AX: [ATK] aria-rowindex set on row element is not being exposed diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp index 4f778d3a4d2a..4ac81b43bc46 100644 --- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp +++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp @@ -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;