[haiku-webkit-commits] r369 - webkit/trunk/WebKit/haiku/WebCoreSupport

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Fri, 02 Apr 2010 21:19:29 +0000

Author: stippi
Date: Fri Apr  2 21:19:29 2010
New Revision: 369
URL: http://mmlr.dyndns.org/changeset/369

Log:
* Make sure in the closeWindowSoon() hook that JS code cannot find the page
  anymore. (As in Chromium port.)
* Do not ignore createWindow() requests when the resource request is empty.
  Follow the Chromium port and always create a window object, start loading
  when the request is not empty. This allows the translation page of the
  Haiku guide translatoin site to function.

Modified:
   webkit/trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp

Modified: webkit/trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp      Fri Apr 
 2 21:16:25 2010        (r368)
+++ webkit/trunk/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp      Fri Apr 
 2 21:19:29 2010        (r369)
@@ -124,9 +124,6 @@
 
 Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest& request, 
const WebCore::WindowFeatures& features)
 {
-       if (request.resourceRequest().isNull())
-           return 0;
-
     BRect frame;
     if (features.xSet && features.ySet && features.widthSet && 
features.heightSet) {
         frame.left = features.x;
@@ -136,7 +133,10 @@
     }
 
        WebCore::Page* page = m_webPage->createNewPage(frame, features.dialog, 
features.resizable);
-    if (page && page->mainFrame() && page->mainFrame()->loader())
+       if (!page)
+           return 0;
+
+    if (!request.resourceRequest().isEmpty() && page->mainFrame() && 
page->mainFrame()->loader())
         page->mainFrame()->loader()->load(request.resourceRequest(), false);
 
     return page;
@@ -225,7 +225,12 @@
 
 void ChromeClientHaiku::closeWindowSoon()
 {
+     // Make sure this Page can no longer be found by script code.
+    m_webPage->page()->setGroupName(String());
+
+    // Make sure all loading has stopped.
     m_webPage->MainFrame()->Frame()->loader()->stopAllLoaders();
+
     m_webPage->closeWindow();
 }
 

Other related posts: