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.ThrottledView} | 7 * @extends {WebInspector.ThrottledView} |
| 8 */ | 8 */ |
| 9 WebInspector.AccessibilitySidebarView = function() | 9 WebInspector.AccessibilitySidebarView = function() |
| 10 { | 10 { |
| 11 WebInspector.ThrottledView.call(this, WebInspector.UIString("Accessibility") ); | 11 WebInspector.ThrottledView.call(this, WebInspector.UIString("Accessibility") ); |
| 12 this._axNodeSubPane = null; | 12 this._axNodeSubPane = null; |
| 13 this._ariaSubPane = null; | |
| 13 this._node = null; | 14 this._node = null; |
| 14 this._sidebarPaneStack = null; | 15 this._sidebarPaneStack = null; |
| 15 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._pul lNode, this); | 16 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._pul lNode, this); |
| 16 this._pullNode(); | 17 this._pullNode(); |
| 17 } | 18 } |
| 18 | 19 |
| 19 WebInspector.AccessibilitySidebarView.prototype = { | 20 WebInspector.AccessibilitySidebarView.prototype = { |
| 20 /** | 21 /** |
| 21 * @return {?WebInspector.DOMNode} | 22 * @return {?WebInspector.DOMNode} |
| 22 */ | 23 */ |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 33 doUpdate: function() | 34 doUpdate: function() |
| 34 { | 35 { |
| 35 /** | 36 /** |
| 36 * @param {?AccessibilityAgent.AXNode} accessibilityNode | 37 * @param {?AccessibilityAgent.AXNode} accessibilityNode |
| 37 * @this {WebInspector.AccessibilitySidebarView} | 38 * @this {WebInspector.AccessibilitySidebarView} |
| 38 */ | 39 */ |
| 39 function accessibilityNodeCallback(accessibilityNode) | 40 function accessibilityNodeCallback(accessibilityNode) |
| 40 { | 41 { |
| 41 if (this._axNodeSubPane) | 42 if (this._axNodeSubPane) |
| 42 this._axNodeSubPane.setAXNode(accessibilityNode); | 43 this._axNodeSubPane.setAXNode(accessibilityNode); |
| 44 this._accessibilityNodeUpdatedForTest(); | |
| 43 } | 45 } |
| 44 var node = this.node(); | 46 var node = this.node(); |
| 45 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo de(node.id) | 47 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo de(node.id) |
| 46 .then(accessibilityNodeCallback.bind(this)) | 48 .then(accessibilityNodeCallback.bind(this)) |
| 47 }, | 49 }, |
| 48 | 50 |
| 51 _accessibilityNodeUpdatedForTest: function() | |
| 52 { | |
| 53 // For sniffing in tests. | |
| 54 }, | |
| 55 | |
| 49 /** | 56 /** |
| 50 * @override | 57 * @override |
| 51 */ | 58 */ |
| 52 wasShown: function() | 59 wasShown: function() |
| 53 { | 60 { |
| 54 WebInspector.ThrottledView.prototype.wasShown.call(this); | 61 WebInspector.ThrottledView.prototype.wasShown.call(this); |
| 55 | 62 |
| 56 if (!this._sidebarPaneStack) { | 63 if (!this._sidebarPaneStack) { |
| 57 this._axNodeSubPane = new WebInspector.AXNodeSubPane(); | 64 this._axNodeSubPane = new WebInspector.AXNodeSubPane(); |
| 58 this._axNodeSubPane.setNode(this.node()); | 65 this._axNodeSubPane.setNode(this.node()); |
| 59 this._axNodeSubPane.show(this.element); | 66 this._axNodeSubPane.show(this.element); |
| 67 this._axNodeSubPane.requestReveal(); | |
| 68 | |
| 69 this._ariaSubPane = new WebInspector.ARIAAttributesPane(); | |
| 70 this._ariaSubPane.setNode(this.node()); | |
| 71 this._ariaSubPane.show(this.element); | |
|
dgozman
2016/07/25 17:39:38
We don't have to show pane here, as we add it to t
aboxhall
2016/07/25 19:49:20
Done.
| |
| 72 this._ariaSubPane.requestReveal(); | |
|
dgozman
2016/07/25 17:39:38
requestReveal should be called after adding the to
aboxhall
2016/07/25 19:49:20
Done.
| |
| 60 | 73 |
| 61 this._sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 74 this._sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
| 62 this._sidebarPaneStack.element.classList.add("flex-auto"); | 75 this._sidebarPaneStack.element.classList.add("flex-auto"); |
| 63 this._sidebarPaneStack.show(this.element); | 76 this._sidebarPaneStack.show(this.element); |
| 77 this._sidebarPaneStack.addPane(this._ariaSubPane); | |
| 64 this._sidebarPaneStack.addPane(this._axNodeSubPane); | 78 this._sidebarPaneStack.addPane(this._axNodeSubPane); |
| 65 } | 79 } |
| 66 | 80 |
| 67 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.AttrModified, this._onAttrChange, this); | 81 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.AttrModified, this._onAttrChange, this); |
| 68 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); | 82 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); |
| 69 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); | 83 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); |
| 70 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); | 84 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn spector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); |
| 71 }, | 85 }, |
| 72 | 86 |
| 73 /** | 87 /** |
| 74 * @override | 88 * @override |
| 75 */ | 89 */ |
| 76 willHide: function() | 90 willHide: function() |
| 77 { | 91 { |
| 78 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.AttrModified, this._onAttrChange, this); | 92 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.AttrModified, this._onAttrChange, this); |
| 79 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); | 93 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); |
| 80 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); | 94 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); |
| 81 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); | 95 WebInspector.targetManager.removeModelListener(WebInspector.DOMModel, We bInspector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); |
| 82 }, | 96 }, |
| 83 | 97 |
| 84 _pullNode: function() | 98 _pullNode: function() |
| 85 { | 99 { |
| 86 this._node = WebInspector.context.flavor(WebInspector.DOMNode); | 100 this._node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 87 if (this._axNodeSubPane) | 101 if (this._axNodeSubPane) |
| 88 this._axNodeSubPane.setNode(this._node); | 102 this._axNodeSubPane.setNode(this._node); |
| 103 if (this._ariaSubPane) | |
| 104 this._ariaSubPane.setNode(this._node); | |
| 89 this.update(); | 105 this.update(); |
| 90 }, | 106 }, |
| 91 | 107 |
| 92 /** | 108 /** |
| 93 * @param {!WebInspector.Event} event | 109 * @param {!WebInspector.Event} event |
| 94 */ | 110 */ |
| 95 _onAttrChange: function(event) | 111 _onAttrChange: function(event) |
| 96 { | 112 { |
| 97 if (!this.node()) | 113 if (!this.node()) |
| 98 return; | 114 return; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); | 195 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); |
| 180 treeOutline.registerRequiredCSS("components/objectValue.css"); | 196 treeOutline.registerRequiredCSS("components/objectValue.css"); |
| 181 | 197 |
| 182 treeOutline.element.classList.add("hidden"); | 198 treeOutline.element.classList.add("hidden"); |
| 183 this.element.appendChild(treeOutline.element); | 199 this.element.appendChild(treeOutline.element); |
| 184 return treeOutline; | 200 return treeOutline; |
| 185 }, | 201 }, |
| 186 | 202 |
| 187 __proto__: WebInspector.View.prototype | 203 __proto__: WebInspector.View.prototype |
| 188 } | 204 } |
| OLD | NEW |