| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 AutomationPredicate.makeRolePredicate( | 50 AutomationPredicate.makeRolePredicate( |
| 51 chrome.automation.RoleType.link); | 51 chrome.automation.RoleType.link); |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * @param {chrome.automation.AutomationNode} node | 54 * @param {chrome.automation.AutomationNode} node |
| 55 * @return {boolean} | 55 * @return {boolean} |
| 56 */ | 56 */ |
| 57 AutomationPredicate.leaf = function(node) { | 57 AutomationPredicate.leaf = function(node) { |
| 58 return !node.firstChild || | 58 return !node.firstChild || |
| 59 node.role == chrome.automation.RoleType.button || | 59 node.role == chrome.automation.RoleType.button || |
| 60 node.role == chrome.automation.RoleType.slider || |
| 60 node.children.every(function(n) { | 61 node.children.every(function(n) { |
| 61 return n.state.invisible; | 62 return n.state.invisible; |
| 62 }); | 63 }); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 /** | 66 /** |
| 66 * @param {chrome.automation.AutomationNode} node | 67 * @param {chrome.automation.AutomationNode} node |
| 67 * @return {boolean} | 68 * @return {boolean} |
| 68 */ | 69 */ |
| 69 AutomationPredicate.leafWithText = function(node) { | 70 AutomationPredicate.leafWithText = function(node) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 86 | 87 |
| 87 /** | 88 /** |
| 88 * Leaf nodes that should be ignored. | 89 * Leaf nodes that should be ignored. |
| 89 * @param {chrome.automation.AutomationNode} node | 90 * @param {chrome.automation.AutomationNode} node |
| 90 * @return {boolean} | 91 * @return {boolean} |
| 91 */ | 92 */ |
| 92 AutomationPredicate.shouldIgnoreLeaf = function(node) { | 93 AutomationPredicate.shouldIgnoreLeaf = function(node) { |
| 93 return AutomationPredicate.leaf(node) && | 94 return AutomationPredicate.leaf(node) && |
| 94 node.role == chrome.automation.RoleType.client; | 95 node.role == chrome.automation.RoleType.client; |
| 95 }; | 96 }; |
| OLD | NEW |