From adb44d7f5bb8f619e3ae94ce2979bb2a8932744a Mon Sep 17 00:00:00 2001 From: bdash Date: Fri, 13 Oct 2006 01:31:34 +0000 Subject: [PATCH 1/1] 2006-10-12 Nikolas Zimmermann Reviewed by Maciej. Trying to fix "DRT hangs on certain testcases" like fast/dom/Document/document-reopen.html document.open(); document.write(..); and NO document.close(). On the Qt platform this leaves a HTMLDocument which is still in parsing mode (parsing() always returns true). DRT waits forever, but m_frame->isComplete() is never true due the parsing mode problem. Hmpf, this took me nine hours to debug today. Result: Couldn't find the real fix, going for a workaround for now. 540 minutes, 1 line of code changed after all -> 0,0019 lines per minute. * platform/qt/FrameQt.cpp: (WebCore::FrameQt::handledOnloadEvents): Call endIfNotLoading() manually. * platform/qt/FrameQtClient.cpp: (WebCore::FrameQtClientDefault::receivedData): Use write() again instead of addData(). git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17020 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 19 +++++++++++++++++++ WebCore/platform/qt/FrameQt.cpp | 8 +++++++- WebCore/platform/qt/FrameQtClient.cpp | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index da3129a8fca5..95815c9bfbe8 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2006-10-12 Nikolas Zimmermann + + Reviewed by Maciej. + + Trying to fix "DRT hangs on certain testcases" like fast/dom/Document/document-reopen.html + document.open(); document.write(..); and NO document.close(). On the Qt platform this + leaves a HTMLDocument which is still in parsing mode (parsing() always returns true). + DRT waits forever, but m_frame->isComplete() is never true due the parsing mode problem. + + Hmpf, this took me nine hours to debug today. + Result: Couldn't find the real fix, going for a workaround for now. + + 540 minutes, 1 line of code changed after all -> 0,0019 lines per minute. + + * platform/qt/FrameQt.cpp: + (WebCore::FrameQt::handledOnloadEvents): Call endIfNotLoading() manually. + * platform/qt/FrameQtClient.cpp: + (WebCore::FrameQtClientDefault::receivedData): Use write() again instead of addData(). + 2006-10-12 Adam Roben Reviewed by Adele. diff --git a/WebCore/platform/qt/FrameQt.cpp b/WebCore/platform/qt/FrameQt.cpp index d92d6712112e..d9a0d473f086 100644 --- a/WebCore/platform/qt/FrameQt.cpp +++ b/WebCore/platform/qt/FrameQt.cpp @@ -446,7 +446,13 @@ bool FrameQt::canGoBackOrForward(int distance) const void FrameQt::handledOnloadEvents() { - // no-op + // TODO: FrameMac doesn't need that - it seems. + // It must be handled differently, can't figure it out. + // If we won't call this here doc->parsing() remains 'true' + // all the time. Calling document.open(); document.write(...) + // from JavaScript leaves the parsing state 'true', and DRT will + // hang on these tests (fast/dom/Document/document-reopen.html for instance) + endIfNotLoading(); } bool FrameQt::canPaste() const diff --git a/WebCore/platform/qt/FrameQtClient.cpp b/WebCore/platform/qt/FrameQtClient.cpp index 7475e97c736b..e4941b5da004 100644 --- a/WebCore/platform/qt/FrameQtClient.cpp +++ b/WebCore/platform/qt/FrameQtClient.cpp @@ -98,7 +98,7 @@ void FrameQtClientDefault::receivedData(ResourceLoader* job, const char* data, i m_frame->setEncoding(d->m_charset, false); // Feed with new data - m_frame->addData(data, length); + m_frame->write(data, length); } void FrameQtClientDefault::receivedAllData(ResourceLoader* job, PlatformData data) -- 2.36.0