WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
4056
document.write in same function as window.open fails to write new content
https://bugs.webkit.org/show_bug.cgi?id=4056
Summary
document.write in same function as window.open fails to write new content
Vicki Murley
Reported
2005-07-18 13:32:25 PDT
This bug is also in Radar as <
rdar://4179028
> Summary: If an URL is specified while opening a new window using window.open(), the initial markup does not clear off when we use document.write() subsequently. Steps to Reproduce: 1. Create a HTML file, using the following markup, and name it init.html :- <html> <body> Ideally, this markup should get cleared. </body> </html> 2. Create another HTML file called main.html, using the markup given below, in the same directory where you have saved init.html :- <html> <body> <script> function popup() { w = window.open( "init.html" ,"win2" ,"Scrollbars=1,resizable=1,width=400,height=450" ); w.document.open("text/html"); w.document.write("<html>"); w.document.write("<body>"); w.document.write("New markup"); w.document.write("</body>"); w.document.write("</html>"); w.document.close(); w.focus(); } </script> <a href="javascript:popup()">Click to open a new window</a> </body> <html> 3. View the HTML file main.html in a Safari 1.3 browser. 4. Click on the link "Click to open a new window". Expected Results: A new window should appear with the text "New Markup". Actual Results: In Safari 1.3, a new window appears alright but the initial markup does not get cleared. We see the text "Ideally, this markup should get cleared." In other browsers e.g. Netscape 7.1, IE 5.5, IE 6, Firefox 1.0.4, we get the expected result. ------------------------------------------- <GMT14-Jul-2005 16:22:33GMT> works if a document.write is in a separate function
Attachments
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2005-07-29 14:39:03 PDT
Fixed.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug