Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js

Issue 1457683009: Complete live region support in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed last feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview ChromeVox utilities for the automation extension API. 6 * @fileoverview ChromeVox utilities for the automation extension API.
7 */ 7 */
8 8
9 goog.provide('AutomationUtil'); 9 goog.provide('AutomationUtil');
10 goog.provide('AutomationUtil.Dir'); 10 goog.provide('AutomationUtil.Dir');
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return true; 269 return true;
270 case RoleType.toolbar: 270 case RoleType.toolbar:
271 return node.root.role == RoleType.desktop; 271 return node.root.role == RoleType.desktop;
272 case RoleType.rootWebArea: 272 case RoleType.rootWebArea:
273 return !!(node.parent && node.parent.root.role == RoleType.desktop); 273 return !!(node.parent && node.parent.root.role == RoleType.desktop);
274 default: 274 default:
275 return false; 275 return false;
276 } 276 }
277 }; 277 };
278 278
279 /**
280 * Determines whether the two given nodes come from the same webpage.
281 * @param {AutomationNode} a
282 * @param {AutomationNode} b
283 * @return {boolean}
284 */
285 AutomationUtil.isInSameWebpage = function(a, b) {
286 if (!a || !b)
287 return false;
288
289 a = a.root;
290 while (a && a.parent && AutomationUtil.isInSameTree(a.parent, a))
291 a = a.parent.root;
292
293 b = b.root;
294 while (b && b.parent && AutomationUtil.isInSameTree(b.parent, b))
295 b = b.parent.root;
296
297 return a == b;
298 };
299
279 }); // goog.scope 300 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698