Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r175241 - AX: input type=hidden is being exposed when aria-hidd…
…en=false https://bugs.webkit.org/show_bug.cgi?id=138106 Reviewed by Benjamin Poulain. Source/WebCore: If an input type=hidden was inside an aria-hidden=false, it would appear because the lack of a RenderObject behind that object was not blocking its adoption into the AX tree. We should explicity check for whether the type is hidden and then return an appropriate role. Test: accessibility/input-type-hidden-in-aria-hidden-false.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored): LayoutTests: * accessibility/input-type-hidden-in-aria-hidden-false-expected.txt: Added. * accessibility/input-type-hidden-in-aria-hidden-false.html: Added. Canonical link: https://commits.webkit.org/154760.164@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@175917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
65c7058
commit 8e5c42b
Showing
5 changed files
with
90 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
13 changes: 13 additions & 0 deletions
13
LayoutTests/accessibility/input-type-hidden-in-aria-hidden-false-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,13 @@ | ||
This tests that input type of hidden are not exposed when aria-hidden=false | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS content.childrenCount is 0 | ||
PASS !content || !content.isValid() is true | ||
PASS content.childrenCount is 0 | ||
PASS !content || !content.isValid() is true | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
44 changes: 44 additions & 0 deletions
44
LayoutTests/accessibility/input-type-hidden-in-aria-hidden-false.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body id="body"> | ||
|
||
<div id="content" role="group"> | ||
<input type="hidden"> | ||
</div> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<script> | ||
|
||
description("This tests that input type of hidden are not exposed when aria-hidden=false"); | ||
|
||
if (window.accessibilityController) { | ||
// By default, this should have no children because input type=hidden is hidden. | ||
var content = accessibilityController.accessibleElementById("content"); | ||
shouldBe("content.childrenCount", "0"); | ||
|
||
// When aria-hidden=true, content should not even be there | ||
document.getElementById("content").setAttribute("aria-hidden", "true"); | ||
content = accessibilityController.accessibleElementById("content"); | ||
shouldBeTrue("!content || !content.isValid()"); | ||
|
||
// When aria-hidden=false, we should NOT expose input type=hidden | ||
document.getElementById("content").setAttribute("aria-hidden", "false"); | ||
content = accessibilityController.accessibleElementById("content"); | ||
shouldBe("content.childrenCount", "0"); | ||
|
||
// And changing back to true on the fly should have a similar effect | ||
document.getElementById("content").setAttribute("aria-hidden", "true"); | ||
content = accessibilityController.accessibleElementById("content"); | ||
shouldBeTrue("!content || !content.isValid()"); | ||
} | ||
|
||
</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