Bug 163403 - Web Inspector: Dragging to delete a Breakpoint should never trigger a ContentView change
Summary: Web Inspector: Dragging to delete a Breakpoint should never trigger a Content...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-13 14:23 PDT by Joseph Pecoraro
Modified: 2016-10-14 16:13 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (3.40 KB, patch)
2016-10-13 14:31 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-10-13 14:23:54 PDT
Summary:
Dragging to delete a Breakpoint should never trigger a ContentView change

Steps to Reproduce:
1. Inspect http://bogojoker.com/shell/
2. Set a breakpoint in easySlider.min.js
3. Set a breakpoint in facebox.js
4. Show Debugger Tab
5. Select the facebox.js breakpoint in Debugger Sidebar
6. Drag to delete the Breakpoint from the TextEditor's gutter
  => The breakpoint is deleted but the ContentView unexpectedly changes to easySlider.min.js

Notes:
- When deleting BreakpointTreeElements from the sidebar via the Delete keyboard shortcuts I would expect ContentView changes
- When deleting BreakpointTreeElements in other ways (Context Menu, Drag + Delete from gutter) I do not expect ContentView changes
Comment 1 Radar WebKit Bug Importer 2016-10-13 14:24:29 PDT
<rdar://problem/28762930>
Comment 2 Joseph Pecoraro 2016-10-13 14:31:50 PDT
Created attachment 291516 [details]
[PATCH] Proposed Fix
Comment 3 Timothy Hatcher 2016-10-14 15:41:08 PDT
Comment on attachment 291516 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=291516&action=review

> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:593
> +        // 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();

Maybe we should select the parent so the resource is selected to match the visible view?
Comment 4 Joseph Pecoraro 2016-10-14 15:49:50 PDT
Comment on attachment 291516 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=291516&action=review

>> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:593
>> +            debuggerTreeElement.deselect();
> 
> Maybe we should select the parent so the resource is selected to match the visible view?

If this is the last BreakpointTreeElement then the parent (ResourceTreeElement) will be removed.

We could select the resource in the resources TreeOutline but that might be offscreen which means, should we scroll to it? No selection is actually what I felt best with.
Comment 5 WebKit Commit Bot 2016-10-14 16:13:13 PDT
Comment on attachment 291516 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 291516

Committed r207359: <http://trac.webkit.org/changeset/207359>
Comment 6 WebKit Commit Bot 2016-10-14 16:13:17 PDT
All reviewed patches have been landed.  Closing bug.