Closed Bug 351922 Opened 19 years ago Closed 19 years ago

importNode used on XULDocument breaks JavaScript

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 351919

People

(Reporter: nospamforas, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1 (1) I lied a bit above: The problem does not occur with firefox directely but with xulrunner, release 1.8.0.4, plattformBuildID 2006061608. Unfortunately I could not select xulrunner before... (2) What happens: A remote document ist loaded with XMLHttpRequest. The old page is removed with doc.removeChild for all children Then the new page is inserted with newNode = doc.importNode(node, true) and doc.appendChild(newNode) for all children of XMLHttpRequest.responseXML. All elements with the same commandhandler attribute have the commandhandler of the last element of this group. Reproducible: Always Steps to Reproduce: I can supply a testcase to make the point clearer. I took the example out of an experimental work in progress. Don't hit me if you find the testcase an impertinence. Just tell me, and I will try to find time to remove what is not really necessary to run it. But hopefully it is enough to look at the code... The testcase is a tarball. Unpack and put it to /somepath/ Enter /somepath/jsfclient.testapp/ Then change ./jsfclient.sh: add the correct path to xulrunner Then change ./chrome/content/jsfclient.xul: add the correct path to frame.xul If you really want to run it, change applicationURL in ./defaults/preferences/prefs.js but you need a web application server and create a web application with the one page ./eventtest.jsp. To help you I added the file ./eventtest.xul, which contains the reply of my web application server -- not only the xul, but the complete telnet session so that you can see the content-type etc. To run the example, you start ./jsfclient.sh. If you only want to look at the code: jsfclient.xul is started in the chrome which loads the empty frame frame.xul and -- among others -- jsfclient.js. In the onload event, eventtest.jsf (look at eventtest.xul) is loaded with XmlHttpRequest. Then look at handleResponse in jsfclient.js: Here the old nodes are removed and the new nodes are imported and appended. Actual Results: If you run the example, a page with three buttons is displayed. If you press any button, an alert popup is shown, which >always< shows the text button XXClose b3 Expected Results: If you click on a button, the text displayed in the alert box should depend on the button clicked, i.e. button XXConnect b1 button XXEdit b2 button XXClose b3 for the first, second and third button, respectively. Now I have to find a way to add my testcase...
*** This bug has been marked as a duplicate of 351919 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.