Commit a998f082 authored by Jessica Tallon's avatar Jessica Tallon Committed by Commit Bot

Emit a11y expanded events on linux when a button has a popup

Bug: 978136
Change-Id: Id7026f3132f38398f1a0e9fc8cf2413a30095979
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1771402Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Jessica Tallon <jtallon@igalia.com>
Cr-Commit-Position: refs/heads/master@{#691076}
parent 7acdc008
...@@ -240,6 +240,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, ...@@ -240,6 +240,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
RunEventTest(FILE_PATH_LITERAL("aria-busy-changed.html")); RunEventTest(FILE_PATH_LITERAL("aria-busy-changed.html"));
} }
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
AccessibilityEventsAriaButtonExpand) {
RunEventTest(FILE_PATH_LITERAL("aria-button-expand.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest, IN_PROC_BROWSER_TEST_P(DumpAccessibilityEventsTest,
AccessibilityEventsAriaComboBoxCollapse) { AccessibilityEventsAriaComboBoxCollapse) {
RunEventTest(FILE_PATH_LITERAL("aria-combo-box-collapse.html")); RunEventTest(FILE_PATH_LITERAL("aria-combo-box-collapse.html"));
......
CHILDREN-CHANGED index:1 CHILD:(role=ROLE_SECTION) role=ROLE_DOCUMENT_WEB ENABLED,FOCUSABLE,FOCUSED,SENSITIVE,SHOWING,VISIBLE
STATE-CHANGE:EXPANDED:TRUE role=ROLE_PUSH_BUTTON name='Click Me' ENABLED,EXPANDABLE,EXPANDED,SENSITIVE,SHOWING,VISIBLE
<!DOCTYPE html>
<html>
<body>
<div id="mybutton" role="button" aria-haspopup="true" onmousedown="toggle()">
Click Me
</div>
<div style="display:none;" id="menuitems">
<a href="#1">One</a>
<a href="#2">Two</a>
</div>
<script>
function go() {
var popUpButton = document.getElementById("mybutton");
var clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent('mousedown', true, true, window);
popUpButton.dispatchEvent(clickEvent);
}
function toggle() {
var popUpButton = document.getElementById("mybutton");
var menuItems = document.getElementById("menuitems");
if (popUpButton.getAttribute("aria-expanded")) {
menuItems.style.display = "none";
popUpButton.removeAttribute("aria-expanded");
} else {
menuItems.style.display = null;
popUpButton.setAttribute("aria-expanded", true);
}
}
</script>
</body>
</html>
...@@ -1868,6 +1868,7 @@ bool AXObject::SupportsARIAExpanded() const { ...@@ -1868,6 +1868,7 @@ bool AXObject::SupportsARIAExpanded() const {
case ax::mojom::Role::kDisclosureTriangle: case ax::mojom::Role::kDisclosureTriangle:
case ax::mojom::Role::kListBox: case ax::mojom::Role::kListBox:
case ax::mojom::Role::kLink: case ax::mojom::Role::kLink:
case ax::mojom::Role::kPopUpButton:
case ax::mojom::Role::kMenuButton: case ax::mojom::Role::kMenuButton:
case ax::mojom::Role::kMenuItem: case ax::mojom::Role::kMenuItem:
case ax::mojom::Role::kMenuItemCheckBox: case ax::mojom::Role::kMenuItemCheckBox:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment