document.open() should clear the document, as described in <http://www.mozilla.org/docs/dom/ domref/dom_doc_ref51.html> and <http://developer.mozilla.org/en/docs/document.open>. This doesn't work in Safari 2.0 and ToT (did work in 1.2.4). Steps to reproduce: open the attached test case. In the bottom frame, there should be only one line "line". This regression causes a problem in "real life" code that I cannot mention (it's under an NDA).
Created attachment 3346 [details] test case
Lowering the priority to P2 since this isn't a regression from a previously released version. This also fails in Firefox, but works in MacIE (haven't tried WinIE).
(In reply to comment #2) > isn't a regression from a previously released version. Sorry, I meant _previous_ released version.
Adding Regression keyword.
Upping to P1 because this is a regression.
<rdar://problem/4424096>
Opened a Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=325352
Created attachment 6162 [details] self-contained test case Verified that it works in WinIE; doesn't work in Firefox (looks like it also uncovers an unrelated issue in the latter).
Created attachment 6944 [details] proposed fix The code I removed here has appeared four years ago (r798, "Merged changes from LABYRINTH_KDE_3_MERGE branch"). I wonder why this worked in Safari 1.2.4.
What are the consequences of opening the document while parsing? Should ::open cancel parsing?
(In reply to comment #10) Sorry, I cannot answer this question - all I know is that this change fixes one test case, and doesn't break existing tests. And, oh, my changelog entry is wrong.
Created attachment 7034 [details] test case that this change would break This patch would break the attached test case. Sorry that layout tests didn't cover this already, I'll try to turn the test case into a layout test soon. I think the real check in ::open() should not be parsing() but rather some check that the document's Frame is still loading the main resource.
Created attachment 7091 [details] revised fix
Created attachment 7092 [details] revised fix Oops, forgot the include the original test.
Comment on attachment 7092 [details] revised fix r=me
Several regressions were caused by this change: bug 7804, bug 7818, bug 7848.