forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dispatch page up/down events on scroll up/down AT actions.
To achieve this, we also move the code from RenderAccessibilityImpl down to the blink layer, in a new method called AXObject::Scroll(). The code is run through the actions API. To be able to test the feature, we added a way to trigger scroll up/down actions through WebAXObjectProxy. Finally, we expose the scroll actions in those platforms that support it, by adding the actions to the node data. Bug: 1099069 Change-Id: I345c902f7d92b83468d0eadf3031eab06ef0fd30 AX-Relnotes: generate page up/down keyboard events on AT scroll actions. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583725 Reviewed-by: Nektarios Paisios <nektar@chromium.org> Commit-Queue: Jacobo Aragunde Pérez <jaragunde@igalia.com> Cr-Commit-Position: refs/heads/main@{#1017124}
- Loading branch information
Showing
9 changed files
with
212 additions
and
60 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
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/html/action-verbs-expected-auralinux.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
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/html/actions-expected-blink.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
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
79 changes: 79 additions & 0 deletions
79
third_party/blink/web_tests/accessibility/aom-scroll-page-action.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,79 @@ | ||
<!DOCTYPE HTML> | ||
<script src="../resources/gc.js"></script> | ||
<script src="../resources/testharness.js"></script> | ||
<script src="../resources/testharnessreport.js"></script> | ||
|
||
<!-- | ||
Accessibility Object Model - synthesized keyboard events for user action events from Assistive Technology | ||
Explainer: https://github.com/WICG/aom/blob/gh-pages/explainer.md#user-action-events-from-assistive-technology | ||
Spec: https://wicg.github.io/aom/spec/ | ||
--> | ||
<script> | ||
test(function(t) { | ||
assert_true(internals.runtimeFlags.synthesizedKeyboardEventsForAccessibilityActionsEnabled); | ||
}, "Make sure that keyboard event synthesis is enabled"); | ||
</script> | ||
|
||
<input id="text" style="margin-top: 10000px;"> | ||
|
||
<script> | ||
// Traverse ancestors up until reaching web document node, which is the one | ||
// exposing the scroll accessibility actions. | ||
let axDocument = accessibilityController.accessibleElementById("text"); | ||
while (axDocument.role != "AXRole: AXRootWebArea") | ||
axDocument = axDocument.parentElement(); | ||
|
||
promise_test(function(t) { | ||
let oldY; | ||
return new Promise(resolve => { | ||
window.addEventListener('keydown', resolve); | ||
oldY = window.pageYOffset; | ||
axDocument.scrollDown(); | ||
}).then(event => { | ||
assert_equals(event.type, "keydown"); | ||
assert_equals(event.keyCode, 34); // 34 = page down key | ||
assert_true(window.pageYOffset > oldY); | ||
}); | ||
}, "Test for synthesized keydown event in scroll down action"); | ||
|
||
promise_test(function(t) { | ||
let oldY; | ||
return new Promise(resolve => { | ||
window.addEventListener('keyup', resolve); | ||
oldY = window.pageYOffset; | ||
axDocument.scrollDown(); | ||
}).then(event => { | ||
assert_equals(event.type, "keyup"); | ||
assert_equals(event.keyCode, 34); // 34 = page down key | ||
assert_true(window.pageYOffset > oldY); | ||
}); | ||
}, "Test for synthesized keyup event in scroll down action"); | ||
|
||
promise_test(function(t) { | ||
let oldY; | ||
return new Promise(resolve => { | ||
window.addEventListener('keydown', resolve); | ||
oldY = window.pageYOffset; | ||
axDocument.scrollUp(); | ||
}).then(event => { | ||
assert_equals(event.type, "keydown"); | ||
assert_equals(event.keyCode, 33); // 33 = page up key | ||
assert_true(window.pageYOffset < oldY); | ||
}); | ||
}, "Test for synthesized keydown event in scroll up action"); | ||
|
||
promise_test(function(t) { | ||
let oldY; | ||
return new Promise(resolve => { | ||
window.addEventListener('keyup', resolve); | ||
oldY = window.pageYOffset; | ||
axDocument.scrollUp(); | ||
}).then(event => { | ||
assert_equals(event.type, "keyup"); | ||
assert_equals(event.keyCode, 33); // 33 = page up key | ||
assert_true(window.pageYOffset < oldY); | ||
}); | ||
}, "Test for synthesized keyup event in scroll up action"); | ||
</script> |
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