Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r176076 - AX: [ATK] Accessible focus events are emitted when th…
…e selection is changed in non-focused combo boxes https://bugs.webkit.org/show_bug.cgi?id=137866 Reviewed by Mario Sanchez Prada. Source/WebCore: Check that the AccessibilityMenuList is really focused before notifying the platform that it is focused. Likewise, only notify the platform of an AccessibilityMenuListOption focus gain if the AccessibilityMenuList containing that option is expanded. Test: platform/gtk/accessibility/menu-list-unfocused-notifications.html * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::notifyChildrenSelectionChange): (WebCore::AXObjectCache::postPlatformNotification): LayoutTests: * platform/gtk/accessibility/menu-list-unfocused-notifications-expected.txt: Added. * platform/gtk/accessibility/menu-list-unfocused-notifications.html: Added. Canonical link: https://commits.webkit.org/154760.198@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@176177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
6568937
commit c6cefc4
Showing
5 changed files
with
109 additions
and
3 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
24 changes: 24 additions & 0 deletions
24
LayoutTests/platform/gtk/accessibility/menu-list-unfocused-notifications-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,24 @@ | ||
OK | ||
This tests that changing the selection in a non-focused combo box doesn't result in erroneous focus claims. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
Changing focus to button. | ||
AXFocusedUIElementChanged: AXRole: AXButton | ||
Focused element is: AXRole: AXButton | ||
|
||
Changing selected item in non-focused combobox. | ||
AXSelectedChildrenChanged: AXRole: AXComboBox | ||
Focused element is: AXRole: AXButton | ||
|
||
Changing selected item in non-focused combobox. | ||
AXSelectedChildrenChanged: AXRole: AXComboBox | ||
Focused element is: AXRole: AXButton | ||
|
||
AXChildrenAdded: AXRole: AXWebArea | ||
AXLoadComplete: AXRole: AXWebArea | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
49 changes: 49 additions & 0 deletions
49
LayoutTests/platform/gtk/accessibility/menu-list-unfocused-notifications.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,49 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<select id="combobox"> | ||
<option value="1">one</option> | ||
<option value="2">two</option> | ||
<option value="3">three</option> | ||
<option value="4">four</option> | ||
</select> | ||
<button id="button">OK</button> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
window.jsTestIsAsync = true; | ||
description("This tests that changing the selection in a non-focused combo box doesn't result in erroneous focus claims."); | ||
|
||
if (window.testRunner && window.accessibilityController) { | ||
accessibilityController.addNotificationListener(function(element, notification) { | ||
debug(notification + ": " + element.role); | ||
}); | ||
|
||
debug("Changing focus to button."); | ||
document.getElementById('button').focus(); | ||
debug("Focused element is: " + accessibilityController.focusedElement.role + "\n"); | ||
|
||
// Programmatic selection changes in the non-focused combo box do not result | ||
// in the button losing focus. Therefore the combo box should not claim focus. | ||
debug("Changing selected item in non-focused combobox."); | ||
document.getElementById('combobox').selectedIndex = 3; | ||
debug("Focused element is: " + accessibilityController.focusedElement.role + "\n"); | ||
|
||
// Programmatic selection changes in the non-focused combo box do not result | ||
// in the button losing focus. Therefore the combo box should not claim focus. | ||
debug("Changing selected item in non-focused combobox."); | ||
document.getElementById('combobox').selectedIndex = 2; | ||
debug("Focused element is: " + accessibilityController.focusedElement.role + "\n"); | ||
|
||
window.setTimeout(function() { | ||
accessibilityController.removeNotificationListener(); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</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