RESOLVED CONFIGURATION CHANGED 12339
XML DOM operations involving two documents don't match IE/Firefox behavior
https://bugs.webkit.org/show_bug.cgi?id=12339
Summary XML DOM operations involving two documents don't match IE/Firefox behavior
Jesse Costello-Good
Reported 2007-01-19 22:24:22 PST
I think that Safari probably has the more spec-compliant implementation but I report this for the sake of cross-browser AJAX compatibility. appendChild, insertBefore, replaceChild, and setAttributeNode (could there be more?) fail when the argument is a node from a different XML document. In IE and Fx these methods behave as though the nodes are in the same document. No special logic is necessary to test whether the ownerDocument property of the two nodes is the same. The work around is to use importNode(), call one of the above methods passing in the imported node, and remove the argument node from its parent node in the other document.
Attachments
test case (449 bytes, text/html)
2009-02-16 02:47 PST, Alexey Proskuryakov
no flags
Maciej Stachowiak
Comment 1 2007-02-16 20:48:24 PST
Our behavior is more spec-compliant. We would consider changing it, but I think Firefox at least is considering changing to match the spec more closely instead
Alexey Proskuryakov
Comment 2 2009-02-16 02:47:02 PST
Created attachment 27689 [details] test case On this test case, WebKit and IE7 raise an exception, while Firefox 3.1b2 and Opera 9.63 do not. I'm not sure if that's the case reported here.
Alexey Proskuryakov
Comment 3 2009-02-16 02:47:51 PST
See also: bug 4569.
Johan "Spocke" Sörlin
Comment 4 2009-08-26 08:33:37 PDT
I don't think this is a bug. You should use importNode if you want to add a node from one document to another according to W3C specs.
Lucas Forschler
Comment 5 2019-02-06 09:03:21 PST
Mass moving XML DOM bugs to the "DOM" Component.
Ahmad Saleem
Comment 6 2022-08-05 15:16:37 PDT
I am unable to reproduce this bug based on expected results since the behavior of Safari 15.6 on macOS 12.5 matches with other browsers (Chrome Canary 106 and Firefox Nightly 105) on attached test cases. It shows a dialog box with "P" in it and then show two empty iframe and it is same across all browsers. Since all browsers are working same, I am going to mark this as "RESOLVED CONFIGURATION CHANGED" expecting that something along the lien fixed it. In case if I am testing incorrectly, please reopen this bug. Thanks!
Note You need to log in before you can comment on or make changes to this bug.