Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: Source/devtools/front_end/network/XMLView.js

Issue 944343002: DevTools: migrate treeoutline from hasChildren to is/setExpandable(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.View} 7 * @extends {WebInspector.View}
8 * @param {!Document} parsedXML 8 * @param {!Document} parsedXML
9 */ 9 */
10 WebInspector.XMLView = function(parsedXML) 10 WebInspector.XMLView = function(parsedXML)
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 /** 42 /**
43 * @constructor 43 * @constructor
44 * @extends {TreeElement} 44 * @extends {TreeElement}
45 * @param {!Node} node 45 * @param {!Node} node
46 * @param {boolean} closeTag 46 * @param {boolean} closeTag
47 */ 47 */
48 WebInspector.XMLView.Node = function(node, closeTag) 48 WebInspector.XMLView.Node = function(node, closeTag)
49 { 49 {
50 TreeElement.call(this, "", true); 50 TreeElement.call(this, "", !closeTag && !!node.childElementCount);
51 this._node = node; 51 this._node = node;
52 this._closeTag = closeTag; 52 this._closeTag = closeTag;
53 this._populated = false;
54 this.selectable = false; 53 this.selectable = false;
55 this.hasChildren = !closeTag && !!node.childElementCount;
56 this._updateTitle(); 54 this._updateTitle();
57 } 55 }
58 56
59 /** 57 /**
60 * @param {!TreeOutline|!TreeElement} root 58 * @param {!TreeOutline|!TreeElement} root
61 * @param {!Node} xmlNode 59 * @param {!Node} xmlNode
62 */ 60 */
63 WebInspector.XMLView.Node.populate = function(root, xmlNode) 61 WebInspector.XMLView.Node.populate = function(root, xmlNode)
64 { 62 {
65 var node = xmlNode.firstChild; 63 var node = xmlNode.firstChild;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 this._updateTitle(); 154 this._updateTitle();
157 }, 155 },
158 156
159 oncollapse: function() 157 oncollapse: function()
160 { 158 {
161 this._updateTitle(); 159 this._updateTitle();
162 }, 160 },
163 161
164 onpopulate: function() 162 onpopulate: function()
165 { 163 {
166 if (this._populated || this._closeTag)
167 return;
168 WebInspector.XMLView.Node.populate(this, this._node); 164 WebInspector.XMLView.Node.populate(this, this._node);
169 this.appendChild(new WebInspector.XMLView.Node(this._node, true)); 165 this.appendChild(new WebInspector.XMLView.Node(this._node, true));
170 this._populated = true;
171 }, 166 },
172 167
173 __proto__: TreeElement.prototype 168 __proto__: TreeElement.prototype
174 } 169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698