W3C home > Mailing lists > Public > public-html@w3.org > February 2009

Re: cloneNode() and script execution

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 12 Feb 2009 06:28:49 +0000 (UTC)
To: public-html@w3.org
Message-ID: <Pine.LNX.4.62.0902120523150.28232@hixie.dreamhostps.com>

On Sun, 18 Jan 2009, Hallvord R. M. Steen wrote:
> Here is another issue for Ian to ponder while working on the script 
> execution stuff:
> If you clone a script node and append the to the document, does it run?

Per spec, no. The spec says the "already executed" flag is copied when 
the element is cloned. (It has said this for some time.)

> Browsers differ:
> cloneNode(true) - Opera no, Firefox no, Safari yes, IE fails
> cloneNode(false) - Opera yes, Firefox no, Safari yes, IE fails
> From my naturally biased point of view I think Opera makes more sense - 
> a "deep" clone remembers that the script was already executed, a shallow 
> doesn't because it doesn't clone the script code. I think any use cases 
> one might think of for re-executing script clones are already much 
> better handled by putting the code inside a function and doing a simple 
> function call.

I really don't think we want to make this depend on the flag. This is an 
edge case, the least complexity here the better.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 12 February 2009 06:29:27 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:42 UTC