Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.ThrottledWidget} | 7 * @extends {WebInspector.ThrottledWidget} |
| 8 */ | 8 */ |
| 9 WebInspector.AccessibilitySidebarView = function() | 9 WebInspector.AccessibilitySidebarView = function() |
| 10 { | 10 { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 WebInspector.AccessibilitySidebarView.prototype = { | 26 WebInspector.AccessibilitySidebarView.prototype = { |
| 27 /** | 27 /** |
| 28 * @return {?WebInspector.DOMNode} | 28 * @return {?WebInspector.DOMNode} |
| 29 */ | 29 */ |
| 30 node: function() | 30 node: function() |
| 31 { | 31 { |
| 32 return this._node; | 32 return this._node; |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @param {?Array<!WebInspector.AccessibilityNode>} nodes | 36 * @param {?WebInspector.AccessibilityNode} axNode |
| 37 */ | 37 */ |
| 38 accessibilityNodeCallback: function(nodes) | 38 accessibilityNodeCallback: function(axNode) |
| 39 { | 39 { |
| 40 if (!nodes) | 40 if (!axNode) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 var currentAXNode = nodes[0]; | 43 this._axNode = axNode; |
| 44 if (currentAXNode.ignored) | 44 |
| 45 if (axNode.ignored()) | |
| 45 this._sidebarPaneStack.removeView(this._ariaSubPane); | 46 this._sidebarPaneStack.removeView(this._ariaSubPane); |
| 46 else | 47 else |
| 47 this._sidebarPaneStack.showView(this._ariaSubPane, this._axNodeSubPa ne); | 48 this._sidebarPaneStack.showView(this._ariaSubPane, this._axNodeSubPa ne); |
| 48 | 49 |
| 49 if (this._axNodeSubPane) | 50 if (this._axNodeSubPane) |
| 50 this._axNodeSubPane.setAXNode(currentAXNode); | 51 this._axNodeSubPane.setAXNode(axNode); |
| 51 if (this._treeSubPane) | 52 if (this._treeSubPane) |
| 52 this._treeSubPane.setAXNodeAndAncestors(nodes); | 53 this._treeSubPane.setAXNode(axNode); |
| 53 }, | 54 }, |
| 54 | 55 |
| 55 /** | 56 /** |
| 56 * @override | 57 * @override |
| 57 * @protected | 58 * @protected |
| 58 * @return {!Promise.<?>} | 59 * @return {!Promise.<?>} |
| 59 */ | 60 */ |
| 60 doUpdate: function() | 61 doUpdate: function() |
| 61 { | 62 { |
| 62 var node = this.node(); | 63 var node = this.node(); |
| 63 this._treeSubPane.setNode(node); | 64 this._treeSubPane.setNode(node); |
| 64 this._axNodeSubPane.setNode(node); | 65 this._axNodeSubPane.setNode(node); |
| 65 this._ariaSubPane.setNode(node); | 66 this._ariaSubPane.setNode(node); |
| 66 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo deChain(node) | 67 if (!node) |
| 67 .then((nodes) => { this.accessibilityNodeCallback(nodes); }); | 68 return Promise.resolve(); |
| 69 var accessibilityModel = WebInspector.AccessibilityModel.fromTarget(node .target()); | |
| 70 return accessibilityModel.setDOMNode(node) | |
| 71 .then(accessibilityModel.resolveAllDOMNodes.bind(accessibilityModel) ) | |
|
dgozman
2016/10/31 21:36:30
What's the point of resolving all the nodes right
aboxhall
2016/10/31 22:45:15
You mean send a front-end ID? I think I tried that
| |
| 72 .then(accessibilityModel.getInspectedAXNode.bind(accessibilityModel) ) | |
| 73 .then((axNode) => { this.accessibilityNodeCallback(axNode); }); | |
| 68 }, | 74 }, |
| 69 | 75 |
| 70 /** | 76 /** |
| 71 * @override | 77 * @override |
| 72 */ | 78 */ |
| 73 wasShown: function() | 79 wasShown: function() |
| 74 { | 80 { |
| 75 WebInspector.ThrottledWidget.prototype.wasShown.call(this); | 81 WebInspector.ThrottledWidget.prototype.wasShown.call(this); |
| 76 | 82 |
| 77 this._treeSubPane.setNode(this.node()); | 83 this._treeSubPane.setNode(this.node()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); | 197 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); |
| 192 treeOutline.registerRequiredCSS("components/objectValue.css"); | 198 treeOutline.registerRequiredCSS("components/objectValue.css"); |
| 193 | 199 |
| 194 treeOutline.element.classList.add("hidden"); | 200 treeOutline.element.classList.add("hidden"); |
| 195 this.element.appendChild(treeOutline.element); | 201 this.element.appendChild(treeOutline.element); |
| 196 return treeOutline; | 202 return treeOutline; |
| 197 }, | 203 }, |
| 198 | 204 |
| 199 __proto__: WebInspector.SimpleView.prototype | 205 __proto__: WebInspector.SimpleView.prototype |
| 200 }; | 206 }; |
| OLD | NEW |