[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

andersca at apple.com andersca at apple.com
Fri Jan 21 14:38:08 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 661a819bc884f34fccb786d1107cb7e3badbc3b8
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 23 18:16:02 2010 +0000

    2010-12-23  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by John Sullivan.
    
            Nothing happens clicking "launch live player" on live.cnn.com
            https://bugs.webkit.org/show_bug.cgi?id=51540
            <rdar://problem/8791086>
    
            Implement NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState.
    
            * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
            (WebKit::NPN_PushPopupsEnabledState):
            Call NetscapePlugin::pushPopupsEnabledState.
    
            (WebKit::NPN_PopPopupsEnabledState):
            Call NetscapePlugin::popPopupsEnabledState.
    
            * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
            (WebKit::NetscapePlugin::pushPopupsEnabledState):
            Append the boolean to the vector.
    
            (WebKit::NetscapePlugin::popPopupsEnabledState):
            Remove the last boolean from the vector.
    
            (WebKit::NetscapePlugin::allowPopups):
            Return the last boolean from the vector.
    
            * WebProcess/Plugins/Netscape/NetscapePlugin.h:
            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::performJavaScriptURLRequest):
            Update the "allowPopupsFromPlugin" state.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74564 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 072c4b6..3db8723 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,35 @@
+2010-12-23  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Nothing happens clicking "launch live player" on live.cnn.com
+        https://bugs.webkit.org/show_bug.cgi?id=51540
+        <rdar://problem/8791086>
+
+        Implement NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState.
+
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_PushPopupsEnabledState):
+        Call NetscapePlugin::pushPopupsEnabledState.
+
+        (WebKit::NPN_PopPopupsEnabledState):
+        Call NetscapePlugin::popPopupsEnabledState.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::pushPopupsEnabledState):
+        Append the boolean to the vector.
+
+        (WebKit::NetscapePlugin::popPopupsEnabledState):
+        Remove the last boolean from the vector.
+
+        (WebKit::NetscapePlugin::allowPopups):
+        Return the last boolean from the vector.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::performJavaScriptURLRequest):
+        Update the "allowPopupsFromPlugin" state.
+
 2010-12-22  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index e849598..566d48d 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -648,14 +648,16 @@ static void NPN_SetException(NPObject*, const NPUTF8* message)
     NetscapePlugin::setException(message);
 }
 
-static void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
+static void NPN_PushPopupsEnabledState(NPP npp, NPBool enabled)
 {
-    notImplemented();
+    RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+    plugin->pushPopupsEnabledState(enabled);
 }
     
-static void NPN_PopPopupsEnabledState(NPP instance)
+static void NPN_PopPopupsEnabledState(NPP npp)
 {
-    notImplemented();
+    RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+    plugin->popPopupsEnabledState();
 }
     
 static bool NPN_Enumerate(NPP, NPObject* npObject, NPIdentifier** identifiers, uint32_t* identifierCount)
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index 93095be..0beade2 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -249,6 +249,18 @@ bool NetscapePlugin::isAcceleratedCompositingEnabled()
 #endif
 }
 
+void NetscapePlugin::pushPopupsEnabledState(bool state)
+{
+    m_popupEnabledStates.append(state);
+}
+ 
+void NetscapePlugin::popPopupsEnabledState()
+{
+    ASSERT(!m_popupEnabledStates.isEmpty());
+
+    m_popupEnabledStates.removeLast();
+}
+
 String NetscapePlugin::proxiesForURL(const String& urlString)
 {
     return m_pluginController->proxiesForURL(urlString);
@@ -371,7 +383,14 @@ void NetscapePlugin::stopAllStreams()
 
 bool NetscapePlugin::allowPopups() const
 {
-    // FIXME: Handle popups.
+    if (m_pluginModule->pluginFuncs().version >= NPVERS_HAS_POPUPS_ENABLED_STATE) {
+        if (!m_popupEnabledStates.isEmpty())
+            return m_popupEnabledStates.last();
+    }
+
+    // FIXME: Check if the current event is a user gesture.
+    // Really old versions of Flash required this for popups to work, but all newer versions
+    // support NPN_PushPopupEnabledState/NPN_PopPopupEnabledState.
     return false;
 }
 
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index 683a3d1..fb5d37e 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -87,6 +87,9 @@ public:
 
     bool isAcceleratedCompositingEnabled();
 
+    void pushPopupsEnabledState(bool enabled);
+    void popPopupsEnabledState();
+
     String proxiesForURL(const String& urlString);
     String cookiesForURL(const String& urlString);
     void setCookiesForURL(const String& urlString, const String& cookieString);
@@ -195,6 +198,7 @@ private:
     bool m_inNPPNew;
     bool m_loadManually;
     RefPtr<NetscapePluginStream> m_manualStream;
+    Vector<bool, 8> m_popupEnabledStates;
 
 #if PLATFORM(MAC)
     NPDrawingModel m_drawingModel;
diff --git a/WebKit2/WebProcess/Plugins/PluginView.cpp b/WebKit2/WebProcess/Plugins/PluginView.cpp
index 88d315b..00271c1 100644
--- a/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -703,9 +703,14 @@ void PluginView::performJavaScriptURLRequest(URLRequest* request)
     // Evaluate the JavaScript code. Note that running JavaScript here could cause the plug-in to be destroyed, so we
     // grab references to the plug-in here.
     RefPtr<Plugin> plugin = m_plugin;
+
+    bool oldAllowPopups = frame->script()->allowPopupsFromPlugin();
+    frame->script()->setAllowPopupsFromPlugin(request->allowPopups());
     
     ScriptValue result = m_pluginElement->document()->frame()->script()->executeScript(jsString);
 
+    frame->script()->setAllowPopupsFromPlugin(oldAllowPopups);
+
     // Check if evaluating the JavaScript destroyed the plug-in.
     if (!plugin->controller())
         return;
@@ -888,7 +893,7 @@ NPObject* PluginView::pluginElementNPObject()
     return m_npRuntimeObjectMap.getOrCreateNPObject(object);
 }
 
-bool PluginView::evaluate(NPObject* npObject, const String&scriptString, NPVariant* result, bool allowPopups)
+bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups)
 {
     if (!frame())
         return false;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list