From: commit-queue@webkit.org Date: Mon, 26 Aug 2013 10:07:28 +0000 (+0000) Subject: [Qt] Remove the fix in QWebPage::javaScriptConsoleMessage introduced by (r61433) X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=34cd7bbbeea1bb8a792159e2a38a066f97c7a243 [Qt] Remove the fix in QWebPage::javaScriptConsoleMessage introduced by (r61433) https://bugs.webkit.org/show_bug.cgi?id=119791 Source/WebKit/qt: Patch by Arunprasad Rajkumar on 2013-08-26 Reviewed by Jocelyn Turcotte. * WidgetApi/qwebpage.cpp: (QWebPage::javaScriptConsoleMessage): Removed hack specific to DRT, introduced by (r61433). Tools: Patch by Arunprasad Rajkumar on 2013-08-26 Reviewed by Jocelyn Turcotte. Load empty url to send onunload event to currently running page. onunload event is mandatory for LayoutTests/plugins/open-and-close-window-with-plugin.html and LayoutTests/plugins/geturlnotify-during-document-teardown.html. * DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebPage::~WebPage): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154593 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog index 3416c73d3d8c..3d0aa214dca2 100644 --- a/Source/WebKit/qt/ChangeLog +++ b/Source/WebKit/qt/ChangeLog @@ -1,3 +1,14 @@ +2013-08-26 Arunprasad Rajkumar + + [Qt] Remove the fix in QWebPage::javaScriptConsoleMessage introduced by (r61433) + https://bugs.webkit.org/show_bug.cgi?id=119791 + + Reviewed by Jocelyn Turcotte. + + * WidgetApi/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): Removed hack specific to DRT, introduced by + (r61433). + 2013-08-24 Darin Adler Frame::tree should return a reference instead of a pointer diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp index 0f3f14d39e25..6279e921ccd5 100644 --- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp @@ -1485,17 +1485,8 @@ QWidget *QWebPage::view() const void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) { Q_UNUSED(sourceID); - - // Catch plugin logDestroy message for LayoutTests/plugins/open-and-close-window-with-plugin.html - // At this point DRT's WebPage has already been destroyed - if (QWebPageAdapter::drtRun) { - if (message == QLatin1String("PLUGIN: NPP_Destroy")) { - fprintf(stdout, "CONSOLE MESSAGE: "); - if (lineNumber) - fprintf(stdout, "line %d: ", lineNumber); - fprintf(stdout, "%s\n", message.toUtf8().constData()); - } - } + Q_UNUSED(lineNumber); + Q_UNUSED(sourceID); } /*! diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 04caf8a4ef46..ab9654789e09 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,17 @@ +2013-08-26 Arunprasad Rajkumar + + [Qt] Remove the fix in QWebPage::javaScriptConsoleMessage introduced by (r61433) + https://bugs.webkit.org/show_bug.cgi?id=119791 + + Reviewed by Jocelyn Turcotte. + + Load empty url to send onunload event to currently running page. onunload event is + mandatory for LayoutTests/plugins/open-and-close-window-with-plugin.html and + LayoutTests/plugins/geturlnotify-during-document-teardown.html. + + * DumpRenderTree/qt/DumpRenderTreeQt.cpp: + (WebPage::~WebPage): + 2013-08-26 Carlos Garcia Campos [GTK] Silence MiniBrowser compile warnings due to recent GTK+ deprecations diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 5062dde3d9b7..9385fe7c653b 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -159,6 +159,15 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt) WebPage::~WebPage() { + // Load an empty url to send the onunload event to the running page before + // deleting this instance. + // Prior to this fix the onunload event would be triggered from '~QWebPage', but + // it may call virtual functions (e.g. calling a window.alert from window.onunload) + // of 'QWebPage' as the 'WebPage' part of the vtable has already been unwinded. + // When in '~WebPage' the vtable of 'QWebPage' points to the derived + // class 'WebPage' and it's possible to receive 'QWebPage' virtual calls + // like javaScriptAlert, javaScriptConsoleMessage, ...etc. + mainFrame()->load(QUrl()); delete m_webInspector; }