Title: [200808] trunk/Source/WebInspectorUI
Revision
200808
Author
[email protected]
Date
2016-05-12 21:15:56 -0700 (Thu, 12 May 2016)

Log Message

Web Inspector: Deleting nodes in DOM Tree sometimes changes selection to parent instead of sibling
https://bugs.webkit.org/show_bug.cgi?id=157649

Patch by Joseph Pecoraro <[email protected]> on 2016-05-12
Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._updateChildren): Deleted.
When pressing delete, we remove the node via DOM.removeNode()
and remove the DOMTreeElement when we receive a successful response.
However, the backend could send a DOM.childNodeRemoved event before
the response from DOM.removeNode, and the frontend would have a race
between DOMTreeUpdater's timeout and the removeNode callback.

In DOMTreeUpdater's path, DOMTreeElement updateChildren would notice
a removed node and set the selection to the parent node.

In the DOM.removeNode path, TreeOutline would update the selection
based on availability of a previousSibling/nextSibling/parent.

Remove the custom code in DOMTreeElement updateChildren, so that it
can just do the normal TreeOutline behavior via removeChildAtIndex.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200807 => 200808)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-13 01:55:40 UTC (rev 200807)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-13 04:15:56 UTC (rev 200808)
@@ -1,5 +1,29 @@
 2016-05-12  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Deleting nodes in DOM Tree sometimes changes selection to parent instead of sibling
+        https://bugs.webkit.org/show_bug.cgi?id=157649
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype._updateChildren): Deleted.
+        When pressing delete, we remove the node via DOM.removeNode()
+        and remove the DOMTreeElement when we receive a successful response.
+        However, the backend could send a DOM.childNodeRemoved event before
+        the response from DOM.removeNode, and the frontend would have a race
+        between DOMTreeUpdater's timeout and the removeNode callback.
+
+        In DOMTreeUpdater's path, DOMTreeElement updateChildren would notice
+        a removed node and set the selection to the parent node.
+
+        In the DOM.removeNode path, TreeOutline would update the selection
+        based on availability of a previousSibling/nextSibling/parent.
+
+        Remove the custom code in DOMTreeElement updateChildren, so that it
+        can just do the normal TreeOutline behavior via removeChildAtIndex.
+
+2016-05-12  Joseph Pecoraro  <[email protected]>
+
         REGRESSION: Web Inspector: Fails to load sourceMappingURL with relative URL
         https://bugs.webkit.org/show_bug.cgi?id=157650
         <rdar://problem/26133763>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (200807 => 200808)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-05-13 01:55:40 UTC (rev 200807)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-05-13 04:15:56 UTC (rev 200808)
@@ -387,10 +387,6 @@
                 continue;
             }
 
-            var selectedTreeElement = this.treeOutline.selectedTreeElement;
-            if (selectedTreeElement && (selectedTreeElement === currentChildTreeElement || selectedTreeElement.hasAncestor(currentChildTreeElement)))
-                this.select();
-
             this.removeChildAtIndex(i);
         }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to