Bug 290101 - Set breakpoints in html events, like onload, onclick, etc.
Summary: Set breakpoints in html events, like onload, onclick, etc.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: ATF (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-22 04:14 EDT by Jacek Pospychala CLA
Modified: 2020-05-07 10:51 EDT (History)
0 users

See Also:


Attachments
function breakpoints (11.25 KB, patch)
2009-09-22 08:43 EDT, Jacek Pospychala CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2009-09-22 04:14:03 EDT
It would be nice to set breakpoints in HTML to catch JS execution in such event listeners as onclick, onload, etc..
Comment 1 Jacek Pospychala CLA 2009-09-22 06:52:00 EDT
It would be possible by using function hook. Looking at the stack trace, stack frame associated with event (e.g. onload) has functionName set to "onload".
Unfortunately line breakpoint doesn't work because stack frame has incorrect line number, it's 0 instead of number of line in html file.
Comment 2 Jacek Pospychala CLA 2009-09-22 07:03:19 EDT
Additionally we could block setting line breakpoints in HTML files when not between <script></script> to avoid confusion, however it sounds impossible, e.g. considering
dynamically generated HTML.
Comment 3 Jacek Pospychala CLA 2009-09-22 08:43:02 EDT
Created attachment 147771 [details]
function breakpoints

initial implementation of function breakpoints.
It still needs some work to make stepInto/Over/Return buttons work correctly. It might also make sense to have separate breakpoint type for events and separate for functions.

In Events breakpoint, user could simply choose from predefined list of all known events, rather than inventing his own names. That's because for event names letter case doesn't matter - onload/onLoad/OnLoad is always onload.
Thats different for regular functions names where names case does matter.

Later on, some logic could be added, that would try to suggest user which breakpoint is best to use (eventBreakpoint over lineBreakpoint)