Chromium Code Reviews| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 * @param {number} axTreeID The id of the accessibility tree. | 128 * @param {number} axTreeID The id of the accessibility tree. |
| 129 * @param {number} nodeID The id of a node. | 129 * @param {number} nodeID The id of a node. |
| 130 * @return {?Object} An object with a string key for every state flag set, | 130 * @return {?Object} An object with a string key for every state flag set, |
| 131 * or undefined if the tree or node or node parent wasn't found. | 131 * or undefined if the tree or node or node parent wasn't found. |
| 132 */ | 132 */ |
| 133 var GetState = requireNative('automationInternal').GetState; | 133 var GetState = requireNative('automationInternal').GetState; |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * @param {number} axTreeID The id of the accessibility tree. | 136 * @param {number} axTreeID The id of the accessibility tree. |
| 137 * @param {number} nodeID The id of a node. | 137 * @param {number} nodeID The id of a node. |
| 138 * @return {string} The checked state, as undefined, "true", "false" or "mixed". | |
| 139 */ | |
| 140 var GetChecked = requireNative('automationInternal').GetChecked; | |
| 141 | |
| 142 /** | |
| 143 * @param {number} axTreeID The id of the accessibility tree. | |
| 144 * @param {number} nodeID The id of a node. | |
| 138 * @return {string} The role of the node, or undefined if the tree or | 145 * @return {string} The role of the node, or undefined if the tree or |
| 139 * node wasn't found. | 146 * node wasn't found. |
| 140 */ | 147 */ |
| 141 var GetRole = requireNative('automationInternal').GetRole; | 148 var GetRole = requireNative('automationInternal').GetRole; |
| 142 | 149 |
| 143 /** | 150 /** |
| 144 * @param {number} axTreeID The id of the accessibility tree. | 151 * @param {number} axTreeID The id of the accessibility tree. |
| 145 * @param {number} nodeID The id of a node. | 152 * @param {number} nodeID The id of a node. |
| 146 * @return {?automation.Rect} The location of the node, or undefined if | 153 * @return {?automation.Rect} The location of the node, or undefined if |
| 147 * the tree or node wasn't found. | 154 * the tree or node wasn't found. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 }, | 279 }, |
| 273 | 280 |
| 274 get htmlAttributes() { | 281 get htmlAttributes() { |
| 275 return GetHtmlAttributes(this.treeID, this.id) || {}; | 282 return GetHtmlAttributes(this.treeID, this.id) || {}; |
| 276 }, | 283 }, |
| 277 | 284 |
| 278 get state() { | 285 get state() { |
| 279 return GetState(this.treeID, this.id) || {}; | 286 return GetState(this.treeID, this.id) || {}; |
| 280 }, | 287 }, |
| 281 | 288 |
| 282 get role() { | 289 get role() { |
|
dmazzoni
2017/03/07 17:35:36
You need to implement checked() here, something li
| |
| 283 return GetRole(this.treeID, this.id); | 290 return GetRole(this.treeID, this.id); |
| 284 }, | 291 }, |
| 285 | 292 |
| 286 get location() { | 293 get location() { |
| 287 return GetLocation(this.treeID, this.id); | 294 return GetLocation(this.treeID, this.id); |
| 288 }, | 295 }, |
| 289 | 296 |
| 290 boundsForRange: function(startIndex, endIndex) { | 297 boundsForRange: function(startIndex, endIndex) { |
| 291 return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); | 298 return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); |
| 292 }, | 299 }, |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 689 'liveRelevant', | 696 'liveRelevant', |
| 690 'liveStatus', | 697 'liveStatus', |
| 691 'name', | 698 'name', |
| 692 'placeholder', | 699 'placeholder', |
| 693 'textInputType', | 700 'textInputType', |
| 694 'url', | 701 'url', |
| 695 'value']; | 702 'value']; |
| 696 | 703 |
| 697 var boolAttributes = [ | 704 var boolAttributes = [ |
| 698 'ariaReadonly', | 705 'ariaReadonly', |
| 699 'buttonMixed', | |
| 700 'containerLiveAtomic', | 706 'containerLiveAtomic', |
| 701 'containerLiveBusy', | 707 'containerLiveBusy', |
| 702 'liveAtomic', | 708 'liveAtomic', |
| 703 'liveBusy']; | 709 'liveBusy']; |
| 704 | 710 |
| 705 var intAttributes = [ | 711 var intAttributes = [ |
| 706 'backgroundColor', | 712 'backgroundColor', |
| 707 'color', | 713 'color', |
| 708 'colorValue', | 714 'colorValue', |
| 709 'hierarchicalLevel', | 715 'hierarchicalLevel', |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1094 'boundsForRange', | 1100 'boundsForRange', |
| 1095 ], | 1101 ], |
| 1096 readonly: $Array.concat(publicAttributes, [ | 1102 readonly: $Array.concat(publicAttributes, [ |
| 1097 'parent', | 1103 'parent', |
| 1098 'firstChild', | 1104 'firstChild', |
| 1099 'lastChild', | 1105 'lastChild', |
| 1100 'children', | 1106 'children', |
| 1101 'previousSibling', | 1107 'previousSibling', |
| 1102 'nextSibling', | 1108 'nextSibling', |
| 1103 'isRootNode', | 1109 'isRootNode', |
| 1104 'role', | 1110 'role', |
|
dmazzoni
2017/03/07 17:35:36
You also need to add 'checked' to this list so tha
| |
| 1105 'state', | 1111 'state', |
| 1106 'location', | 1112 'location', |
| 1107 'indexInParent', | 1113 'indexInParent', |
| 1108 'lineStartOffsets', | 1114 'lineStartOffsets', |
| 1109 'root', | 1115 'root', |
| 1110 'htmlAttributes', | 1116 'htmlAttributes', |
| 1111 'nameFrom', | 1117 'nameFrom', |
| 1112 ]), | 1118 ]), |
| 1113 }); | 1119 }); |
| 1114 | 1120 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1139 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1145 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
| 1140 return AutomationRootNodeImpl.getOrCreate(treeID); | 1146 return AutomationRootNodeImpl.getOrCreate(treeID); |
| 1141 }); | 1147 }); |
| 1142 | 1148 |
| 1143 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1149 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
| 1144 AutomationRootNodeImpl.destroy(treeID); | 1150 AutomationRootNodeImpl.destroy(treeID); |
| 1145 }); | 1151 }); |
| 1146 | 1152 |
| 1147 exports.$set('AutomationNode', AutomationNode); | 1153 exports.$set('AutomationNode', AutomationNode); |
| 1148 exports.$set('AutomationRootNode', AutomationRootNode); | 1154 exports.$set('AutomationRootNode', AutomationRootNode); |
| OLD | NEW |