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: aria-activedescendant doesn't work for display:contents elements
https://bugs.webkit.org/show_bug.cgi?id=255648 rdar://problem/108248056 Reviewed by Chris Fleizach. Move `shouldFocusActiveDescendant` and `activeDescendant` from AccessibilityRenderObject to AccessibilityObject since they don't require a renderer. Tested by new test: display-contents-descendant-menu-item.html Also removes two unused functions: - isLinked - hasControlsAttributeSet And rewrites accessibility/mac/aria-tree-activedescendant.html to be a more modern style layout test. * LayoutTests/accessibility/display-contents-descendant-menu-item-expected.txt: Added. * LayoutTests/accessibility/display-contents-descendant-menu-item.html: Added. * LayoutTests/platform/mac-wk1/TestExpectations: Skip new test. * LayoutTests/accessibility/mac/aria-tree-activedescendant-expected.txt: * LayoutTests/accessibility/mac/aria-tree-activedescendant.html: * Source/WebCore/accessibility/AccessibilityImageMapLink.h: * Source/WebCore/accessibility/AccessibilityMediaObject.cpp: (WebCore::AccessibilityMediaObject::hasControlsAttributeSet const): Deleted. * Source/WebCore/accessibility/AccessibilityMediaObject.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::shouldFocusActiveDescendant const): (WebCore::AccessibilityObject::activeDescendant const): * Source/WebCore/accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isLinked const): Deleted. (WebCore::AccessibilityObject::shouldFocusActiveDescendant const): Deleted. * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::observableObject const): (WebCore::AccessibilityRenderObject::expandedTextValue const): (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const): Deleted. (WebCore::AccessibilityRenderObject::activeDescendant const): Deleted. (WebCore::AccessibilityRenderObject::isLinked const): Deleted. * Source/WebCore/accessibility/AccessibilityRenderObject.h: Canonical link: https://commits.webkit.org/263163@main
- Loading branch information
Showing
12 changed files
with
113 additions
and
102 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
LayoutTests/accessibility/display-contents-descendant-menu-item-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,10 @@ | ||
This test ensures that the aria-activedescendant of a display:contents menu is considered selected. | ||
|
||
PASS: accessibilityController.accessibleElementById('item1').isSelected === true | ||
PASS: accessibilityController.accessibleElementById('item2').isSelected === false | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Menu item 1 | ||
Menu item 2 |
25 changes: 25 additions & 0 deletions
25
LayoutTests/accessibility/display-contents-descendant-menu-item.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,25 @@ | ||
<!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="menu" style="display:contents" role="menu" aria-activedescendant="item1"> | ||
<div role="menuitem" id="item1" tabindex="-1">Menu item 1</div> | ||
<div role="menuitem" id="item2" tabindex="-1">Menu item 2</div> | ||
</div> | ||
|
||
<script> | ||
var output = "This test ensures that the aria-activedescendant of a display:contents menu is considered selected.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
output += expect("accessibilityController.accessibleElementById('item1').isSelected", "true"); | ||
output += expect("accessibilityController.accessibleElementById('item2').isSelected", "false"); | ||
debug(output); | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
|
4 changes: 2 additions & 2 deletions
4
LayoutTests/accessibility/mac/aria-tree-activedescendant-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
64 changes: 33 additions & 31 deletions
64
LayoutTests/accessibility/mac/aria-tree-activedescendant.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 |
---|---|---|
@@ -1,46 +1,48 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body id="body"> | ||
<body> | ||
|
||
<ul id="tree0" role="tree" aria-labelledby="treelabel" aria-activedescendant="tree0_item0" tabindex="0"> | ||
<li id="tree0_item0" role="treeitem" aria-level="1" aria-expanded="true"> | ||
<span><span class="expander"></span>Animals</span> | ||
<ul role="group"> | ||
<li id="tree0_item0_0" role="treeitem" aria-level="2"><span>Birds</span></li> | ||
<li id="tree0_item0_1" role="treeitem" aria-level="2" aria-expanded="false"> | ||
<span><span class="expander"></span>Cats</span> | ||
<ul role="group"> | ||
<li id="tree0_item0_1_0" role="treeitem"aria-level="3"><span>Siamese</span></li> | ||
<li id="tree0_item0_1_1" role="treeitem" aria-level="3"><span>Tabby</span></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li id="tree0_item0" role="treeitem" aria-level="1" aria-expanded="true"> | ||
<span><span class="expander"></span>Animals</span> | ||
<ul role="group"> | ||
<li id="tree0_item0_0" role="treeitem" aria-level="2"><span>Birds</span></li> | ||
<li id="tree0_item0_1" role="treeitem" aria-level="2" aria-expanded="false"> | ||
<span><span class="expander"></span>Cats</span> | ||
<ul role="group"> | ||
<li id="tree0_item0_1_0" role="treeitem"aria-level="3"><span>Siamese</span></li> | ||
<li id="tree0_item0_1_1" role="treeitem" aria-level="3"><span>Tabby</span></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
<script> | ||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
var output = "This tests that the aria-activedescendant attributes works properly.\n\n"; | ||
var axtree, activeDescendant, newActiveDescendant; | ||
setTimeout(function() { | ||
axtree = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0); | ||
activeDescendant = axtree.childAtIndex(0); | ||
output += expect("axtree.selectedRowAtIndex(0).isEqual(activeDescendant)", "true"); | ||
var output = "This tests that the aria-activedescendant attributes works properly.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var axTree, activeDescendant, newActiveDescendant; | ||
setTimeout(async function() { | ||
axTree = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0); | ||
activeDescendant = axTree.childAtIndex(0); | ||
output += expect("axTree.selectedRowAtIndex(0).isEqual(activeDescendant)", "true"); | ||
|
||
newActiveDescendant = axtree.childAtIndex(2); | ||
document.getElementById("tree0").setAttribute("aria-activedescendant", "tree0_item0_1"); | ||
output += expect("axtree.selectedRowAtIndex(0).isEqual(newActiveDescendant)", "true"); | ||
newActiveDescendant = axTree.childAtIndex(2); | ||
document.getElementById("tree0").setAttribute("aria-activedescendant", "tree0_item0_1"); | ||
output += await expectAsync("axTree.selectedRowAtIndex(0).isEqual(newActiveDescendant)", "true"); | ||
|
||
debug(output); | ||
tree0.style.visibility = "hidden"; | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
debug(output); | ||
tree0.style.visibility = "hidden"; | ||
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
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
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