[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 13:51:55 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e73a56c96c5c4177b7451e8bc3e202cfbe081e5d
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 15:44:00 2010 +0000

    Don't call NPP_SetWindow until the plugin's HWND has been sized/positioned
    
    Test: platform/win/plugins/window-geometry-initialized-before-set-window.html
    
    Reviewed by Anders Carlsson.
    
    Fixes <http://webkit.org/b/46716> <rdar://problem/8482014> Full-page
    Adobe Reader does not paint until window is resized
    
    WebKit2:
    
    * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
    (WebKit::NetscapePlugin::geometryDidChange): Call NPP_SetWindow after
    updating the platform (HWND) geometry.
    
    WebKitTools:
    
    Test that a plugin's HWND is sized/positioned before NPP_SetWindow is called
    
    Reviewed by Anders Carlsson.
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
    (PluginTest::NPP_SetWindow): Added. Just returns NPERR_NO_ERROR at
    this level.
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Declared
    NPP_SetWindow.
    
    * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp: Added.
    (WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Checks that
    the plugin's HWND has a non-zero size and that its size/position
    matches that specified in the NPWindow.
    
    * DumpRenderTree/TestNetscapePlugIn/main.cpp:
    (NPP_SetWindow): Call through to the PluginTest.
    
    * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
    Added WindowGeometryInitializedBeforeSetWindow.cpp, and let VS reorder
    the files as it saw fit.
    
    LayoutTests:
    
    Test that a plugin's HWND is sized/positioned before NPP_SetWindow is called
    
    * platform/win/plugins/window-geometry-initialized-before-set-window-expected.txt: Added.
    * platform/win/plugins/window-geometry-initialized-before-set-window.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68520 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b558a6a..3ccacc6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2010-09-28  Adam Roben  <aroben at apple.com>
 
+        Test that a plugin's HWND is sized/positioned before NPP_SetWindow is
+        called
+
+        Reviewed by Anders Carlsson.
+
+        Test for <http://webkit.org/b/46716> <rdar://problem/8482014>
+        Full-page Adobe Reader does not paint until window is resized
+
+        * platform/win/plugins/window-geometry-initialized-before-set-window-expected.txt: Added.
+        * platform/win/plugins/window-geometry-initialized-before-set-window.html: Added.
+
+2010-09-28  Adam Roben  <aroben at apple.com>
+
         Start running plugins tests in WebKit2 on Windows
 
         Fixes <http://webkit.org/b/46675> <rdar://problem/8484269>
diff --git a/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window-expected.txt b/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window-expected.txt
new file mode 100644
index 0000000..bd8510e
--- /dev/null
+++ b/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window-expected.txt
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 0: PLUGIN: Plugin's HWND has been sized and positioned before NPP_SetWindow was called
+
+This tests that a plugin's HWND is already sized and positioned before NPP_SetWindow is called.
diff --git a/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window.html b/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window.html
new file mode 100644
index 0000000..f9434cd
--- /dev/null
+++ b/LayoutTests/platform/win/plugins/window-geometry-initialized-before-set-window.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<body>
+<embed id="testPlugin" 
+       type="application/x-webkit-test-netscape"
+       src="data:text/plain,"
+       test="window-geometry-initialized-before-set-window">
+</embed>
+
+<div>
+    This tests that a plugin's HWND is already sized and positioned before NPP_SetWindow is called.
+</div>
+<script>
+  if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+</script>
+</body>
+</html>
+
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index be8747b..a7bddcd 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-28  Adam Roben  <aroben at apple.com>
+
+        Don't call NPP_SetWindow until the plugin's HWND has been
+        sized/positioned
+
+        Test: platform/win/plugins/window-geometry-initialized-before-set-window.html
+
+        Reviewed by Anders Carlsson.
+
+        Fixes <http://webkit.org/b/46716> <rdar://problem/8482014> Full-page
+        Adobe Reader does not paint until window is resized
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::geometryDidChange): Call NPP_SetWindow after
+        updating the platform (HWND) geometry.
+
 2010-09-28  Anders Carlsson  <andersca at apple.com>
 
         Out of process plug-ins shouldn't be turned on just yet...
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index eb2ac7a..43b93a9 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -397,8 +397,8 @@ void NetscapePlugin::geometryDidChange(const IntRect& frameRect, const IntRect&
     m_frameRect = frameRect;
     m_clipRect = clipRect;
 
-    callSetWindow();
     platformGeometryDidChange();
+    callSetWindow();
 }
 
 void NetscapePlugin::frameDidFinishLoading(uint64_t requestID)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 063dca9..ee1bda2 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,32 @@
+2010-09-28  Adam Roben  <aroben at apple.com>
+
+        Test that a plugin's HWND is sized/positioned before NPP_SetWindow is
+        called
+
+        Reviewed by Anders Carlsson.
+
+        Test for <http://webkit.org/b/46716> <rdar://problem/8482014>
+        Full-page Adobe Reader does not paint until window is resized
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+        (PluginTest::NPP_SetWindow): Added. Just returns NPERR_NO_ERROR at
+        this level.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Declared
+        NPP_SetWindow.
+
+        * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp: Added.
+        (WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Checks that
+        the plugin's HWND has a non-zero size and that its size/position
+        matches that specified in the NPWindow.
+
+        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+        (NPP_SetWindow): Call through to the PluginTest.
+
+        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+        Added WindowGeometryInitializedBeforeSetWindow.cpp, and let VS reorder
+        the files as it saw fit.
+
 2010-09-28  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
index 0ff7029..83eda3a 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -60,6 +60,11 @@ NPError PluginTest::NPP_GetValue(NPPVariable variable, void *value)
     return NPERR_GENERIC_ERROR;
 }
 
+NPError PluginTest::NPP_SetWindow(NPP, NPWindow*)
+{
+    return NPERR_NO_ERROR;
+}
+
 NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8 *name)
 {
     return browser->getstringidentifier(name);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
index ecc0185..2e896a6 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -57,6 +57,7 @@ public:
     // NPP functions.
     virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
     virtual NPError NPP_GetValue(NPPVariable, void* value);
+    virtual NPError NPP_SetWindow(NPP, NPWindow*);
 
     // NPN functions.
     NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
new file mode 100644
index 0000000..40bceb9
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Plugin's HWND should be sized/positioned before NPP_SetWindow is called.
+
+class WindowGeometryInitializedBeforeSetWindow : public PluginTest {
+public:
+    WindowGeometryInitializedBeforeSetWindow(NPP npp, const string& identifier)
+        : PluginTest(npp, identifier)
+    {
+    }
+
+private:
+    virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+    {
+        if (window->type != NPWindowTypeWindow) {
+            pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type);
+            return NPERR_GENERIC_ERROR;
+        }
+
+        HWND hwnd = reinterpret_cast<HWND>(window->window);
+        RECT rect;
+        if (!::GetClientRect(hwnd, &rect)) {
+            pluginLog(instance, "::GetClientRect failed");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        if (::IsRectEmpty(&rect)) {
+            pluginLog(instance, "Plugin's HWND has not been sized when NPP_SetWindow is called");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        HWND parent = ::GetParent(hwnd);
+        if (!parent) {
+            pluginLog(instance, "::GetParent failed");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        // MSDN says that calling ::MapWindowPoints this way will tell it we're passing a RECT rather than two POINTs.
+        if (!::MapWindowPoints(hwnd, parent, reinterpret_cast<POINT*>(&rect), 2)) {
+            pluginLog(instance, "::MapWindowPoints failed");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        if (rect.left != window->x || rect.top != window->y || (rect.right - rect.left) != window->width || (rect.bottom - rect.top) != window->height) {
+            pluginLog(instance, "HWND's rect and NPWindow's rect are not equal");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        pluginLog(instance, "Plugin's HWND has been sized and positioned before NPP_SetWindow was called");
+        return NPERR_NO_ERROR;
+    }        
+};
+
+static PluginTest::Register<WindowGeometryInitializedBeforeSetWindow> windowGeometryInitializedBeforeSetWindow("window-geometry-initialized-before-set-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index c02e918..23517e2 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -300,7 +300,7 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window)
         }
     }
     
-    return NPERR_NO_ERROR;
+    return obj->pluginTest->NPP_SetWindow(instance, window);
 }
 
 static void executeScript(const PluginObject* obj, const char* script)
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index c36666f..5ffb832 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -367,6 +367,34 @@
 	<References>
 	</References>
 	<Files>
+		<Filter
+			Name="Tests"
+			>
+			<File
+				RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
+				>
+			</File>
+			<Filter
+				Name="win"
+				>
+				<File
+					RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
 		<File
 			RelativePath="..\main.cpp"
 			>
@@ -456,26 +484,6 @@
 			RelativePath="..\TestObject.h"
 			>
 		</File>
-		<Filter
-			Name="Tests"
-			>
-		  <File
-    		  RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
-    		>
-    	  </File>
-    	  <File
-    		  RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
-    		>
-    	  </File>
-		  <File
-    		  RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
-    		>
-    	  </File>
-		  <File
-    		  RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
-    		>
-    	  </File>
-		</Filter>
 	</Files>
 	<Globals>
 	</Globals>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list