Title: [258729] trunk/Source/WebInspectorUI
Revision
258729
Author
nvasil...@apple.com
Date
2020-03-19 14:35:47 -0700 (Thu, 19 Mar 2020)

Log Message

Web Inspector: remove redundant code in TreeOutline.prototype.removeChildAtIndex
https://bugs.webkit.org/show_bug.cgi?id=209301

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.removeChildAtIndex):
Check `suppressSelectSibling` once instead of three times.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (258728 => 258729)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-03-19 21:18:56 UTC (rev 258728)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-03-19 21:35:47 UTC (rev 258729)
@@ -1,3 +1,14 @@
+2020-03-19  Nikita Vasilyev  <nvasil...@apple.com>
+
+        Web Inspector: remove redundant code in TreeOutline.prototype.removeChildAtIndex
+        https://bugs.webkit.org/show_bug.cgi?id=209301
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline.prototype.removeChildAtIndex):
+        Check `suppressSelectSibling` once instead of three times.
+
 2020-03-17  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: the width of `WI.TabBarItem` can change if the detached window is resized

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (258728 => 258729)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2020-03-19 21:18:56 UTC (rev 258728)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2020-03-19 21:35:47 UTC (rev 258729)
@@ -360,12 +360,12 @@
         let child = this.children[childIndex];
         let parent = child.parent;
 
-        if (child.deselect(suppressOnDeselect)) {
-            if (child.previousSibling && !suppressSelectSibling)
+        if (child.deselect(suppressOnDeselect) && !suppressSelectSibling) {
+            if (child.previousSibling)
                 child.previousSibling.select(true, false);
-            else if (child.nextSibling && !suppressSelectSibling)
+            else if (child.nextSibling)
                 child.nextSibling.select(true, false);
-            else if (!suppressSelectSibling)
+            else
                 parent.select(true, false);
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to