- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4395
REGRESSION: document.open doesn't clear the document
Test: fast/dom/Document/document-reopen.html
Test: fast/dom/Document/doc-open-while-parsing.html
* dom/DocumentImpl.cpp:
(WebCore::DocumentImpl::open): Only ignore open() while the frame is still loading the main resource.
* page/Frame.cpp:
(WebCore::Frame::isComplete): Added const specifier.
(WebCore::Frame::isLoadingMainResource): New function.
* page/Frame.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13324
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-16 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Maciej.
+
+ - Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=4395
+ REGRESSION: document.open doesn't clear the document
+
+ * fast/dom/Document/doc-open-while-parsing-expected.txt: Added.
+ * fast/dom/Document/doc-open-while-parsing.html: Added.
+ * fast/dom/Document/document-reopen-expected.txt: Added.
+ * fast/dom/Document/document-reopen.html: Added.
+
2006-03-15 Beth Dakin <bdakin@apple.com>
Rubber stamped by Geoff.
--- /dev/null
+Test for a possible problem related to bug 4395: REGRESSION: document.open doesn't clear the document.
+
+This line should appear second.
+
+Last line.
+
+
--- /dev/null
+<p>Test for a possible problem related to <a href=\'http://bugzilla.opendarwin.org/show_bug.cgi?id=4395\'>bug 4395</a>:
+REGRESSION: document.open doesn't clear the document.</p>
+
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.open();
+ document.write("<p>This line should appear second.</p>");
+ document.close();
+</script>
+
+<p>Last line.</p>
--- /dev/null
+There should be only one line of text here. Bug 4395
+
--- /dev/null
+<html>
+<head>
+<title>document.open</title>
+</head>
+<body onLoad="mainFunc();">
+<script>
+function mainFunc() {
+
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ document.open();
+ document.write("will not be visible<br>");
+ document.close();
+
+ for (i = 0; i < 5; i++) {
+
+ document.open();
+ document.write("There should be only one line of text here. <a href=\'http://bugzilla.opendarwin.org/show_bug.cgi?id=4395\'>Bug 4395</a><br>");
+ }
+}
+</script>
+</body>
+</html>
+2006-03-16 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Maciej.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4395
+ REGRESSION: document.open doesn't clear the document
+
+ Test: fast/dom/Document/document-reopen.html
+ Test: fast/dom/Document/doc-open-while-parsing.html
+
+ * dom/DocumentImpl.cpp:
+ (WebCore::DocumentImpl::open): Only ignore open() while the frame is still loading the main resource.
+ * page/Frame.cpp:
+ (WebCore::Frame::isComplete): Added const specifier.
+ (WebCore::Frame::isLoadingMainResource): New function.
+ * page/Frame.h:
+
2006-03-15 Adele Peterson <adele@apple.com>
Reviewed by Eric.
void DocumentImpl::open()
{
- if (parsing())
+ if (frame() && frame()->isLoadingMainResource())
return;
implicitOpen();
return d->m_mousePressNode.get();
}
-bool Frame::isComplete()
+bool Frame::isComplete() const
{
return d->m_bComplete;
}
+bool Frame::isLoadingMainResource() const
+{
+ return d->m_bLoadingMainResource;
+}
+
FrameTree *Frame::tree() const
{
return &d->m_treeNode;
void prepareForUserAction();
NodeImpl *mousePressNode();
- bool isComplete();
+ bool isComplete() const;
+ bool isLoadingMainResource() const;
void replaceContentsWithScriptResult(const KURL &url);