Re: [SVGMobile12] Question on details of when <script> elements execute

On Sunday, August 6, 2006, 6:06:52 PM, Boris wrote:

BZ> Chris Lilley wrote:
>>>  For example, if I 
>>> insert a script into the document, then remove it before the script-content is 
>>> in the scripting context, then reinsert it later,
>> 
>> and assuming it completely loads this time
>> 
>>>  will it start getting the 
>>> script-content again and execute it?
>> 
>> Yes.

BZ> That's not consistent with what happens if I change the href of the script
BZ> element...  If I change the href without removing from the document, you're
BZ> saying the original href is what should execute, but if I remove before load
BZ> completes, change href and reinsert the new href should execute?  Why the
BZ> inconsistency?

You are not comparing like with like.

If you change the href on an already loaded script element, the script content has already been added to the scripting context.

If you change it or delete it before its has loaded then, well, it hasn't loaded.

If you add something (whether it is the same as something that was transitorily there before or not is immaterial) then, if it loads, it gets added to the scripting context.


-- 
 Chris Lilley                    mailto:chris@w3.org
 Interaction Domain Leader
 Co-Chair, W3C SVG Working Group
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

Received on Sunday, 6 August 2006 21:04:25 UTC