W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2010

RE: Prototypes for adopted nodes

From: Travis Leithead <travil@microsoft.com>
Date: Mon, 9 Aug 2010 18:17:38 +0000
To: Andrew Oakley <andrew@ado.is-a-geek.net>, "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <9768D477C67135458BF978A45BCF9B3817E1BE@TK5EX14MBXW603.wingroup.windeploy.ntdev.microsoft.com>
In IE9, we switch the script context ownership of a given node when it is grafted into the primary markup for the adopting script context. In other words, simply referencing a node from a different script context is not sufficient to have its prototype ownerhip change; rather it must become part of the tree. 

We do this to ensure that all the nodes in a primary markup tree are consistently in the same prototype context.

-----Original Message-----
From: www-dom-request@w3.org [mailto:www-dom-request@w3.org] On Behalf Of Andrew Oakley
Sent: Monday, July 19, 2010 3:16 AM
To: www-dom@w3.org
Subject: Prototypes for adopted nodes

What "script context" should nodes belong to if they are adopted from one document to another?  By script context I mean which set of prototype objects are used.  This doesn't seem to be mentioned in the DOM 3 core adoptNode description.

I would expect the automatic adopting of nodes that browsers seem to be doing (rather than throwing WRONG_DOCUMENT_ERR) would have the same behaviour as using the adoptNode API.

On a related note which script context should be used if the
Document.create* APIs are used on different documents (e.g.
doc1.createTextNode.call(doc2, ...))?

I've uploaded a test case to http://ado.is-a-geek.net/www-dom/context/,
results don't seem to be consistent between different browsers.

Thanks

--
Andrew Oakley
Received on Monday, 9 August 2010 18:18:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:05 GMT