Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js |
| index cd80be00fa12244b1725e54004a570e47b786ed1..92c7bc9cb64bc4b1b1f9e3d024bd87486dfb01b6 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js |
| @@ -11,6 +11,8 @@ WebInspector.AccessibilitySidebarView = function() |
| WebInspector.ThrottledWidget.call(this); |
| this._node = null; |
| this._sidebarPaneStack = WebInspector.viewManager.createStackLocation(); |
| + this._treeSubPane = new WebInspector.AXTreePane(); |
| + this._sidebarPaneStack.showView(this._treeSubPane); |
| this._ariaSubPane = new WebInspector.ARIAAttributesPane(); |
| this._sidebarPaneStack.showView(this._ariaSubPane); |
| this._axNodeSubPane = new WebInspector.AXNodeSubPane(); |
| @@ -30,25 +32,39 @@ WebInspector.AccessibilitySidebarView.prototype = { |
| }, |
| /** |
| + * @param {?Array<!AccessibilityAgent.AXNode>} nodes |
| + */ |
| + accessibilityNodeCallback: function(nodes) |
| + { |
| + if (!nodes) |
| + return; |
| + |
| + var currentAXNode = nodes[0]; |
| + if (currentAXNode.ignored) |
| + this._ariaSubPane.parentWidget().contentElement.classList.add("sidebar-hidden-override" |
| +); |
|
dgozman
2016/09/15 17:45:44
strange formatting
aboxhall
2016/09/15 20:30:08
Editors are fun
|
| + else |
| + this._ariaSubPane.parentWidget().contentElement.classList.remove("sidebar-hidden-override"); |
|
dgozman
2016/09/15 17:45:44
Let's instead call showView()/removeView() on the
aboxhall
2016/09/15 20:30:08
Won't that change the order?
dgozman
2016/09/17 00:36:23
There is a second parameter |insertBefore|.
aboxhall
2016/09/17 01:12:34
As discussed, will follow up as this is non-trivia
|
| + |
| + if (this._axNodeSubPane) |
| + this._axNodeSubPane.setAXNode(currentAXNode); |
| + if (this._treeSubPane) |
| + this._treeSubPane.setAXNodeAndAncestors(nodes); |
| + }, |
| + |
| + /** |
| * @override |
| * @protected |
| * @return {!Promise.<?>} |
| */ |
| doUpdate: function() |
| { |
| - /** |
| - * @param {?AccessibilityAgent.AXNode} accessibilityNode |
| - * @this {WebInspector.AccessibilitySidebarView} |
| - */ |
| - function accessibilityNodeCallback(accessibilityNode) |
| - { |
| - if (this._axNodeSubPane) |
| - this._axNodeSubPane.setAXNode(accessibilityNode); |
| - } |
| var node = this.node(); |
| + this._treeSubPane.setNode(node); |
| + this._axNodeSubPane.setNode(node); |
| this._ariaSubPane.setNode(node); |
| - return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNode(node.id) |
| - .then(accessibilityNodeCallback.bind(this)); |
| + return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNodeForDOMNode(node.id) |
| + .then((nodes) => { this.accessibilityNodeCallback(nodes); }); |
| }, |
| /** |
| @@ -58,6 +74,7 @@ WebInspector.AccessibilitySidebarView.prototype = { |
| { |
| WebInspector.ThrottledWidget.prototype.wasShown.call(this); |
| + this._treeSubPane.setNode(this.node()); |
| this._axNodeSubPane.setNode(this.node()); |
| this._ariaSubPane.setNode(this.node()); |