Closed
Bug 978657
Opened 10 years ago
Closed 10 years ago
Provide Debugger 'introductionType' information for <script> element code
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: jimb, Assigned: jimb)
References
Details
Attachments
(2 files, 2 obsolete files)
4.32 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
11.15 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
JS code introduced by <script> elements doesn't have any introduction type information set, as retrieved by Debugger.Source.prototype.introductionType.
Assignee | ||
Comment 1•10 years ago
|
||
Try push: https://tbpl.mozilla.org/?tree=Try&rev=4018f37e6e1d
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•10 years ago
|
||
This patch still needs tests for xul:script elements, which seem to be handled by a different place in the code: content/xul/content/src/nsXULElement.cpp instead of content/base/src/nsScriptLoader.cpp. I'll try to get to that tomorrow.
Assignee | ||
Updated•10 years ago
|
Attachment #8384417 -
Attachment description: Provide introductionType information at every place in Firefox that evaluates JavaScript code. → Provide introductionType information for HTML and XUL <script> elements.
Assignee | ||
Comment 3•10 years ago
|
||
Using the addTest and runNextTest functions from inspector-helpers.js helps separate the tests from each other in a sane way. This patch is meant to have no effect. It does change runNextTest to catch and report errors... I don't know why the test harness itself isn't reporting them. *GRR*
Attachment #8384419 -
Flags: review?(past)
Assignee | ||
Comment 4•10 years ago
|
||
The patch I just attached needs to be applied before the main patch. People wanting to try out the change should probably just get builds from the Try push linked to in comment 1.
Comment 5•10 years ago
|
||
Comment on attachment 8384419 [details] [diff] [review] Convert test_Debugger.Source.prototype.introductionType.html to use addTest and runNextTest. Review of attachment 8384419 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8384419 -
Flags: review?(past) → review+
Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Panos Astithas [:past] from comment #5) > LGTM. Thanks!
Assignee | ||
Comment 7•10 years ago
|
||
The mochitest-other test failures in the try push in comment 1 are the result of my neglecting to update another previously-existing test for the platform's (improved) behavior; so aside from the testing blunder, they're a good thing. I'll revise that test.
Assignee | ||
Comment 8•10 years ago
|
||
Revised try: https://tbpl.mozilla.org/?tree=Try&rev=c977f0e629c0
Assignee | ||
Comment 9•10 years ago
|
||
Okay, this one has tests for XUL scripts, too. Try push: https://tbpl.mozilla.org/?tree=Try&rev=16ce16ed15a5
Attachment #8384417 -
Attachment is obsolete: true
Attachment #8388863 -
Flags: review?(bugs)
Comment 10•10 years ago
|
||
Comment on attachment 8388863 [details] [diff] [review] Provide introductionType information for HTML and XUL <script> elements. >- >+if (false) { Am I missing something here?
Attachment #8388863 -
Flags: review?(bugs) → review-
Comment 11•10 years ago
|
||
I applied the patch and the introductionType is properly set to "scriptElement". The introductionScript is still missing (needed to complete the logic from here: bug 935203 comment 60). Let me know if I should file a new bug for it. Honza
Assignee | ||
Comment 12•10 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #10) > >+if (false) { > Am I missing something here? I'm sorry --- that was careless. I'd diked out those tests temporarily. Thus, the prior try push was thus kind of meaningless; here's a new one: https://tbpl.mozilla.org/?tree=Try&rev=ff843b39690b
Assignee | ||
Comment 13•10 years ago
|
||
Revised patch.
Attachment #8388863 -
Attachment is obsolete: true
Attachment #8389289 -
Flags: review?(bugs)
Updated•10 years ago
|
Attachment #8389289 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 14•10 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/613ff1b7bffb remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/ced81c068926
Flags: in-testsuite+
Target Milestone: --- → mozilla30
Assignee | ||
Comment 15•10 years ago
|
||
(In reply to Jan Honza Odvarko from comment #11) > I applied the patch and the introductionType is properly set to > "scriptElement". The introductionScript is still missing (needed to complete > the logic from here: bug 935203 comment 60). > Let me know if I should file a new bug for it. <script> element code doesn't necessarily have an introductionScript. For example, if a <script> appears directly in the original HTML document, then there is no reasonable JS script that we can say "introduced" the element. However, <script> element code should always have an associated 'element'. Could we synthesize names for them by looking at ownerDocument.location.href (in a content-distrustful way, of course)?
https://hg.mozilla.org/mozilla-central/rev/613ff1b7bffb https://hg.mozilla.org/mozilla-central/rev/ced81c068926
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 17•10 years ago
|
||
(In reply to Jim Blandy :jimb from comment #15) > (In reply to Jan Honza Odvarko from comment #11) > > I applied the patch and the introductionType is properly set to > > "scriptElement". The introductionScript is still missing (needed to complete > > the logic from here: bug 935203 comment 60). > > Let me know if I should file a new bug for it. > > <script> element code doesn't necessarily have an introductionScript. For > example, if a <script> appears directly in the original HTML document, then > there is no reasonable JS script that we can say "introduced" the element. I see that make sense. And what about having the introductionScript set only if it's created dynamically? (could be done by dynamically created script). This would help to compose unique URL through URL chaining (use parent script URL that already uniquely identifies the parent script, that uses parent script URL, etc.) There can be entire tree of dynamically created scripts and the URL can indicate what was the parent script (and grouping based on such URL chaining can simplify the UI). > However, <script> element code should always have an associated 'element'. > Could we synthesize names for them by looking at ownerDocument.location.href > (in a content-distrustful way, of course)? Yes, that's what I am using now. The element is good for user-cross-link (Script panel -> HTML panel), but it doesn't have to have ID, the xpath is not much unique (e.g. script[2], script[3]), so not that useful to generate URL (unless I am missing something). Honza
Comment 18•10 years ago
|
||
> And what about having the introductionScript set only if it's created
> dynamically?
Btw. this would also help to distinguish between statically and dynamically
created scripElement scripts (which is currently impossible, or am I wrong?)
Honza
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to Jan Honza Odvarko from comment #17) > And what about having the introductionScript set only if it's created > dynamically? > (could be done by dynamically created script). > This would help to compose unique URL through URL chaining (use parent > script URL > that already uniquely identifies the parent script, that uses parent script > URL, etc.) > > There can be entire tree of dynamically created scripts and the URL can > indicate what was the parent script (and grouping based on such URL chaining > can simplify the UI). Grouping things this way sounds like it could be nice. Filed as bug 983297.
Comment 20•10 years ago
|
||
(In reply to Jim Blandy :jimb from comment #19) > Grouping things this way sounds like it could be nice. Filed as bug 983297. Awesome! Honza
You need to log in
before you can comment on or make changes to this bug.
Description
•