Bug 47442 - Web Inspector: add a "create breakpoint" context menu item for linkified source locations
Summary: Web Inspector: add a "create breakpoint" context menu item for linkified sour...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Devin Rousso
URL:
Keywords: EasyFix, InRadar
Depends on:
Blocks:
 
Reported: 2010-10-08 17:32 PDT by Derk-Jan Hartman
Modified: 2017-03-08 18:13 PST (History)
13 users (show)

See Also:


Attachments
Patch (8.25 KB, patch)
2017-02-28 19:19 PST, Devin Rousso
bburg: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
Patch (6.97 KB, patch)
2017-03-08 17:52 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Derk-Jan Hartman 2010-10-08 17:32:43 PDT
I've been working with webapps a bit lately, and I think it could be very useful, if in the DOM inspector, specifically the Event Listeners section, you could set a break point on the function that gets triggered by the event, straight from the DOM inspector. This would especially be handy when you have to deal with anonymous functions attached to events.
Comment 1 Ilya Tikhonovsky 2010-10-08 19:10:57 PDT
Web Inspector already has DOM breakpoints, XHR Breakpoints and Event Listener breakpoints.
All these things are available at ToT of Chromium and WebKit.
Comment 2 Joseph Pecoraro 2010-10-08 20:02:06 PDT
Derk has some good points.

  "specifically the Event Listeners section, you could set a break point
    on the function that gets triggered by the event, straight from the
    DOM inspector"

I think Chromium linkify's the function in the Event Listener's sidebar
and ToT WebKit doesn't yet. But linkification would handle this use
case pretty easily as you could jump to the function's def'n and set
the breakpoint on that line.

But it might make sense to repurpose this and have it request the
functionality to set a breakpoint for an Event type automatically from
the Event Listener's sidebar. Ilya, is that possible right now? I regret
that I've fallen a bit behind there.

Derk, were all your concerns handled by the new breakpoint
functionality?
Comment 3 Ilya Tikhonovsky 2010-10-08 21:39:28 PDT
(In reply to comment #2)
> Derk has some good points.
> 
>   "specifically the Event Listeners section, you could set a break point
>     on the function that gets triggered by the event, straight from the
>     DOM inspector"
> 
> I think Chromium linkify's the function in the Event Listener's sidebar
> and ToT WebKit doesn't yet. But linkification would handle this use
> case pretty easily as you could jump to the function's def'n and set
> the breakpoint on that line.
> 
> But it might make sense to repurpose this and have it request the
> functionality to set a breakpoint for an Event type automatically from
> the Event Listener's sidebar. Ilya, is that possible right now? I regret
> that I've fallen a bit behind there.
> 
> Derk, were all your concerns handled by the new breakpoint
> functionality?

You are right. It is not possible to setup a breakpoint from Event Listener's sidebar of Elements panel.
Comment 4 Derk-Jan Hartman 2013-08-28 02:42:09 PDT
I never followed up on this I see.

My concern was partly solved by the linkification. However, what I really would like is to just put a breakpoint on that specific function right from the sidepanel.

The reason is minified code. Putting breakpoints on minified code is a PITA right now. If you could set a breakpoint on a specific function straight from the Event Listener's sidebar, then debugging minified code would be significantly simpler.

I guess this first requires adding some functionality to the debugger to not fully rely on line information for breakpoints, but also on blocks/expressions/conditions.
Comment 5 Brian Burg 2014-11-29 17:53:12 PST
(Migrating component)

I believe that linkified positions now always use line + column so it should work for minified code just fine. However there is still the indirection of clicking link and then navigating it. I renamed the bug to better reflect what the fix would be. This could be added for any linkified location- I think it would be great in the timeline records UI.
Comment 6 Radar WebKit Bug Importer 2014-11-29 17:53:33 PST
<rdar://problem/19096426>
Comment 7 Devin Rousso 2017-02-28 19:19:14 PST
Created attachment 303028 [details]
Patch
Comment 8 BJ Burg 2017-03-08 16:45:32 PST
Comment on attachment 303028 [details]
Patch

r=me
Comment 9 WebKit Commit Bot 2017-03-08 17:36:46 PST
Comment on attachment 303028 [details]
Patch

Rejecting attachment 303028 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 303028, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ile Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js
patching file Source/WebInspectorUI/UserInterface/Views/DetailsSection.css
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebInspectorUI/UserInterface/Views/DetailsSection.css.rej
patching file Source/WebInspectorUI/UserInterface/Views/Main.css

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Brian Burg']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/3273030
Comment 10 Devin Rousso 2017-03-08 17:52:10 PST
Created attachment 303877 [details]
Patch
Comment 11 WebKit Commit Bot 2017-03-08 18:13:34 PST
Comment on attachment 303877 [details]
Patch

Clearing flags on attachment: 303877

Committed r213617: <http://trac.webkit.org/changeset/213617>
Comment 12 WebKit Commit Bot 2017-03-08 18:13:39 PST
All reviewed patches have been landed.  Closing bug.