RESOLVED FIXED 11361
Dynamically added script element is executed twice if its parent is also a dynamically create element
https://bugs.webkit.org/show_bug.cgi?id=11361
Summary Dynamically added script element is executed twice if its parent is also a dy...
mharder
Reported 2006-10-19 13:43:25 PDT
It seems that a dynamically added script element is executed twice if its parent is also a dynamically create element. Consider the following code: var script1 = document.createElement("script"); script1.type = "text/javascript"; script1.innerHTML = "alert('script1');"; var container = document.createElement("div"); container.appendChild(script1); document.body.appendChild(container); When this code is run, the "alert('script1');" code is executed twice. If you change the last line to: document.body.appendChild(script1); Then the "alert('script1');" code is only executed once.
Attachments
mharder
Comment 1 2006-10-19 14:01:13 PDT
*** This bug has been confirmed by popular vote. ***
Mark Rowe (bdash)
Comment 2 2006-10-19 14:24:11 PDT
This has been fixed on ToT. It works as expected in the latest nightly build. [What is the correct Bugzilla resolution in this instance? FIXED suggests we explicitly fixed this issue, while WORKSFORME suggests it was never broken]
Alexey Proskuryakov
Comment 3 2006-10-20 04:55:32 PDT
(In reply to comment #2) > [What is the correct Bugzilla resolution in this instance? FIXED suggests we > explicitly fixed this issue, while WORKSFORME suggests it was never broken] I prefer the WORKSFORME resoultion, because such reports should ideally be re-checked for regressions before release (if the problem "magically" disappeared, we may not have an automated test). Bugs that we could never reproduce usually end up as INVALID.
Note You need to log in before you can comment on or make changes to this bug.