Title: [241055] branches/safari-607-branch/Source/WebInspectorUI
Revision
241055
Author
alanc...@apple.com
Date
2019-02-06 14:16:15 -0800 (Wed, 06 Feb 2019)

Log Message

Cherry-pick r240594. rdar://problem/47774537

    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.

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebInspectorUI/ChangeLog (241054 => 241055)


--- branches/safari-607-branch/Source/WebInspectorUI/ChangeLog	2019-02-06 22:16:12 UTC (rev 241054)
+++ branches/safari-607-branch/Source/WebInspectorUI/ChangeLog	2019-02-06 22:16:15 UTC (rev 241055)
@@ -1,3 +1,42 @@
+2019-02-05  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r240594. rdar://problem/47774537
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-28  Matt Baker  <mattba...@apple.com>
+
+            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  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r240488. rdar://problem/47586897

Modified: branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js (241054 => 241055)


--- branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js	2019-02-06 22:16:12 UTC (rev 241054)
+++ branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js	2019-02-06 22:16:15 UTC (rev 241055)
@@ -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: branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (241054 => 241055)


--- branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2019-02-06 22:16:12 UTC (rev 241054)
+++ branches/safari-607-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2019-02-06 22:16:15 UTC (rev 241055)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to