forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX: aria-hidden=false should be a synonym of undefined
https://bugs.webkit.org/show_bug.cgi?id=267150 rdar://120557669 Reviewed by NOBODY (OOPS!). Per spec changes (see w3c/aria#2090), we should treat `aria-hidden=false` as undefined. This patch removes support for aria-hidden=false, updating places where we relied on the behaviors of isNodeARIAVisible with the new behavior. For example, we need to check if a child node is focused before deciding whether to skip it if it is aria-hidden (tested by accessibility/datetime/input-date-field-labels-and-value-changes.html). Tests that explicitly validate aria-hidden false were removed, and a new test to check that we are ignoring this property has been added. * LayoutTests/accessibility/aria-hidden-false-ignored-expected.txt: Added. * LayoutTests/accessibility/aria-hidden-false-ignored.html: Added. * LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html: Removed. * LayoutTests/accessibility/aria-hidden-negates-no-visibility.html: Removed. * LayoutTests/accessibility/aria-hidden-subtree-expected.txt: Added. * LayoutTests/accessibility/aria-hidden-subtree.html: Added. * LayoutTests/accessibility/aria-modal-expected.txt: * LayoutTests/accessibility/aria-modal.html: * LayoutTests/accessibility/aria-visible-element-roles.html: Removed. * LayoutTests/accessibility/datetime/input-date-field-labels-and-value-changes.html: * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isNodeVisible const): (WebCore::AXObjectCache::getOrCreate): (WebCore::isNodeFocused): (WebCore::isNodeAriaVisible): Deleted. * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::textUnderElement const): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::defaultObjectInclusion const): * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::addNodeOnlyChildren):
- Loading branch information
Joshua Hoffman
committed
Aug 15, 2024
1 parent
96293e7
commit 60d612e
Showing
15 changed files
with
132 additions
and
494 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LayoutTests/accessibility/aria-hidden-false-ignored-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,11 @@ | ||
This test ensures that aria-hidden=false is treated like an undefined value. | ||
|
||
PASS: !hiddenText === true | ||
PASS: !invisibleText === true | ||
PASS: !ariaHiddenText === true | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
||
This text is hidden with aria-hidden |
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,38 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div style="display: none"> | ||
<p id="hidden-text" aria-hidden="false">This text should be hidden</p> | ||
</div> | ||
|
||
<div style="visibility: hidden"> | ||
<p id="invisible-text" aria-hidden="false">This text should be invisible</p> | ||
</div> | ||
|
||
<div aria-hidden="true"> | ||
<p id="aria-hidden-text">This text is hidden with aria-hidden</p> | ||
</div> | ||
|
||
<script> | ||
var output = "This test ensures that aria-hidden=false is treated like an undefined value.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
var hiddenText = accessibilityController.accessibleElementById("hidden-text"); | ||
output += expect("!hiddenText", "true"); | ||
var invisibleText = accessibilityController.accessibleElementById("invisible-text"); | ||
output += expect("!invisibleText", "true"); | ||
var ariaHiddenText = accessibilityController.accessibleElementById("aria-hidden-text"); | ||
output += expect("!ariaHiddenText", "true"); | ||
|
||
debug(output); | ||
finishJSTest(); | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
|
152 changes: 0 additions & 152 deletions
152
LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
LayoutTests/accessibility/aria-hidden-negates-no-visibility.html
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
LayoutTests/accessibility/aria-hidden-subtree-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,19 @@ | ||
This test ensures that the entire subtree of an aria-hidden object is hidden. | ||
|
||
DIV is aria-hidden=true: | ||
PASS: !headingElement === true | ||
PASS: !paragraphElement === true | ||
PASS: !buttonElement === true | ||
DIV has aria-hidden unset: | ||
PASS: !!headingElement === true | ||
PASS: !!paragraphElement === true | ||
PASS: !!buttonElement === true | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Heading | ||
|
||
This is a nested paragraph | ||
|
||
Done |
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,47 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="container" aria-hidden="true"> | ||
<h1 id="heading">Heading</h1> | ||
<div> | ||
<p id="paragraph">This is a nested paragraph</p> | ||
<button id="button" href="#">Done</button> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
var output = "This test ensures that the entire subtree of an aria-hidden object is hidden.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
output += "DIV is aria-hidden=true:\n" | ||
var headingElement = accessibilityController.accessibleElementById("heading"); | ||
output += expect("!headingElement", "true"); | ||
var paragraphElement = accessibilityController.accessibleElementById("paragraph"); | ||
output += expect("!paragraphElement", "true"); | ||
var buttonElement = accessibilityController.accessibleElementById("button"); | ||
output += expect("!buttonElement", "true"); | ||
|
||
output += "DIV has aria-hidden unset:\n"; | ||
document.getElementById("container").removeAttribute("aria-hidden"); | ||
setTimeout(async function() { | ||
headingElement = accessibilityController.accessibleElementById("heading"); | ||
output += await expectAsync("!!headingElement", "true"); | ||
paragraphElement = accessibilityController.accessibleElementById("paragraph"); | ||
output += await expectAsync("!!paragraphElement", "true"); | ||
buttonElement = accessibilityController.accessibleElementById("button"); | ||
output += await expectAsync("!!buttonElement", "true"); | ||
|
||
debug(output); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</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
Oops, something went wrong.