W3C home > Mailing lists > Public > www-svg@w3.org > December 2004

Re: LC Comment - Script & Progressive Rendering / Multiple Pages

From: Peter Sorotokin <psorotok@adobe.com>
Date: Wed, 01 Dec 2004 09:51:34 -0800
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Jim Ley <jim@jibbering.com>
Cc: www-svg@w3.org
Message-id: <5.2.0.9.2.20041201094121.032d3e30@mailsj-v1.corp.adobe.com>

At 10:40 AM 12/1/2004 -0600, Boris Zbarsky wrote:

>Jim Ley wrote:
>>Removing, inserting or altering script elements once the document has 
>>been loaded has no effect.
>
>May I ask why there is this clause?  The "altering" and "removing" part 
>makes sense, but in other markup languages creating a brand-new <script> 
>and inserting it into the document will execute that script...

I don't think HTML or XHTML spec really defines it. And I think it is a bad 
idea to do it, it is probably an artifact of a particular way of 
implementing it rather then explicit design. What are use cases for that? 
If new script needs to be executed at runtime, just execute script through 
your language-dependent mechanisms explicitly. If script is executed on 
insertion, a lot of funny issues arise. For instance, if I remove a branch 
from a tree and then insert it somewhere else all the scripts in that 
branch will be reexecuted (and I might not even know that they are in the 
branch). Also, if you really want the behavior of execution on insertion, 
you can always register DOM insertion mutation even listener that would do 
it for you; but if UA executes on insertion, you are stuck with it and 
cannot turn it off.

Peter


>-Boris
Received on Wednesday, 1 December 2004 17:52:33 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:29 GMT