Title: [238757] trunk/Source/WebInspectorUI
Revision
238757
Author
[email protected]
Date
2018-11-30 14:40:52 -0800 (Fri, 30 Nov 2018)

Log Message

Web Inspector: REGRESSION(r238599): Multiple Selection: selecting a breakpoint will change the selection to it's parent on the first click
https://bugs.webkit.org/show_bug.cgi?id=192093
<rdar://problem/46318466>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.select):
TreeElement shouldn't manage the TreeOutline's selection barrier.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.get processingSelectionChange):
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
(WI.TreeOutline.prototype.selectTreeElementInternal):
The selection re-entry barrier `processingSelectionChange` should be
managed internally by TreeOutline, and exposed as a read-only property.
Fix a bug where the barrier was cleared before dispatching the change
notification, which can cause re-entry as a side effect.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (238756 => 238757)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-11-30 22:37:22 UTC (rev 238756)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-11-30 22:40:52 UTC (rev 238757)
@@ -1,3 +1,25 @@
+2018-11-30  Matt Baker  <[email protected]>
+
+        Web Inspector: REGRESSION(r238599): Multiple Selection: selecting a breakpoint will change the selection to it's parent on the first click
+        https://bugs.webkit.org/show_bug.cgi?id=192093
+        <rdar://problem/46318466>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/TreeElement.js:
+        (WI.TreeElement.prototype.select):
+        TreeElement shouldn't manage the TreeOutline's selection barrier.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline):
+        (WI.TreeOutline.prototype.get processingSelectionChange):
+        (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
+        (WI.TreeOutline.prototype.selectTreeElementInternal):
+        The selection re-entry barrier `processingSelectionChange` should be
+        managed internally by TreeOutline, and exposed as a read-only property.
+        Fix a bug where the barrier was cleared before dispatching the change
+        notification, which can cause re-entry as a side effect.
+
 2018-11-30  Devin Rousso  <[email protected]>
 
         Web Inspector: Settings: reload button needs horizontal spacing

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js (238756 => 238757)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js	2018-11-30 22:37:22 UTC (rev 238756)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js	2018-11-30 22:40:52 UTC (rev 238757)
@@ -514,8 +514,6 @@
         if (!treeOutline)
             return;
 
-        treeOutline.processingSelectionChange = true;
-
         this.selected = true;
         treeOutline.selectTreeElementInternal(this, suppressOnSelect, selectedByUser);
 
@@ -522,8 +520,6 @@
         if (!suppressOnSelect && this.onselect)
             this.onselect(this, selectedByUser);
 
-        treeOutline.processingSelectionChange = false;
-
         let treeOutlineGroup = WI.TreeOutlineGroup.groupForTreeOutline(treeOutline);
         if (!treeOutlineGroup)
             return;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (238756 => 238757)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2018-11-30 22:37:22 UTC (rev 238756)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2018-11-30 22:40:52 UTC (rev 238757)
@@ -59,7 +59,7 @@
         this._treeElementIndexCache = new Map;
 
         this._itemWasSelectedByUser = false;
-        this._processingSelectionControllerSelectionDidChange = false;
+        this._processingSelectionChange = false;
         this._suppressNextSelectionDidChangeEvent = false;
 
         this._virtualizedVisibleTreeElements = null;
@@ -132,6 +132,8 @@
         return [];
     }
 
+    get processingSelectionChange() { return this._processingSelectionChange; }
+
     get hidden()
     {
         return this._hidden;
@@ -788,7 +790,7 @@
 
     selectionControllerSelectionDidChange(controller, deselectedItems, selectedItems)
     {
-        this._processingSelectionControllerSelectionDidChange = true;
+        this._processingSelectionChange = true;
 
         for (let index of deselectedItems) {
             let treeElement = this._treeElementAtIndex(index);
@@ -810,9 +812,9 @@
             }
         }
 
-        this._processingSelectionControllerSelectionDidChange = false;
+        this._dispatchSelectionDidChangeEvent();
 
-        this._dispatchSelectionDidChangeEvent();
+        this._processingSelectionChange = false;
     }
 
     selectionControllerNextSelectableIndex(controller, index)
@@ -855,7 +857,7 @@
 
     selectTreeElementInternal(treeElement, suppressNotification = false, selectedByUser = false)
     {
-        if (this._processingSelectionControllerSelectionDidChange)
+        if (this._processingSelectionChange)
             return;
 
         this._itemWasSelectedByUser = selectedByUser;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to