[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 14:50:04 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 813d24d06f81144e310ea2409cc25ce5c52963d0
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 21 17:04:16 2010 +0000
Ask the UI client to close the page when the WKView receives a WM_CLOSE message
Fixes <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
close its parent window
Reviewed by Jon Honeycutt.
WebKit2:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::wndProc): Call through to WebPageProxy::tryClose when
we receive a WM_CLOSE message, rather than passing the message along to
::DefWindowProcW. tryClose will end up asking the UI client to close
the page, while ::DefWindowProcW would destroy us synchronously without
notifying the UI client at all. One case where we'll get sent a
WM_CLOSE message is when the user presses Ctrl+W when using the Adobe
Reader plugin to view a PDF.
WebKitTools:
Test that the UI client gets notified when WKView receives a WM_CLOSE message
* TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.
(TestWebKitAPI::close): Record that this function was called.
(TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
send it a WM_CLOSE message, and test that the UI client's close
callback got called. Note that this will hang if the bug is
reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
able to handle hangs.
* TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 9e5c7f8..43707e8 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,25 @@
2010-10-20 Adam Roben <aroben at apple.com>
+ Ask the UI client to close the page when the WKView receives a WM_CLOSE
+ message
+
+ Fixes <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
+ Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
+ close its parent window
+
+ Reviewed by Jon Honeycutt.
+
+ * UIProcess/win/WebView.cpp:
+ (WebKit::WebView::wndProc): Call through to WebPageProxy::tryClose when
+ we receive a WM_CLOSE message, rather than passing the message along to
+ ::DefWindowProcW. tryClose will end up asking the UI client to close
+ the page, while ::DefWindowProcW would destroy us synchronously without
+ notifying the UI client at all. One case where we'll get sent a
+ WM_CLOSE message is when the user presses Ctrl+W when using the Adobe
+ Reader plugin to view a PDF.
+
+2010-10-20 Adam Roben <aroben at apple.com>
+
Remove confusing and redundant "host window" terminology from WKView on
Windows
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index dfbc847..dbf8b2c 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -81,6 +81,9 @@ LRESULT WebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
bool handled = true;
switch (message) {
+ case WM_CLOSE:
+ m_page->tryClose();
+ break;
case WM_DESTROY:
m_isBeingDestroyed = true;
close();
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f5f984a..044324d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,26 @@
2010-10-20 Adam Roben <aroben at apple.com>
+ Test that the UI client gets notified when WKView receives a WM_CLOSE
+ message
+
+ Test for <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
+ Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
+ close its parent window
+
+ Reviewed by Jon Honeycutt.
+
+ * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.
+ (TestWebKitAPI::close): Record that this function was called.
+ (TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
+ send it a WM_CLOSE message, and test that the UI client's close
+ callback got called. Note that this will hang if the bug is
+ reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
+ able to handle hangs.
+
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
+
+2010-10-20 Adam Roben <aroben at apple.com>
+
Make prepare-ChangeLog much faster when using git
This change also seems to make it detect renames better in some cases.
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
new file mode 100644
index 0000000..a019f08
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool didReceiveClose;
+
+static void close(WKPageRef, const void*)
+{
+ didReceiveClose = true;
+}
+
+TEST(WebKit2, WMCloseCallsUIClientClose)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+
+ uiClient.close = close;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ ::SendMessageW(WKViewGetWindow(webView.platformView()), WM_CLOSE, 0, 0);
+
+ Util::run(&didReceiveClose);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
index 44bf963..cba32cf 100644
--- a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
+++ b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
@@ -471,6 +471,10 @@
RelativePath="..\Tests\WebKit2\win\AltKeyGeneratesWMSysCommand.cpp"
>
</File>
+ <File
+ RelativePath="..\Tests\WebKit2\win\WMCloseCallsUIClientClose.cpp"
+ >
+ </File>
</Filter>
</Filter>
<Filter
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list