Title: [154593] trunk
Revision
154593
Author
[email protected]
Date
2013-08-26 03:07:28 -0700 (Mon, 26 Aug 2013)

Log Message

[Qt] Remove the fix in QWebPage::_javascript_ConsoleMessage introduced by (r61433)
https://bugs.webkit.org/show_bug.cgi?id=119791

Source/WebKit/qt:

Patch by Arunprasad Rajkumar <[email protected]> on 2013-08-26
Reviewed by Jocelyn Turcotte.

* WidgetApi/qwebpage.cpp:
(QWebPage::_javascript_ConsoleMessage): Removed hack specific to DRT, introduced by
(r61433).

Tools:

Patch by Arunprasad Rajkumar <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (154592 => 154593)


--- trunk/Source/WebKit/qt/ChangeLog	2013-08-26 08:43:51 UTC (rev 154592)
+++ trunk/Source/WebKit/qt/ChangeLog	2013-08-26 10:07:28 UTC (rev 154593)
@@ -1,3 +1,14 @@
+2013-08-26  Arunprasad Rajkumar  <[email protected]>
+
+        [Qt] Remove the fix in QWebPage::_javascript_ConsoleMessage introduced by (r61433)
+        https://bugs.webkit.org/show_bug.cgi?id=119791
+
+        Reviewed by Jocelyn Turcotte.
+
+        * WidgetApi/qwebpage.cpp:
+        (QWebPage::_javascript_ConsoleMessage): Removed hack specific to DRT, introduced by
+        (r61433).
+
 2013-08-24  Darin Adler  <[email protected]>
 
         Frame::tree should return a reference instead of a pointer

Modified: trunk/Source/WebKit/qt/WidgetApi/qwebpage.cpp (154592 => 154593)


--- trunk/Source/WebKit/qt/WidgetApi/qwebpage.cpp	2013-08-26 08:43:51 UTC (rev 154592)
+++ trunk/Source/WebKit/qt/WidgetApi/qwebpage.cpp	2013-08-26 10:07:28 UTC (rev 154593)
@@ -1485,17 +1485,8 @@
 void QWebPage::_javascript_ConsoleMessage(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);
 }
 
 /*!

Modified: trunk/Tools/ChangeLog (154592 => 154593)


--- trunk/Tools/ChangeLog	2013-08-26 08:43:51 UTC (rev 154592)
+++ trunk/Tools/ChangeLog	2013-08-26 10:07:28 UTC (rev 154593)
@@ -1,3 +1,17 @@
+2013-08-26  Arunprasad Rajkumar  <[email protected]>
+
+        [Qt] Remove the fix in QWebPage::_javascript_ConsoleMessage 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  <[email protected]>
 
         [GTK] Silence MiniBrowser compile warnings due to recent GTK+ deprecations

Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp (154592 => 154593)


--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2013-08-26 08:43:51 UTC (rev 154592)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2013-08-26 10:07:28 UTC (rev 154593)
@@ -159,6 +159,15 @@
 
 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 _javascript_Alert, _javascript_ConsoleMessage, ...etc.
+    mainFrame()->load(QUrl());
     delete m_webInspector;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to