I'd like to present the list of included scripts in the debugger, but can't because document.getElementsByTagName("script"); returns a NodeList of length 0. Other tag names seem to work ok.
Sorry dude, "Future" isn't going to work for me. I need this by 1.0 for the debugger.
I got something working, about to post a patch.
Created attachment 69220 [details] [diff] [review] proposed patch, round one So here's what I did... Previously, nsXULContentSink::OpenTag put *only* an nsXULPrototypeScript in the prototype document, and these objects don't get translated into actual content. My changes cause ::OpenTag to insert a nsXULPrototypeElement first, *then* the nsXULPrototypeScript. <script>s in overlays don't actually glom on to some element in the target document, so ::CreateOverlayElement was modified to skip the forward reference in that case. If we let the forward reference get created, we end up with getElementById("") assertions when we try to resolve it. Text in inline scripts is not preserved in the script element. Not perfect, but good enough for my purposes. Post 1.0 it might be cleaner for nsXULPrototypeScript to inherit nsXULPrototypeElement, or just do away with nsXULPrototypeElement, and push its members down to nsXULPrototypeNode. This wfm on linux, I don't see any new assertions, and seem to be able to browse just fine (oh, and getElementsByTagName("script") works too.) I'll run through a few more tests tomorrow.
adding potential reviewers
use nshtmlatoms::script. sr=hyatt
Comment on attachment 69220 [details] [diff] [review] proposed patch, round one What hyatt said, r=jst
Oops. That patch didn't cover top level <script> tags in overlays. That is: <overlay> <script src="file1.js"/> <box id="box-id"> <script src="file2.js"/> </box> </overlay> A content element for file2.js gets created, but not file1.js, but both scripts are executed. I propose to add all overlay elements without IDs to the root element in the target document. This removes the two mNodeInfo->Equals calls from my last patch, in favor of a single null string test, which may speed things up a bit.
Created attachment 69837 [details] [diff] [review] more patch These changes cause all overlay nodes without IDs to end up in the root element of the target document. We used to just ASSERT in this case... ###!!! ASSERTION: getElementById(""), fix caller?: '!aId.IsEmpty()', file nsXULDocument.cpp, line 3575
Comment on attachment 69837 [details] [diff] [review] more patch firstname.lastname@example.org, conditional on what the perf effects are this time round. /be
Comment on attachment 69837 [details] [diff] [review] more patch r=jst
Checked in, I'll watch the testerboxen for possible perf issues.
*** Bug 122138 has been marked as a duplicate of this bug. ***