Commit cf5b729f authored by luoe's avatar luoe Committed by Commit bot

DevTools: cleanup treeoutline expand logic

TreeElement.expand() should not need to check that the element has children and
TreeOutline.insertChild() should not automatically expand a child when it is
inserted. ObjectPropertiesSection.js depended on this logic to automatically
expand the Entries property. This CL updates it so that the Entries property is
added before expanded.

BUG=

Review-Url: https://codereview.chromium.org/2147343002
Cr-Commit-Position: refs/heads/master@{#407061}
parent a18c11e6
......@@ -584,11 +584,9 @@ WebInspector.ObjectPropertyTreeElement.populateWithProperties = function(treeNod
for (var i = 0; i < internalProperties.length; i++) {
internalProperties[i].parentObject = value;
var treeElement = new WebInspector.ObjectPropertyTreeElement(internalProperties[i], linkifier);
if (internalProperties[i].name === "[[Entries]]") {
treeElement.setExpandable(true);
treeElement.expand();
}
treeNode.appendChild(treeElement);
if (internalProperties[i].name === "[[Entries]]")
treeElement.expand();
}
}
WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeNode, emptyPlaceholder);
......
......@@ -524,8 +524,6 @@ TreeElement.prototype = {
this._childrenListNode.insertBefore(child._childrenListNode, nextSibling);
if (child.selected)
child.select();
if (child.expanded)
child.expand();
},
/**
......@@ -883,7 +881,7 @@ TreeElement.prototype = {
expand: function()
{
if (!this._expandable || (this.expanded && this._children))
if (!this._expandable || this.expanded)
return;
// Set this before onpopulate. Since onpopulate can add elements, this makes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment