Web Inspector: REGRESSION: unable to expand/collapse non-selectable WI.TreeOutline
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 00:15:13 +0000 (00:15 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 00:15:13 +0000 (00:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197591

Reviewed by Timothy Hatcher.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.treeElementToggled):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/TreeElement.js

index d2b0bc1..c7b04d0 100644 (file)
@@ -1,5 +1,15 @@
 2019-05-09  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: REGRESSION: unable to expand/collapse non-selectable WI.TreeOutline
+        https://bugs.webkit.org/show_bug.cgi?id=197591
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TreeElement.js:
+        (WI.TreeElement.treeElementToggled):
+
+2019-05-09  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Uncaught Exception: null is not an object (evaluating 'url.startsWith')
         https://bugs.webkit.org/show_bug.cgi?id=196662
         <rdar://problem/49659633>
index adf5904..63c27b8 100644 (file)
@@ -300,14 +300,12 @@ WI.TreeElement = class TreeElement extends WI.Object
     static treeElementToggled(event)
     {
         let element = event.currentTarget;
-        if (!element || !element.treeElement)
+        if (!element)
             return;
 
         let treeElement = element.treeElement;
-        if (!treeElement.treeOutline.selectable) {
-            treeElement.treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementClicked, {treeElement});
+        if (!treeElement)
             return;
-        }
 
         let toggleOnClick = treeElement.toggleOnClick && !treeElement.selectable;
         let isInTriangle = treeElement.isEventWithinDisclosureTriangle(event);
@@ -326,6 +324,9 @@ WI.TreeElement = class TreeElement extends WI.Object
                 treeElement.expand();
         }
         event.stopPropagation();
+
+        if (!treeElement.treeOutline.selectable)
+            treeElement.treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementClicked, {treeElement});
     }
 
     static treeElementDoubleClicked(event)