Version: (using KDE KDE 3.3.2) Installed from: Compiled From Sources Compiler: gcc 3.4.2 OS: Linux I'm trying to copy a paritial dom tree from an iframe to the parent frame. In my understanding of js and dom this should work and there are no problems with mozilla/firefox (see html sources at the end of this bug report). It seams like this always is a problem when I'm trying to copy something from one document to another - but it always works fine when I'm just in one document. Also, when I'm fetching an XHTML document from a server using the XMLHttpRequest object I can't copy parts from the DOM tree I recieve to the document displayed. That also works fine with mozilla/firefox. I don't get any JavaScript errors on the console. It just fails. By adding alert() calls to the javasript it can be proven that the JavaScript really stops executing (instead of just not displaying the new updated page, e.g.). It's hard to tell as non-insider if this is a KJS or KHTML bug.. --- inner.html --- <html><body> <div id="a">This is div A.</div> </body></html> --- outer.html --- <html><body bgcolor="#eeffff"> <iframe name="inner" src="inner.html"> </iframe> <div id="b">This is div B.</div> <script><!-- function doit() { var new_node = inner.document.getElementById("a").cloneNode(true); document.getElementById("b").parentNode.replaceChild(new_node, document.getElementById("b")); } //--></script> <form> <input type="button" onclick="doit()" value="Click!" /> </form> </body></html>
SVN commit 427263 by staikos: Merge webcore fix for replaceChild() BUG: 100457 BUG: 72430 M +4 -0 ChangeLog M +87 -8 ecma/kjs_binding.cpp M +25 -5 ecma/kjs_binding.h M +34 -25 xml/dom_nodeimpl.cpp M +2 -0 xml/dom_nodeimpl.h
Fix was reverted since it was an incomplete merge and caused crashes and rendering errors
*** Bug 72430 has been marked as a duplicate of this bug. ***
Is this still an issue with kde 3.5.4?
Nothing relevant has changed, Juergen. But to reporter: actually, your understanding of what the DOM says is very wrong. In fact, it -requires- doing what KHTML does: raising an exception: "WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node." .. and so Mozilla, just like IE, is breaking the spec here... The -proper- thing to do here is to use importNode. Having said that, this is something which we will eventually change to match the existing practice --- following the spec here would just screw over our users.
Created attachment 22721 [details] testcase: inner.html
Created attachment 22722 [details] testcase: outer.html (uses inner.html attachment)
*** Bug 66781 has been marked as a duplicate of this bug. ***
Thank you for the bug report. As this report hasn't seen any changes in 10 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.