Web Inspector: REGRESSION: clicking a selected call frame doesn't re-scroll
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2019 23:32:46 +0000 (23:32 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2019 23:32:46 +0000 (23:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194169
<rdar://problem/47743864>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._handleMouseDown):
Add a special case for a single-selection TreeOutline with
allowsRepeatSelection enabled. Since the element is already
selected, bypass the SelectionCongroller and dispatch an
event with event.data.selectedByUser set to true.

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

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

index d999e2b..90a3bf9 100644 (file)
@@ -1,3 +1,18 @@
+2019-02-04  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: REGRESSION: clicking a selected call frame doesn't re-scroll
+        https://bugs.webkit.org/show_bug.cgi?id=194169
+        <rdar://problem/47743864>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline.prototype._handleMouseDown):
+        Add a special case for a single-selection TreeOutline with
+        allowsRepeatSelection enabled. Since the element is already
+        selected, bypass the SelectionCongroller and dispatch an
+        event with event.data.selectedByUser set to true.
+
 2019-02-04  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: Styles: fix race conditions when editing
index 3f78cd5..f783acd 100644 (file)
@@ -1015,6 +1015,14 @@ WI.TreeOutline = class TreeOutline extends WI.Object
         if (!treeElement.canSelectOnMouseDown(event))
             return;
 
+        if (this.allowsRepeatSelection && treeElement.selected && this._selectionController.selectedItems.size === 1) {
+            // Special case for dispatching a selection event for an already selected
+            // item in single-selection mode.
+            this._itemWasSelectedByUser = true;
+            this._dispatchSelectionDidChangeEvent();
+            return;
+        }
+
         let index = this._indexOfTreeElement(treeElement);
         if (isNaN(index))
             return;