Commit 2fea7ca8 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Begin syncing the braille selection for an active descendant

Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I09802d7786ef583c37a33489516eea2200a5d7c1
Reviewed-on: https://chromium-review.googlesource.com/1112584
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570147}
parent 93065b08
......@@ -192,6 +192,7 @@ AutomationPredicate.leaf = function(node) {
!hasActionableDescendant(node)) ||
(!!node.descriptionFor && node.descriptionFor.length > 0 &&
!hasActionableDescendant(node)) ||
(node.activeDescendantFor && node.activeDescendantFor.length > 0) ||
(node.role == Role.MENU_ITEM && !hasActionableDescendant(node)) ||
node.state[State.INVISIBLE] || node.children.every(function(n) {
return n.state[State.INVISIBLE];
......
......@@ -1165,6 +1165,13 @@ Output.prototype = {
var earcon = node ? this.findEarcon_(node, opt_prevNode) : null;
if (earcon)
options.annotation.push(earcon);
// Place the selection on the first character of the name if the node
// is the active descendant. This ensures the braille window is panned
// appropriately.
if (node.activeDescendantFor && node.activeDescendantFor.length > 0)
options.annotation.push(new Output.SelectionSpan(0, 0));
this.append_(buff, node.name || '', options);
} else if (token == 'description') {
if (node.name == node.description)
......
......@@ -571,6 +571,9 @@
// applicable
AutomationNode? activeDescendant;
// Reverse relationship for active descendant.
AutomationNode[]? activeDescendantFor;
// The target of an in-page link.
AutomationNode? inPageLinkTarget;
......
......@@ -961,7 +961,7 @@ var intAttributes = [
// Int attribute, relation property to expose, reverse relation to expose.
var nodeRefAttributes = [
['activedescendantId', 'activeDescendant', null],
['activedescendantId', 'activeDescendant', 'activeDescendantFor'],
['detailsId', 'details', 'detailsFor'],
['errorMessageId', 'errorMessage', 'errorMessageFor'],
['inPageLinkTargetId', 'inPageLinkTarget', null],
......
......@@ -651,6 +651,13 @@ chrome.automation.AutomationNode.prototype.labelledBy;
*/
chrome.automation.AutomationNode.prototype.activeDescendant;
/**
* Reverse relationship for active descendant.
* @type {(!Array<!chrome.automation.AutomationNode>|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-activeDescendantFor
*/
chrome.automation.AutomationNode.prototype.activeDescendantFor;
/**
* The target of an in-page link.
* @type {(!chrome.automation.AutomationNode|undefined)}
......
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