OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Accessibility.AccessibilityNode = class { | 7 Accessibility.AccessibilityNode = class { |
8 /** | 8 /** |
9 * @param {!Accessibility.AccessibilityModel} accessibilityModel | 9 * @param {!Accessibility.AccessibilityModel} accessibilityModel |
10 * @param {!Protocol.Accessibility.AXNode} payload | 10 * @param {!Protocol.Accessibility.AXNode} payload |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (!this.deferredDOMNode()) | 149 if (!this.deferredDOMNode()) |
150 return; | 150 return; |
151 | 151 |
152 // Highlight node in page. | 152 // Highlight node in page. |
153 this.deferredDOMNode().highlight(); | 153 this.deferredDOMNode().highlight(); |
154 | 154 |
155 // Highlight node in Elements tree. | 155 // Highlight node in Elements tree. |
156 this.deferredDOMNode().resolvePromise().then(node => { | 156 this.deferredDOMNode().resolvePromise().then(node => { |
157 if (!node) | 157 if (!node) |
158 return; | 158 return; |
159 node.domModel().overlayModel().nodeHighlightRequested(node.id); | 159 node.domModel().nodeHighlightRequested(node.id); |
160 }); | 160 }); |
161 } | 161 } |
162 | 162 |
163 /** | 163 /** |
164 * @return {!Array<!Accessibility.AccessibilityNode>} | 164 * @return {!Array<!Accessibility.AccessibilityNode>} |
165 */ | 165 */ |
166 children() { | 166 children() { |
167 var children = []; | 167 var children = []; |
168 if (!this._childIds) | 168 if (!this._childIds) |
169 return children; | 169 return children; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 */ | 310 */ |
311 logTree(inspectedNode) { | 311 logTree(inspectedNode) { |
312 var rootNode = inspectedNode; | 312 var rootNode = inspectedNode; |
313 while (rootNode.parentNode()) | 313 while (rootNode.parentNode()) |
314 rootNode = rootNode.parentNode(); | 314 rootNode = rootNode.parentNode(); |
315 console.log(rootNode.printSelfAndChildren(inspectedNode)); // eslint-disabl
e-line no-console | 315 console.log(rootNode.printSelfAndChildren(inspectedNode)); // eslint-disabl
e-line no-console |
316 } | 316 } |
317 }; | 317 }; |
318 | 318 |
319 SDK.SDKModel.register(Accessibility.AccessibilityModel, SDK.Target.Capability.DO
M, false); | 319 SDK.SDKModel.register(Accessibility.AccessibilityModel, SDK.Target.Capability.DO
M, false); |
OLD | NEW |