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: [ATK] Events missing and state incorrect for aria-activedescendant
https://bugs.webkit.org/show_bug.cgi?id=178523 Reviewed by Chris Fleizach. Source/WebCore: When the aria-activedescendant of an element changes, emit object:state-changed:focused. When a focused element has a valid active descendant, do not expose the focused state on the element, but rather on the active descendant. Also expose the focusable state on the active descendant. Tests: accessibility/gtk/aria-activedescendant-changed-notification.html accessibility/gtk/aria-activedescendant.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const): (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const): * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (setAtkStateSetFromCoreObject): LayoutTests: * accessibility/gtk/aria-activedescendant-changed-notification-expected.txt: Added. * accessibility/gtk/aria-activedescendant-changed-notification.html: Added. * accessibility/gtk/aria-activedescendant-expected.txt: Added. * accessibility/gtk/aria-activedescendant.html: Added. Canonical link: https://commits.webkit.org/194772@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
11 changed files
with
223 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
15 changes: 15 additions & 0 deletions
15
LayoutTests/accessibility/gtk/aria-activedescendant-changed-notification-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,15 @@ | ||
This tests that changing the aria-activedescendant value results in a state-changed notification. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
AXFocusedUIElementChanged: AXRole: AXEmbedded | ||
AXFocusedUIElementChanged: AXRole: AXTextField | ||
AXFocusedUIElementChanged: AXRole: AXGroup | ||
AXFocusedUIElementChanged: AXRole: AXGroup | ||
AXFocusedUIElementChanged: AXRole: AXGroup | ||
AXFocusedUIElementChanged: AXRole: AXCheckBox | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
46 changes: 46 additions & 0 deletions
46
LayoutTests/accessibility/gtk/aria-activedescendant-changed-notification.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,46 @@ | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<div id="test1" tabindex="0" role="application"> | ||
<div id="child1" role="group">test</div> | ||
</div> | ||
<div id="test2" tabindex="0" role="searchbox"> | ||
<div id="child2" role="group">test</div> | ||
</div> | ||
<div id="test3" tabindex="0" role="group"> | ||
<div id="child3" role="checkbox">test</div> | ||
</div> | ||
</div> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
window.jsTestIsAsync = true; | ||
description("This tests that changing the aria-activedescendant value results in a state-changed notification."); | ||
|
||
if (window.testRunner && window.accessibilityController) { | ||
accessibilityController.addNotificationListener(function(element, notification) { | ||
if (notification != "AXFocusedUIElementChanged") | ||
return; | ||
debug(notification + ": " + element.role); | ||
}); | ||
|
||
for (var i = 1; i <= 3; i++) { | ||
var container = document.getElementById("test" + i); | ||
container.focus(); | ||
container.setAttribute("aria-activedescendant", "child" + i); | ||
} | ||
|
||
document.getElementById("content").style.visibility = "hidden"; | ||
|
||
window.setTimeout(function() { | ||
accessibilityController.removeNotificationListener(); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
LayoutTests/accessibility/gtk/aria-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This tests the exposure of aria-activedescendant | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
|
||
test1 descendant: '' | ||
parent AXRole: AXEmbedded, isFocusable: true, isFocused: true | ||
child1 AXRole: AXGroup, isFocusable: false, isFocused: false | ||
|
||
test2 descendant: 'child2' | ||
parent AXRole: AXEmbedded, isFocusable: true, isFocused: false | ||
child2 AXRole: AXGroup, isFocusable: true, isFocused: true | ||
|
||
test3 descendant: '' | ||
parent AXRole: AXTextField, isFocusable: true, isFocused: true | ||
child3 AXRole: AXGroup, isFocusable: false, isFocused: false | ||
|
||
test4 descendant: 'child4' | ||
parent AXRole: AXTextField, isFocusable: true, isFocused: false | ||
child4 AXRole: AXGroup, isFocusable: true, isFocused: true | ||
|
||
test5 descendant: '' | ||
parent AXRole: AXGroup, isFocusable: true, isFocused: true | ||
child5 AXRole: AXCheckBox, isFocusable: false, isFocused: false | ||
|
||
test6 descendant: 'child6' | ||
parent AXRole: AXCheckBox, isFocusable: true, isFocused: true | ||
child6 AXRole: AXCheckBox, isFocusable: true, isFocused: true | ||
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,54 @@ | ||
<!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 id="test1" tabindex="0" aria-activedescendant="" role="application"> | ||
<div id="child1" role="group">test</div> | ||
</div> | ||
<div id="test2" tabindex="0" aria-activedescendant="child2" role="application"> | ||
<div id="child2" role="group">test</div> | ||
</div> | ||
<div id="test3" tabindex="0" aria-activedescendant="" role="searchbox"> | ||
<div id="child3" role="group">test</div> | ||
</div> | ||
<div id="test4" tabindex="0" aria-activedescendant="child4" role="searchbox"> | ||
<div id="child4" role="group">test</div> | ||
</div> | ||
<div id="test5" tabindex="0" aria-activedescendant="" role="group"> | ||
<div id="child5" role="checkbox">test</div> | ||
</div> | ||
<div id="test6" tabindex="0" aria-activedescendant="child6" role="group"> | ||
<div id="child6" role="checkbox">test</div> | ||
</div> | ||
</div> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
description("This tests the exposure of aria-activedescendant"); | ||
if (window.accessibilityController) { | ||
for (var i = 1; i <= 6; i++) { | ||
var container = document.getElementById("test" + i); | ||
debug("\ntest" + i + " descendant: '" + container.getAttribute("aria-activedescendant") + "'"); | ||
|
||
container.focus(); | ||
var axContainer = accessibilityController.focusedElement; | ||
debug("parent " + axContainer.role + ", " + | ||
"isFocusable: " + axContainer.isFocusable + ", " + | ||
"isFocused: " + axContainer.isFocused); | ||
|
||
var axChild = accessibilityController.accessibleElementById("child" + i); | ||
debug("child" + i + " " + axChild.role + ", " + | ||
"isFocusable: " + axChild.isFocusable + ", " + | ||
"isFocused: " + axChild.isFocused); | ||
} | ||
|
||
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
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