- From: Aryeh Gregor <Simetrical+w3c@gmail.com>
- Date: Thu, 30 Jun 2011 16:49:44 -0400
- To: Anne van Kesteren <annevk@opera.com>
- Cc: www-dom@w3.org, David Flanagan <dflanagan@mozilla.com>
On Thu, Jun 30, 2011 at 11:32 AM, Anne van Kesteren <annevk@opera.com> wrote: > Should we support cloning Document and DocumentType objects? (There's an > "<!--XXX wrong? -->" comment in the source.) IMO it would be useful. For instance, a while ago I was writing test-cases that involved doing something to an iframe, checking if it was expected, and then resetting it for the next test. Resetting the src of the iframe and repeatedly having to hit the network was really slow (I didn't happen to have caching headers served), so my immediate inclination was to clone the iframe's Document, then set it directly using DOM methods after every test. This proved to be unnecessarily annoying, partly because I couldn't clone either the Document or the DocumentType inside it. I wound up making a DocumentFragment, copying everything there but the doctype, and then having special logic for restoring the doctype separately from the other nodes.
Received on Thursday, 30 June 2011 20:50:31 UTC