On Tue, Sep 7, 2010 at 2:06 AM, Anne van Kesteren <[email protected]> wrote: > On Tue, 07 Sep 2010 10:47:01 +0200, Jonas Sicking <[email protected]> wrote: >> >> For what it's worth, we still throw WRONG_DOCUMENT_ERR in a few places in >> gecko: >> >> >> http://mxr.mozilla.org/mozilla-central/search?string=WRONG_DOCUMENT_ERR&find=\.cpp >> >> Some, but likely not all, of these can and should probably be removed. >> For example it makes sense that if during the call to adoptNode >> (implicit or explicit), if any UserDataHandler readopts the node to >> another owner document, then it makes sense for adoptNode to throw >> WRONG_DOCUMENT_ERR. > > UserDataHandler is currently not part of the specification. I guess only > Gecko implemented that.
Well, you have the same situation if the call is made by a mutation event handler if the node-to-be-adopted has a parent. There is also the situation where createDocument is called and passed a doctype node, which already has a non-null ownerDocument. In short, I'd encourage you to go through the search results linked to above. / Jonas
