Commit 81fc4921 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Fix scroll actions

- correct message string id (i.e. + '_description')
- walk up to the first scrollable ancestor (based on the availability of the scrolling action).

Test: 1. open Learn Mode. Perform three finger swipe up/down. Verify scroll back/forward output.
2. Scroll within an Android app. Verify content changes appropriately.

Change-Id: I4da02e1f09eb38dc2a61e5141b4ef67e57139b46
Reviewed-on: https://chromium-review.googlesource.com/1114200Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570326}
parent e8019fb4
......@@ -814,8 +814,8 @@ cvox.CommandStore.CMD_WHITELIST = {
{announce: false, msgId: 'pause_all_media', category: 'information'},
// Scrolling actions.
'scrollBackward': {msgId: 'action_scroll_backward'},
'scrollForward': {msgId: 'action_scroll_forward'},
'scrollBackward': {msgId: 'action_scroll_backward_description'},
'scrollForward': {msgId: 'action_scroll_forward_description'},
// Math specific commands.
'toggleSemantics':
......
......@@ -722,10 +722,24 @@ CommandHandler.onCommand = function(command) {
current = cursors.Range.fromNode(end);
break;
case 'scrollBackward':
current.start.node.scrollBackward();
var node = current.start.node;
while (node &&
!node.standardActions.includes(
chrome.automation.ActionType.SCROLL_BACKWARD))
node = node.parent;
if (node)
node.scrollBackward();
break;
case 'scrollForward':
current.start.node.scrollForward();
var node = current.start.node;
while (node &&
!node.standardActions.includes(
chrome.automation.ActionType.SCROLL_FORWARD))
node = node.parent;
if (node)
node.scrollForward();
break;
default:
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment