Commit 5447538a authored by David Tseng's avatar David Tseng Committed by Commit Bot

Filter out output for unknown nodes

During touch exploration, we often hit test to unknown nodes.

Change-Id: I1f627c59045500c98ad5a63f1524a91d66ad2357
Reviewed-on: https://chromium-review.googlesource.com/1162701
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580979}
parent ccf01bdb
......@@ -248,6 +248,14 @@ DesktopAutomationHandler.prototype = {
target, Dir.FORWARD, AutomationPredicate.object) ||
target;
}
while (target && !AutomationPredicate.object(target))
target = target.parent;
if (!target)
return;
if (ChromeVoxState.instance.currentRange &&
target == ChromeVoxState.instance.currentRange.start.node)
return;
......
......@@ -573,6 +573,7 @@ Output.RULES = {
@describe_index($posInSet, $setSize)
@describe_depth($hierarchicalLevel)`
},
unknown: {speak: ``},
window: {
enter: `@describe_window($name)`,
speak: `@describe_window($name) $earcon(OBJECT_OPEN)`
......@@ -1766,10 +1767,16 @@ Output.prototype = {
var parentRole = (Output.ROLE_INFO_[node.role] || {}).inherits;
var parentRoleBlock = eventBlock[parentRole || ''] || {};
var format =
roleBlock.speak || parentRoleBlock.speak || eventBlock['default'].speak;
if (this.formatOptions_.braille)
format = roleBlock.braille || parentRoleBlock.braille || format;
var format = roleBlock.speak !== undefined ?
roleBlock.speak :
parentRoleBlock.speak !== undefined ? parentRoleBlock.speak :
eventBlock['default'].speak;
if (this.formatOptions_.braille) {
format = roleBlock.braille !== undefined ?
roleBlock.braille :
parentRoleBlock.braille !== undefined ? parentRoleBlock.braille :
format;
}
this.format_(node, format, buff, prevNode);
......
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