[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:01:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 64fe6b7cc85db5b8ea31236899f08bcd78ad2ae0
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 16:16:03 2010 +0000

    Implement NPN_GetValue(NPNVnetscapeWindow)
    
    Fixes <http://webkit.org/b/46726> <rdar://problem/8486319>
    Right-clicking on windowless Flash plugin in WebKit2 makes a context
    menu appear in the bottom-right corner of the screen
    
    Test: platform/win/plugins/get-value-netscape-window.html
    
    Reviewed by Anders Carlsson.
    
    WebKit2:
    
    * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
    (WebKit::NPN_GetValue): Added case for NPNVnetscapeWindow that calls
    through to NetscapePlugin::containingWindow.
    
    * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added containingWindow
    on Windows.
    
    * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
    (WebKit::NetscapePlugin::containingWindow): Added. Calls through to
    the PluginController.
    (WebKit::NetscapePlugin::platformPostInitialize): Changed to use
    containingWindow.
    
    WebKitTools:
    
    Test NPN_GetValue(NPNVnetscapeWindow)
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
    (PluginTest::NPN_GetValue): Added. Calls through to the browser.
    
    * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added NPN_GetValue.
    
    * DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp: Added.
    (GetValueNetscapeWindow::GetValueNetscapeWindow): Initialize members.
    (GetValueNetscapeWindow::NPP_SetWindow): Test that
    NPN_GetValue(NPNVnetscapeWindow) returns a valid HWND and that it
    isn't our HWND.
    
    * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
    Added GetValueNetscapeWindow.
    
    LayoutTests:
    
    Support for testing NPN_GetValue(NPNVnetscapeWindow)
    
    * platform/win/plugins/get-value-netscape-window-expected.txt: Added.
    * platform/win/plugins/get-value-netscape-window.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 95a1890..188170a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2010-10-01  Adam Roben  <aroben at apple.com>
 
+        Support for testing NPN_GetValue(NPNVnetscapeWindow)
+
+        Test for <http://webkit.org/b/46726> <rdar://problem/8486319>
+        Right-clicking on windowless Flash plugin in WebKit2 makes a context
+        menu appear in the bottom-right corner of the screen
+
+        Reviewed by Anders Carlsson.
+
+        * platform/win/plugins/get-value-netscape-window-expected.txt: Added.
+        * platform/win/plugins/get-value-netscape-window.html: Added.
+
+2010-10-01  Adam Roben  <aroben at apple.com>
+
         Add expected Windows results for
         scrollbars/custom-scrollbar-with-incomplete-style.html
 
diff --git a/LayoutTests/platform/win/plugins/get-value-netscape-window-expected.txt b/LayoutTests/platform/win/plugins/get-value-netscape-window-expected.txt
new file mode 100644
index 0000000..e0a57e9
--- /dev/null
+++ b/LayoutTests/platform/win/plugins/get-value-netscape-window-expected.txt
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 0: PLUGIN: NPN_GetValue(NPNVnetscapeWindow) succeeded
+
+This tests that the browser supports NPN_GetValue(NPNVnetscapeWindow).
diff --git a/LayoutTests/platform/win/plugins/get-value-netscape-window.html b/LayoutTests/platform/win/plugins/get-value-netscape-window.html
new file mode 100644
index 0000000..add7794
--- /dev/null
+++ b/LayoutTests/platform/win/plugins/get-value-netscape-window.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<body>
+<embed id="testPlugin" 
+       type="application/x-webkit-test-netscape"
+       src="data:text/plain,"
+       test="get-value-netscape-window">
+</embed>
+
+<div>
+    This tests that the browser supports NPN_GetValue(NPNVnetscapeWindow).
+</div>
+<script>
+  if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+</script>
+</body>
+</html>
+
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index ca84e1e..5dda755 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,28 @@
+2010-10-01  Adam Roben  <aroben at apple.com>
+
+        Implement NPN_GetValue(NPNVnetscapeWindow)
+
+        Fixes <http://webkit.org/b/46726> <rdar://problem/8486319>
+        Right-clicking on windowless Flash plugin in WebKit2 makes a context
+        menu appear in the bottom-right corner of the screen
+
+        Test: platform/win/plugins/get-value-netscape-window.html
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_GetValue): Added case for NPNVnetscapeWindow that calls
+        through to NetscapePlugin::containingWindow.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added containingWindow
+        on Windows.
+
+        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
+        (WebKit::NetscapePlugin::containingWindow): Added. Calls through to
+        the PluginController.
+        (WebKit::NetscapePlugin::platformPostInitialize): Changed to use
+        containingWindow.
+
 2010-09-30  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index 30b4d8e..b2b8c73 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -441,6 +441,11 @@ static NPError NPN_GetValue(NPP npp, NPNVariable variable, void *value)
             break;
 #endif
 #elif PLATFORM(WIN)
