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.
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
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.
See also: bug 4569.
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.
Mass moving XML DOM bugs to the "DOM" Component.
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!