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 var AutomationEvent = require('automationEvent').AutomationEvent; | 5 var AutomationEvent = require('automationEvent').AutomationEvent; |
6 var automationInternal = | 6 var automationInternal = |
7 require('binding').Binding.create('automationInternal').generate(); | 7 require('binding').Binding.create('automationInternal').generate(); |
8 var exceptionHandler = require('uncaught_exception_handler'); | 8 var exceptionHandler = require('uncaught_exception_handler'); |
9 var IsInteractPermitted = | 9 var IsInteractPermitted = |
10 requireNative('automationInternal').IsInteractPermitted; | 10 requireNative('automationInternal').IsInteractPermitted; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 * @param {number} axTreeID The id of the accessibility tree. | 117 * @param {number} axTreeID The id of the accessibility tree. |
118 * @param {number} nodeID The id of a node. | 118 * @param {number} nodeID The id of a node. |
119 * @return {?automation.Rect} The location of the node, or undefined if | 119 * @return {?automation.Rect} The location of the node, or undefined if |
120 * the tree or node wasn't found. | 120 * the tree or node wasn't found. |
121 */ | 121 */ |
122 var GetLocation = requireNative('automationInternal').GetLocation; | 122 var GetLocation = requireNative('automationInternal').GetLocation; |
123 | 123 |
124 /** | 124 /** |
125 * @param {number} axTreeID The id of the accessibility tree. | 125 * @param {number} axTreeID The id of the accessibility tree. |
126 * @param {number} nodeID The id of a node. | 126 * @param {number} nodeID The id of a node. |
| 127 * @param {number} startIndex The start index of the range. |
| 128 * @param {number} endIndex The end index of the range. |
| 129 * @return {?automation.Rect} The bounding box of the subrange of this node, |
| 130 * or the location if there are no subranges, or undefined if |
| 131 * the tree or node wasn't found. |
| 132 */ |
| 133 var GetBoundsForRange = requireNative('automationInternal').GetBoundsForRange; |
| 134 |
| 135 /** |
| 136 * @param {number} axTreeID The id of the accessibility tree. |
| 137 * @param {number} nodeID The id of a node. |
127 * @param {string} attr The name of a string attribute. | 138 * @param {string} attr The name of a string attribute. |
128 * @return {?string} The value of this attribute, or undefined if the tree, | 139 * @return {?string} The value of this attribute, or undefined if the tree, |
129 * node, or attribute wasn't found. | 140 * node, or attribute wasn't found. |
130 */ | 141 */ |
131 var GetStringAttribute = requireNative('automationInternal').GetStringAttribute; | 142 var GetStringAttribute = requireNative('automationInternal').GetStringAttribute; |
132 | 143 |
133 /** | 144 /** |
134 * @param {number} axTreeID The id of the accessibility tree. | 145 * @param {number} axTreeID The id of the accessibility tree. |
135 * @param {number} nodeID The id of a node. | 146 * @param {number} nodeID The id of a node. |
136 * @param {string} attr The name of an attribute. | 147 * @param {string} attr The name of an attribute. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 }, | 226 }, |
216 | 227 |
217 get role() { | 228 get role() { |
218 return GetRole(this.treeID, this.id); | 229 return GetRole(this.treeID, this.id); |
219 }, | 230 }, |
220 | 231 |
221 get location() { | 232 get location() { |
222 return GetLocation(this.treeID, this.id); | 233 return GetLocation(this.treeID, this.id); |
223 }, | 234 }, |
224 | 235 |
| 236 boundsForRange: function(startIndex, endIndex) { |
| 237 return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); |
| 238 }, |
| 239 |
225 get indexInParent() { | 240 get indexInParent() { |
226 return GetIndexInParent(this.treeID, this.id); | 241 return GetIndexInParent(this.treeID, this.id); |
227 }, | 242 }, |
228 | 243 |
229 get childTree() { | 244 get childTree() { |
230 var childTreeID = GetIntAttribute(this.treeID, this.id, 'childTreeId'); | 245 var childTreeID = GetIntAttribute(this.treeID, this.id, 'childTreeId'); |
231 if (childTreeID) | 246 if (childTreeID) |
232 return AutomationRootNodeImpl.get(childTreeID); | 247 return AutomationRootNodeImpl.get(childTreeID); |
233 }, | 248 }, |
234 | 249 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 'find', | 943 'find', |
929 'findAll', | 944 'findAll', |
930 'focus', | 945 'focus', |
931 'makeVisible', | 946 'makeVisible', |
932 'matches', | 947 'matches', |
933 'setSelection', | 948 'setSelection', |
934 'showContextMenu', | 949 'showContextMenu', |
935 'addEventListener', | 950 'addEventListener', |
936 'removeEventListener', | 951 'removeEventListener', |
937 'domQuerySelector', | 952 'domQuerySelector', |
938 'toString' ], | 953 'toString', |
| 954 'boundsForRange'], |
939 readonly: publicAttributes.concat( | 955 readonly: publicAttributes.concat( |
940 ['parent', | 956 ['parent', |
941 'firstChild', | 957 'firstChild', |
942 'lastChild', | 958 'lastChild', |
943 'children', | 959 'children', |
944 'previousSibling', | 960 'previousSibling', |
945 'nextSibling', | 961 'nextSibling', |
946 'isRootNode', | 962 'isRootNode', |
947 'role', | 963 'role', |
948 'state', | 964 'state', |
(...skipping 20 matching lines...) Expand all Loading... |
969 AutomationRootNode.getOrCreate = function(treeID) { | 985 AutomationRootNode.getOrCreate = function(treeID) { |
970 return AutomationRootNodeImpl.getOrCreate(treeID); | 986 return AutomationRootNodeImpl.getOrCreate(treeID); |
971 } | 987 } |
972 | 988 |
973 AutomationRootNode.destroy = function(treeID) { | 989 AutomationRootNode.destroy = function(treeID) { |
974 AutomationRootNodeImpl.destroy(treeID); | 990 AutomationRootNodeImpl.destroy(treeID); |
975 } | 991 } |
976 | 992 |
977 exports.AutomationNode = AutomationNode; | 993 exports.AutomationNode = AutomationNode; |
978 exports.AutomationRootNode = AutomationRootNode; | 994 exports.AutomationRootNode = AutomationRootNode; |
OLD | NEW |