+       case NPNVnetscapeWindow: {
+           RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+           *reinterpret_cast<HWND*>(value) = plugin->containingWindow();
+           break;
+       }
        case NPNVSupportsWindowless:
            *(NPBool*)value = true;
            break;
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index e08dff6..889b82c 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -55,6 +55,8 @@ public:
 #if PLATFORM(MAC)
     NPError setDrawingModel(NPDrawingModel);
     NPError setEventModel(NPEventModel);
+#elif PLATFORM(WIN)
+    HWND containingWindow() const;
 #endif
 
     void invalidate(const NPRect*);
diff --git a/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp b/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
index ef06a8e..0589c01 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
@@ -54,6 +54,11 @@ static void registerPluginView()
     ::RegisterClassW(&windowClass);
 }
 
+HWND NetscapePlugin::containingWindow() const
+{
+    return m_pluginController->nativeParentWindow();
+}
+
 bool NetscapePlugin::platformPostInitialize()
 {
     if (!m_isWindowed) {
@@ -63,7 +68,7 @@ bool NetscapePlugin::platformPostInitialize()
 
     registerPluginView();
 
-    m_window = ::CreateWindowExW(0, windowClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_pluginController->nativeParentWindow(), 0, 0, 0);
+    m_window = ::CreateWindowExW(0, windowClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, containingWindow(), 0, 0, 0);
     if (!m_window)
         return false;
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 56e6922..034c11f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-01  Adam Roben  <aroben at apple.com>
+
+        Test NPN_GetValue(NPNVnetscapeWindow)
+
+        Test for <http://webkit.org/b/46726> <rdar://problem/8486319>
+        Right-clicking on windowless Flash plugin in WebKit2 makes a context
+        menu appear in the bottom-right corner of the screen
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+        (PluginTest::NPN_GetValue): Added. Calls through to the browser.
+
+        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added NPN_GetValue.
+
+        * DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp: Added.
+        (GetValueNetscapeWindow::GetValueNetscapeWindow): Initialize members.
+        (GetValueNetscapeWindow::NPP_SetWindow): Test that
+        NPN_GetValue(NPNVnetscapeWindow) returns a valid HWND and that it
+        isn't our HWND.
+
+        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+        Added GetValueNetscapeWindow.
+
 2010-10-01  Andreas Kling  <andreas.kling at nokia.com>
 
         Unreviewed, adding my webkit.org identity to reviewer list.
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
index 83eda3a..d435a2e 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -75,6 +75,11 @@ NPIdentifier PluginTest::NPN_GetIntIdentifier(int32_t intid)
     return browser->getintidentifier(intid);
 }
 
+NPError PluginTest::NPN_GetValue(NPNVariable variable, void* value)
+{
+    return browser->getvalue(m_npp, variable, value);
+}
+
 NPObject* PluginTest::NPN_CreateObject(NPClass* npClass)
 {
     return browser->createobject(m_npp, npClass);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
index 2e896a6..cbc7934 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -62,6 +62,7 @@ public:
     // NPN functions.
     NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
     NPIdentifier NPN_GetIntIdentifier(int32_t intid);
+    NPError NPN_GetValue(NPNVariable, void* value);
     NPObject* NPN_CreateObject(NPClass*);
     bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName);
     
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp
new file mode 100644
index 0000000..32fd99b
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp
@@ -0,0 +1,73 @@
+/*
+ * 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;
+
+// NPN_GetValue(NPNVnetscapeWindow) should return a valid HWND.
+
+class GetValueNetscapeWindow : public PluginTest {
+public:
+    GetValueNetscapeWindow(NPP npp, const string& identifier)
+        : PluginTest(npp, identifier)
+        , m_didReceiveInitialSetWindowCall(false)
+    {
+    }
+
+private:
+    virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+    {
+        if (m_didReceiveInitialSetWindowCall)
+            return NPERR_NO_ERROR;
+        m_didReceiveInitialSetWindowCall = true;
+
+        HWND hwnd;
+        NPError error = NPN_GetValue(NPNVnetscapeWindow, &hwnd);
+        if (error != NPERR_NO_ERROR) {
+            pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) failed with error %d", error);
+            return NPERR_GENERIC_ERROR;
+        }
+
+        if (!::IsWindow(hwnd)) {
+            pluginLog(instance, "::IsWindow returned FALSE");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        if (hwnd == window->window) {
+            pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) returned the same value as NPWindow::window");
+            return NPERR_GENERIC_ERROR;
+        }
+
+        pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) succeeded");
+        return NPERR_NO_ERROR;
+    }
+
+    bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<GetValueNetscapeWindow> getValueNetscapeWindow("get-value-netscape-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index 5ffb832..5444346 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -390,6 +390,10 @@
 				Name="win"
 				>
 				<File
+					RelativePath="..\Tests\win\GetValueNetscapeWindow.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
 					>
 				</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list