Title: [207359] trunk/Source/WebInspectorUI
Revision
207359
Author
commit-qu...@webkit.org
Date
2016-10-14 16:10:34 -0700 (Fri, 14 Oct 2016)

Log Message

Web Inspector: Dragging to delete a Breakpoint should never trigger a ContentView change
https://bugs.webkit.org/show_bug.cgi?id=163403
<rdar://problem/28762930>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-10-14
Reviewed by Timothy Hatcher.

* UserInterface/Views/BreakpointTreeElement.js:
(WebInspector.BreakpointTreeElement.prototype.ondelete):
Signal when a breakpoint tree element will be going away because it was
deleted via the keyboard operation within the TreeOutline. This is a dirty
way to do the signal but we remove BreakpointTreeElements asynchronously
when the Breakpoint actually gets removed from the backend.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
Deselect a BreakpointTreeElement if it was deleted in a way other then
the delete keyboard shortcut. This ensures another TreeElement selection
doesn't force ContentView changes.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (207358 => 207359)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-10-14 23:04:04 UTC (rev 207358)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-10-14 23:10:34 UTC (rev 207359)
@@ -1,5 +1,26 @@
 2016-10-14  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Dragging to delete a Breakpoint should never trigger a ContentView change
+        https://bugs.webkit.org/show_bug.cgi?id=163403
+        <rdar://problem/28762930>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/BreakpointTreeElement.js:
+        (WebInspector.BreakpointTreeElement.prototype.ondelete):
+        Signal when a breakpoint tree element will be going away because it was
+        deleted via the keyboard operation within the TreeOutline. This is a dirty
+        way to do the signal but we remove BreakpointTreeElements asynchronously
+        when the Breakpoint actually gets removed from the backend.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
+        Deselect a BreakpointTreeElement if it was deleted in a way other then
+        the delete keyboard shortcut. This ensures another TreeElement selection
+        doesn't force ContentView changes.
+
+2016-10-14  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Improve debugger highlight when inside of getter/setter calls
         https://bugs.webkit.org/show_bug.cgi?id=163428
         <rdar://problem/28769061>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js (207358 => 207359)


--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2016-10-14 23:04:04 UTC (rev 207358)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2016-10-14 23:10:34 UTC (rev 207359)
@@ -80,6 +80,11 @@
         if (!WebInspector.debuggerManager.isBreakpointRemovable(this._breakpoint))
             return false;
 
+        // We set this flag so that TreeOutlines that will remove this
+        // BreakpointTreeElement will know whether it was deleted from
+        // within the TreeOutline or from outside it (e.g. TextEditor).
+        this.__deletedViaDeleteKeyboardShortcut = true;
+
         WebInspector.debuggerManager.removeBreakpoint(this._breakpoint);
         return true;
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (207358 => 207359)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-10-14 23:04:04 UTC (rev 207358)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-10-14 23:10:34 UTC (rev 207359)
@@ -586,7 +586,13 @@
 
     _removeDebuggerTreeElement(debuggerTreeElement)
     {
-        var parentTreeElement = debuggerTreeElement.parent;
+        // If this is a BreakpointTreeElement being deleted because of a cause
+        // outside of the TreeOutline then deselect if it is selected to avoid
+        // TreeOutline selection changes causing unexpected ContentView changes.
+        if (!debuggerTreeElement.__deletedViaDeleteKeyboardShortcut)
+            debuggerTreeElement.deselect();
+
+        let parentTreeElement = debuggerTreeElement.parent;
         parentTreeElement.removeChild(debuggerTreeElement);
 
         console.assert(parentTreeElement.parent === this._breakpointsContentTreeOutline);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to