Closed
Bug 204961
Opened 21 years ago
Closed 21 years ago
Apply XBL bindings before interpreting JavaScripts?
Categories
(Core :: XBL, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: WeirdAl, Assigned: hyatt)
Details
Note attachment 122801 [details] (zipped testcase) from bug 204957. The testcase, by opening the nsScriptAttrTest.xml file, uses XBL to insert an alert before the comment in the second script (html > head > script). The inserted alert does not currently run through the interpreter. If the XBL bindings applied before the scripts entered the interpreter, it would allow for modifying one script which in and of itself isn't compatible with Mozilla into another which is (a la XML Events, under Handlers, section 3.3) For instance, XML Events gives the following example: <script type="application/x-javascript" ev:event="submit" ev:observer="form1"> return docheck(event); </script> With a little care, that could transform into: <script type="application/x-javascript"><![CDATA[ document.getElementById("form1").addEventListener("submit", function(event) { return docheck(event); }, false); ]]></script> See bug 164482 for progress on XML Events.
Reporter | ||
Comment 1•21 years ago
|
||
Actually, it'd be: <script type="application/x-javascript"><![CDATA[ document.getElementById("form1").addEventListener("submit", function(event) { ]]> <![CDATA[ return docheck(event); ]]> <![CDATA[ }, false); ]]></script>
Comment 2•21 years ago
|
||
I don't really think this is the right way to go. Hyatt?
![]() |
||
Comment 3•21 years ago
|
||
I don't think we should do this -- the content of script is not a presentational or behavioral property of the script, really...
I would be fine with doing this unless it affects performance, and if someone steps up to the plate to do this. I don't however think that we should implements xml-events in this way, i'd rather see a "real" implementation in C++
![]() |
||
Comment 5•21 years ago
|
||
> unless it affects performance
Doing this will, if nothing else, force script evaluation at frame construction
time instead of content creation time... that will require that all scripts
always flush the content sink (to ensure that the frames get constructed right
there and then).
So yes, it will hurt performance of loading vanilla HTML pages.
Comment 6•21 years ago
|
||
I really don't think it is semantically right to expect XBL to affect compiling of scripts. At all. :-)
![]() |
||
Comment 7•21 years ago
|
||
Right. That was comment 3. With sicking and Ian's leave, WONTFIX.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•