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

cloneNode() and script execution

From: Hallvord R. M. Steen <hallvord@opera.com>
Date: Sun, 18 Jan 2009 10:17:08 +0900
To: public-html@w3.org
Message-ID: <op.unxhuua9a3v5gv@hr-opera.oslo.opera.com>

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?

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  

Hallvord R. M. Steen
Core JavaScript tester, Opera Software
Opera - simply the best Internet experience
Received on Sunday, 18 January 2009 01:17:12 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:41 UTC