Commit 081b9b76 authored by David Tseng's avatar David Tseng Committed by Commit Bot

ARC a11y: static text nodes can be clickable

Test: in Skype, click the 'next button' text view. Verify screen transitions appropriately.
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ic3fcfa4c29091e16674a08b2707c0ec867e01b1a
Reviewed-on: https://chromium-review.googlesource.com/938566
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarYuki Awano <yawano@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539745}
parent 64c6e290
...@@ -479,6 +479,15 @@ CommandHandler.onCommand = function(command) { ...@@ -479,6 +479,15 @@ CommandHandler.onCommand = function(command) {
case 'forceClickOnCurrentItem': case 'forceClickOnCurrentItem':
if (ChromeVoxState.instance.currentRange) { if (ChromeVoxState.instance.currentRange) {
var actionNode = ChromeVoxState.instance.currentRange.start.node; var actionNode = ChromeVoxState.instance.currentRange.start.node;
// Scan for a clickable, which overrides the |actionNode|.
var clickable = actionNode;
while (clickable && !clickable.clickable)
clickable = clickable.parent;
if (clickable) {
clickable.doDefault();
return false;
}
while (actionNode.role == RoleType.INLINE_TEXT_BOX || while (actionNode.role == RoleType.INLINE_TEXT_BOX ||
actionNode.role == RoleType.STATIC_TEXT) actionNode.role == RoleType.STATIC_TEXT)
actionNode = actionNode.parent; actionNode = actionNode.parent;
...@@ -486,11 +495,7 @@ CommandHandler.onCommand = function(command) { ...@@ -486,11 +495,7 @@ CommandHandler.onCommand = function(command) {
ChromeVoxState.instance.navigateToRange( ChromeVoxState.instance.navigateToRange(
cursors.Range.fromNode(actionNode.inPageLinkTarget)); cursors.Range.fromNode(actionNode.inPageLinkTarget));
} else { } else {
// Scan for a clickable, which overrides the |actionNode|. actionNode.doDefault();
var clickable = actionNode;
while (clickable && !clickable.clickable)
clickable = clickable.parent;
clickable ? clickable.doDefault() : actionNode.doDefault();
} }
} }
// Skip all other processing; if focus changes, we should get an event // Skip all other processing; if focus changes, we should get an event
......
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