Stepping out into an HTML 'onclick' attribute shows the HTML file with an unexpected highlight
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(firefox66 fixed)
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: jlast, Assigned: bhackett1024)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
loganfsmyth
:
review+
|
Details | Diff | Splinter Review |
Reporter | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
One concern I have for showing this in the HTML is that JS line/column may not be the same because the string attribute could have HTML entities and things that have varying sizes.
Also, does the engine have a way to provide start column numbers right now? I think I remember it only supporting starting line numbers, which also isn't as likely to break things in <script> but would need to be added for attrs.
I'm not sure it would be worth supporting the second step you have.
Comment 4•6 years ago
|
||
There is starting column information. But if we have entity processing and BuildFunctionString
mangling going on, it's not going to be very useful.
I especially like this part of Brian's suggestion in bug 1517167 comment 8:
If we reorient things so that the source's text (or a hash of it) is the basis for comparing different sources, or checking if a source came from within an HTML document, then we should be able to avoid all of these problems, and have a simple argument that the debugger is showing correct sources to users.
That is, it's certainly helpful to show the text of the handler attribute in the context in which it was written (the HTML page), but not so valuable that we should risk showing the wrong text altogether. We have the real text in hand, via the Debugger.Source; we should always make sure that we're using it.
Assignee | ||
Comment 5•6 years ago
|
||
Potential patch (plus test), I'll run this through try before adding an r?.
Several things need to be changed for this to work as expected, alas:
-
My understanding of the isInlineSource flag on a source is that indicates whether it is inside an inline <script> and should be displayed as part of the HTML page. Per this definition, isInlineSource is set incorrectly for these event handlers.
-
The server can fold sources into the HTML page even if they aren't inline, as long as their URL matches.
-
Event handlers should be treated as eval'ed code (which they are, really) so that no URL is given to the client and they aren't shown in the sources pane or confused with tabs for the HTML page itself.
Assignee | ||
Comment 6•6 years ago
|
||
Comment on attachment 9035460 [details] [diff] [review]
patch
This looks good on try.
Comment 7•6 years ago
|
||
Comment 9•6 years ago
|
||
bugherder |
Description
•