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

Unified Diff: Source/devtools/front_end/elements/ElementsTreeOutline.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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/ElementsTreeOutline.js
diff --git a/Source/devtools/front_end/elements/ElementsTreeOutline.js b/Source/devtools/front_end/elements/ElementsTreeOutline.js
index 627bf5fb610ddf816cf1a227ef6013d8bebec106..457712c29e2a6e757ae59941ddbf04784452ceb6 100644
--- a/Source/devtools/front_end/elements/ElementsTreeOutline.js
+++ b/Source/devtools/front_end/elements/ElementsTreeOutline.js
@@ -1417,7 +1417,7 @@ WebInspector.ElementsTreeOutline.prototype = {
*/
populateTreeElement: function(treeElement)
{
- if (treeElement.childCount() || !treeElement.hasChildren)
+ if (treeElement.childCount() || !treeElement.isExpandable())
return;
this._updateModifiedParentNode(treeElement.node());
@@ -1710,7 +1710,7 @@ WebInspector.ElementsTreeOutline.prototype = {
{
var childrenDisplayMode = this._calculateChildrenDisplayMode(treeElement);
treeElement.setChildrenDisplayMode(childrenDisplayMode);
- treeElement.setHasChildren(childrenDisplayMode === WebInspector.ElementsTreeElement.ChildrenDisplayMode.HasChildren);
+ treeElement.setExpandable(childrenDisplayMode === WebInspector.ElementsTreeElement.ChildrenDisplayMode.HasChildren);
},
/**
@@ -1757,7 +1757,7 @@ WebInspector.ElementsTreeOutline.prototype = {
*/
updateChildren: function(treeElement)
{
- if (!treeElement.hasChildren) {
+ if (!treeElement.isExpandable()) {
var selectedTreeElement = treeElement.treeOutline.selectedTreeElement;
if (selectedTreeElement && selectedTreeElement.hasAncestor(treeElement))
treeElement.select();
@@ -1886,7 +1886,7 @@ WebInspector.ElementsTreeOutline.prototype = {
}
// Insert close tag.
- if (node.nodeType() === Node.ELEMENT_NODE && treeElement.hasChildren)
+ if (node.nodeType() === Node.ELEMENT_NODE && treeElement.isExpandable())
this.insertChildElement(treeElement, node, treeElement.childCount(), true);
this._treeElementsBeingUpdated.delete(treeElement);
@@ -2168,7 +2168,7 @@ WebInspector.ElementsTreeOutline.Renderer.prototype = {
}
var treeOutline = new WebInspector.ElementsTreeOutline(node.target(), false, false);
treeOutline.rootDOMNode = node;
- if (!treeOutline.firstChild().hasChildren)
+ if (!treeOutline.firstChild().isExpandable())
treeOutline._element.classList.add("single-node");
treeOutline.setVisible(true);
treeOutline.element.treeElementForTest = treeOutline.firstChild();

Powered by Google App Engine
This is Rietveld 408576698