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

Hi, Boris-

Sorry for the confusion here.  Let me try to clarify things.

Boris Zbarsky wrote:
|  
| Per the spec send out by Andrew, if I change the href  
| after the <script> element has been inserted into 
| the document but before the script content has finished 
| loading, the href change is ignored and the original 
| load continues, with the results of that load  
| executed when they finish loading.  

There was still a little ambiguity in the spec that we didn't notice at
first, causing the seeming contradiction.

"Altering the xlink:href on a script element in the DOM tree has no effect;"
might be more accurately (if clumsily) worded as, "Altering the xlink:href
on a script element in the DOM tree after the existing resource has been
loaded and placed in the scripting context has no effect;"

If you change the href before the external resource has been loaded and
placed in the scripting context, then the *new* resource is loaded instead.
It is only immutable after the resource is loaded into the scripting
context.


| Now the question is what happens if in this very circumstance
| I don't just change the href attribute, but remove the node 
| from the DOM, then change the href, then reinsert it into the DOM.

In all cases where a script element is inserted into the DOM, the
step-by-step procedure is followed.  If you remove an element, change it,
and then reinsert it, it is as if it is a new element for the purposes of
the 5-step processing model.

Does this resolve your issue?  If so, I am happy to clarify the wording in
the spec (hopefully not as clumsily as above).

Thanks-
Doug, on behalf of the SVG WG 

Received on Friday, 11 August 2006 07:58:43 UTC