[Qt] Remove the fix in QWebPage::javaScriptConsoleMessage introduced by (r61433)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2013 10:07:28 +0000 (10:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2013 10:07:28 +0000 (10:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119791

Source/WebKit/qt:

Patch by Arunprasad Rajkumar <arurajku@cisco.com> 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 <arurajku@cisco.com> 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

Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WidgetApi/qwebpage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

index 3416c73d3d8c9e7d73415e43adc43eec37e0350c..3d0aa214dca2dc55bf8ba312744af8d3e5418c4d 100644 (file)
@@ -1,3 +1,14 @@
+2013-08-26  Arunprasad Rajkumar  <arurajku@cisco.com>
+
+        [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  <darin@apple.com>
 
         Frame::tree should return a reference instead of a pointer
 2013-08-24  Darin Adler  <darin@apple.com>
 
         Frame::tree should return a reference instead of a pointer
index 0f3f14d39e255f1052b58993211e827bd1e1a80c..6279e921ccd519a987ee5ef9a58b419362749436 100644 (file)
@@ -1485,17 +1485,8 @@ QWidget *QWebPage::view() const
 void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
 {
     Q_UNUSED(sourceID);
 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);
 }
 
 /*!
 }
 
 /*!
index 04caf8a4ef46b3d08a4ca900746be1e286f78090..ab9654789e0905f8289ba0659cca7d3e87ca96c5 100644 (file)
@@ -1,3 +1,17 @@
+2013-08-26  Arunprasad Rajkumar  <arurajku@cisco.com>
+
+        [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  <cgarcia@igalia.com>
 
         [GTK] Silence MiniBrowser compile warnings due to recent GTK+ deprecations
 2013-08-26  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Silence MiniBrowser compile warnings due to recent GTK+ deprecations
index 5062dde3d9b770bfe5e6a903968772d74c5f2416..9385fe7c653bd0a1fa6a1cd6e056d704f411bb00 100755 (executable)
@@ -159,6 +159,15 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
 
 WebPage::~WebPage()
 {
 
 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;
 }
 
     delete m_webInspector;
 }