Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r222544 - AX: Several ARIA roles with presentational children a…
…re exposing children https://bugs.webkit.org/show_bug.cgi?id=177502 Reviewed by Chris Fleizach. Source/WebCore: Add MenuItemCheckboxRole, MenuItemRadioRole, and SplitterRole to the list of AccessibilityRole types which cannot have children. In the case of DocumentMathRole, only treat children as presentational (excluded from the accessibility tree) if the element is not MathML. Test: accessibility/presentational-children.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canHaveChildren const): LayoutTests: New test. Also update the results for the inspector because ARIA separators and their subclass roles should not expose (claim to have) children. * accessibility/presentational-children-expected.txt: Added. * accessibility/presentational-children.html: Added. * inspector/dom/getAccessibilityPropertiesForNode-expected.txt: Updated.
- Loading branch information
1 parent
b82882b
commit afb7640
Showing
6 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
LayoutTests/accessibility/presentational-children-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
This tests that roles with children presentational true report no children. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
button childrenCount: 0 | ||
checkbox childrenCount: 0 | ||
img childrenCount: 0 | ||
math childrenCount: 0 | ||
menuitemcheckbox childrenCount: 0 | ||
menuitemradio childrenCount: 0 | ||
option childrenCount: 0 | ||
progressbar childrenCount: 0 | ||
radio childrenCount: 0 | ||
scrollbar childrenCount: 0 | ||
separator childrenCount: 0 | ||
slider childrenCount: 0 | ||
switch childrenCount: 0 | ||
tab childrenCount: 0 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body id="body"> | ||
<div id="content"> | ||
<div role="button" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="checkbox" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="img" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="math" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="menu"> | ||
<div role="menuitemcheckbox" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="menuitemradio" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
</div> | ||
<div role="listbox"> | ||
<div role="option" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
</div> | ||
<div role="progressbar" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="radio" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="scrollbar" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="separator" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="slider" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="switch" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
<div role="tablist"> | ||
<div role="tab" tabindex="0" class="ex"><div>a</div><div>b</div></div> | ||
</div> | ||
</div> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
description("This tests that roles with children presentational true report no children."); | ||
if (window.accessibilityController) { | ||
var elements = document.querySelectorAll(".ex"); | ||
var count = elements.length; | ||
for (var i = 0; i < count; i++) { | ||
var el = elements[i]; | ||
el.focus(); | ||
debug(el.getAttribute("role") + " childrenCount: " + accessibilityController.focusedElement.childrenCount); | ||
} | ||
document.getElementById("content").style.visibility = "hidden"; | ||
} | ||
</script> | ||
<script src="../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters