OLD | NEW |
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 predicates for the automation extension API. | 6 * @fileoverview ChromeVox predicates for the automation extension API. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('AutomationPredicate'); | 9 goog.provide('AutomationPredicate'); |
10 goog.provide('AutomationPredicate.Binary'); | 10 goog.provide('AutomationPredicate.Binary'); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 * @param {chrome.automation.AutomationNode} second | 76 * @param {chrome.automation.AutomationNode} second |
77 * @return {boolean} | 77 * @return {boolean} |
78 */ | 78 */ |
79 AutomationPredicate.linebreak = function(first, second) { | 79 AutomationPredicate.linebreak = function(first, second) { |
80 // TODO(dtseng): Use next/previousOnLin once available. | 80 // TODO(dtseng): Use next/previousOnLin once available. |
81 var fl = first.location; | 81 var fl = first.location; |
82 var sl = second.location; | 82 var sl = second.location; |
83 return fl.top != sl.top || | 83 return fl.top != sl.top || |
84 (fl.top + fl.height != sl.top + sl.height); | 84 (fl.top + fl.height != sl.top + sl.height); |
85 }; | 85 }; |
| 86 |
| 87 /** |
| 88 * Leaf nodes that should be ignored. |
| 89 * @param {chrome.automation.AutomationNode} node |
| 90 * @return {boolean} |
| 91 */ |
| 92 AutomationPredicate.shouldIgnoreLeaf = function(node) { |
| 93 return AutomationPredicate.leaf(node) && |
| 94 node.role == chrome.automation.RoleType.client; |
| 95 }; |
OLD | NEW |