Unreviewed, rolling out r218983.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 21:47:54 +0000 (21:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 21:47:54 +0000 (21:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174042

Broke Debugger Call Stack TreeOutline (Requested by drousso on
#webkit).

Reverted changeset:

"Web Inspector: Remove unnecessary hasChildren from
TreeOutline"
https://bugs.webkit.org/show_bug.cgi?id=173986
http://trac.webkit.org/changeset/218983

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219015 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js

index 2948205..9998959 100644 (file)
@@ -1,3 +1,18 @@
+2017-06-30  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r218983.
+        https://bugs.webkit.org/show_bug.cgi?id=174042
+
+        Broke Debugger Call Stack TreeOutline (Requested by drousso on
+        #webkit).
+
+        Reverted changeset:
+
+        "Web Inspector: Remove unnecessary hasChildren from
+        TreeOutline"
+        https://bugs.webkit.org/show_bug.cgi?id=173986
+        http://trac.webkit.org/changeset/218983
+
 2017-06-30  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Default string comparisons to treat numeric characters as numbers
index 9eb7d6a..bcf1bf4 100644 (file)
@@ -645,7 +645,7 @@ WebInspector.NavigationSidebarPanel = class NavigationSidebarPanel extends WebIn
 
         var visibleTreeElements = [];
         this.contentTreeOutlines.forEach(function(outline) {
-            var currentTreeElement = outline.children.length ? outline.children[0] : null;
+            var currentTreeElement = outline.hasChildren ? outline.children[0] : null;
             while (currentTreeElement) {
                 visibleTreeElements.push(currentTreeElement);
                 currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, false);
index 8a6be4d..9e68275 100644 (file)
@@ -44,6 +44,7 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
         this._treeElementsExpandedState = [];
         this.allowsRepeatSelection = false;
         this.root = true;
+        this.hasChildren = false;
         this.expanded = true;
         this.selected = false;
         this.treeOutline = this;
@@ -155,6 +156,7 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
         var isFirstChild = !this.children.length;
 
         this.children.push(child);
+        this.hasChildren = true;
         child.parent = this;
         child.treeOutline = this.treeOutline;
         child.treeOutline._rememberTreeElement(child);
@@ -204,6 +206,7 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
         var isFirstChild = !this.children.length;
 
         this.children.splice(index, 0, child);
+        this.hasChildren = true;
         child.parent = this;
         child.treeOutline = this.treeOutline;
         child.treeOutline._rememberTreeElement(child);
@@ -264,9 +267,6 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
         child.nextSibling = null;
         child.previousSibling = null;
 
-        if (!this.children.length && this._listItemNode)
-            this._listItemNode.classList.remove("parent");
-
         if (treeOutline)
             treeOutline.dispatchEventToListeners(WebInspector.TreeOutline.Event.ElementRemoved, {element: child});
     }
@@ -283,6 +283,12 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
             return;
 
         this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling);
+
+        if (!this.children.length) {
+            if (this._listItemNode)
+                this._listItemNode.classList.remove("parent");
+            this.hasChildren = false;
+        }
     }
 
     removeChildren(suppressOnDeselect)
@@ -616,7 +622,7 @@ WebInspector.TreeOutline = class TreeOutline extends WebInspector.Object
 
     get selectedTreeElementIndex()
     {
-        if (!this.children.length || !this.selectedTreeElement)
+        if (!this.hasChildren || !this.selectedTreeElement)
             return;
 
         for (var i = 0; i < this.children.length; ++i) {
index 3d40e0d..02a0334 100644 (file)
@@ -68,7 +68,7 @@ WebInspector.VisualStyleCommaSeparatedKeywordEditor = class VisualStyleCommaSepa
 
     get value()
     {
-        if (!this._commaSeparatedKeywords.children.length)
+        if (!this._commaSeparatedKeywords.hasChildren)
             return "";
 
         let value = "";