Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
AX: elements with explicit tabindex should expose AXFocused as writab…
…le, since mouse clicks can focus it https://bugs.webkit.org/show_bug.cgi?id=121335 Reviewed by Mario Sanchez Prada. Source/WebCore: Re-order logic that determines if a <span> should appear as an accessible element. The change is that if an element canSetFocus() it should always be in the AX tree. Test: accessibility/tabindex-elements-are-accessible.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): LayoutTests: * accessibility/tabindex-elements-are-accessible-expected.txt: Added. * accessibility/tabindex-elements-are-accessible.html: Added. New test to ensure that if tabindex is on an element, it is in the AX tree. * platform/mac/accessibility/table-with-row-col-of-headers-expected.txt: * platform/mac/accessibility/table-with-row-col-of-headers.html: Update to reflect that if an ignored <table> has a tabindex, then it should at least be an AXGroup * platform/mac/accessibility/update-children-when-aria-role-changes.html: Update so that the <span> elements being used don't have tabindex, which forces them to be in the AX tree, which changes the output of the test (basically we'd need to query the child of those elements instead). Canonical link: https://commits.webkit.org/141568@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
8 changed files
with
113 additions
and
17 deletions.
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
28 changes: 28 additions & 0 deletions
28
LayoutTests/accessibility/tabindex-elements-are-accessible-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,28 @@ | ||
test test test | ||
test | ||
|
||
This tests that if tabindex is set on an object, it will be accessible (even if it is usually not) | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
Item 1: Is focusable: true | ||
Item 1: AXRole: AXGroup | ||
|
||
|
||
Item 2: Is focusable: true | ||
Item 2: AXRole: AXGroup | ||
|
||
|
||
Item 3: Is focusable: true | ||
Item 3: AXRole: AXGroup | ||
|
||
|
||
Item 4: Is focusable: true | ||
Item 4: AXRole: AXGroup | ||
|
||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
35 changes: 35 additions & 0 deletions
35
LayoutTests/accessibility/tabindex-elements-are-accessible.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,35 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
|
||
<span tabindex="-1" id="item1">test</span> | ||
<span tabindex="0" id="item2">test</span> | ||
<span tabindex="1" id="item3">test</span> | ||
|
||
<p tabindex="-1" id="item4">test | ||
|
||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<script> | ||
|
||
description("This tests that if tabindex is set on an object, it will be accessible (even if it is usually not)"); | ||
|
||
if (window.accessibilityController) { | ||
for (var k = 1; k < 5; k++) { | ||
var item = accessibilityController.accessibleElementById("item" + k); | ||
debug("Item " + k + ": Is focusable: " + item.isFocusable); | ||
debug("Item " + k + ": " + item.role); | ||
debug("\n"); | ||
} | ||
} | ||
|
||
</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
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