Title: [240594] trunk/Source/WebInspectorUI
Revision
240594
Author
[email protected]
Date
2019-01-28 11:53:20 -0800 (Mon, 28 Jan 2019)

Log Message

REGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
https://bugs.webkit.org/show_bug.cgi?id=193808
<rdar://problem/47537734>

Reviewed by Devin Rousso.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.didRemoveItems):

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._indexesForSubtree):
Fix a bug where no IndexSet was returned when passed a TreeElement with
no children. This caused the Timelines tree selection to be corrupted when
entering and exiting edit mode, as TreeElements are inserted and removed.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (240593 => 240594)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-01-28 19:52:17 UTC (rev 240593)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-01-28 19:53:20 UTC (rev 240594)
@@ -1,3 +1,20 @@
+2019-01-28  Matt Baker  <[email protected]>
+
+        REGRESSION(?): Web Inspector: Can have multiple Timelines selected after edit mode
+        https://bugs.webkit.org/show_bug.cgi?id=193808
+        <rdar://problem/47537734>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Controllers/SelectionController.js:
+        (WI.SelectionController.prototype.didRemoveItems):
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline.prototype._indexesForSubtree):
+        Fix a bug where no IndexSet was returned when passed a TreeElement with
+        no children. This caused the Timelines tree selection to be corrupted when
+        entering and exiting edit mode, as TreeElements are inserted and removed.
+
 2019-01-28  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Add Changes panel to Elements tab

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js (240593 => 240594)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js	2019-01-28 19:52:17 UTC (rev 240593)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js	2019-01-28 19:53:20 UTC (rev 240594)
@@ -221,9 +221,12 @@
 
     didRemoveItems(indexes)
     {
+        if (!indexes)
+            return;
+
         console.assert(indexes instanceof WI.IndexSet);
 
-        if (!this._selectedIndexes.size)
+        if (!indexes.size || !this._selectedIndexes.size)
             return;
 
         let firstRemovedIndex = indexes.firstIndex;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (240593 => 240594)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2019-01-28 19:52:17 UTC (rev 240593)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2019-01-28 19:53:20 UTC (rev 240594)
@@ -1082,13 +1082,14 @@
     {
         let treeOutline = treeElement.treeOutline;
         if (!treeOutline)
-            return new WI.IndexSet;
+            return null;
 
         let firstChild = treeElement.children[0];
-        if (!firstChild)
-            return new WI.IndexSet;
+        if (treeElement.root && !firstChild)
+            return null;
 
-        let startIndex = treeOutline._indexOfTreeElement(firstChild);
+        let current = firstChild || treeElement;
+        let startIndex = treeOutline._indexOfTreeElement(current);
         let endIndex = startIndex;
 
         const skipUnrevealed = false;
@@ -1095,14 +1096,9 @@
         const stayWithin = treeElement;
         const dontPopulate = true;
 
-        let current = firstChild;
         while (current = current.traverseNextTreeElement(skipUnrevealed, stayWithin, dontPopulate))
             endIndex++;
 
-        // Include the index of the subtree's root, unless it's the TreeOutline root.
-        if (!treeElement.root)
-            startIndex--;
-
         let count = endIndex - startIndex + 1;
 
         let indexes = new WI.IndexSet;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to