| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
|
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
|
| index 354a58fc962212e71e3381f6fea0096027f73ced..823d85b51229bf8c54ef7cb2c173f59c7ee04434 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
|
| @@ -291,4 +291,23 @@ AutomationUtil.hitTest = function(node, point) {
|
| return null;
|
| };
|
|
|
| +/**
|
| + * Gets a top level root.
|
| + * @param {!AutomationNode} node
|
| + * @return {AutomationNode}
|
| + */
|
| +AutomationUtil.getTopLevelRoot = function(node) {
|
| + var root = node.root;
|
| + if (!root || root.role == RoleType.desktop)
|
| + return null;
|
| +
|
| + while (root &&
|
| + root.parent &&
|
| + root.parent.root &&
|
| + root.parent.root.role != RoleType.desktop) {
|
| + root = root.parent.root;
|
| + }
|
| + return root;
|
| +};
|
| +
|
| }); // goog.scope
|
|
|