Title: [167759] trunk/Source/WebKit2
Revision
167759
Author
[email protected]
Date
2014-04-24 08:59:37 -0700 (Thu, 24 Apr 2014)

Log Message

[GTK] wmode='transparent' for flash plugin doesn't work
https://bugs.webkit.org/show_bug.cgi?id=120055

Reviewed by Gustavo Noronha Silva.

Force opaque window mode for flash plugin when wmode='transparent',
since X11 backend doesn't support transparency. We should add
proper transparency support because forcing opaque window mode
doesn't really work. Handle this as a plugin quirk instead of
adding X11 specific code to WebFrameLoaderClient::createPlugin().

* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::NetscapePluginModule::determineQuirks): Add
ForceFlashWindowlessMode quirk for flash in case of EFL platform
because EFL port doesn't support windowed plugins.
* Shared/Plugins/PluginQuirks.h: Add ForceFlashWindowlessMode X11
plugin quirk.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::initialize): Modify or add wmode
parameter for flash plugin, to force opaque window mode when
transparent mode is specified or when ForceFlashWindowlessMode
quirk is present.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createPlugin): Remove X11 specific code.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (167758 => 167759)


--- trunk/Source/WebKit2/ChangeLog	2014-04-24 15:56:00 UTC (rev 167758)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-24 15:59:37 UTC (rev 167759)
@@ -1,3 +1,30 @@
+2014-04-24  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] wmode='transparent' for flash plugin doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=120055
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Force opaque window mode for flash plugin when wmode='transparent',
+        since X11 backend doesn't support transparency. We should add
+        proper transparency support because forcing opaque window mode
+        doesn't really work. Handle this as a plugin quirk instead of
+        adding X11 specific code to WebFrameLoaderClient::createPlugin().
+
+        * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+        (WebKit::NetscapePluginModule::determineQuirks): Add
+        ForceFlashWindowlessMode quirk for flash in case of EFL platform
+        because EFL port doesn't support windowed plugins.
+        * Shared/Plugins/PluginQuirks.h: Add ForceFlashWindowlessMode X11
+        plugin quirk.
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::initialize): Modify or add wmode
+        parameter for flash plugin, to force opaque window mode when
+        transparent mode is specified or when ForceFlashWindowlessMode
+        quirk is present.
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createPlugin): Remove X11 specific code.
+
 2014-04-23  Simon Fraser  <[email protected]>
 
         [iOS WK2] Missing content inside long overflow-scrolling:touch 

Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp (167758 => 167759)


--- trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2014-04-24 15:56:00 UTC (rev 167758)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp	2014-04-24 15:59:37 UTC (rev 167759)
@@ -176,7 +176,6 @@
 
 void NetscapePluginModule::determineQuirks()
 {
-#if CPU(X86_64)
     RawPluginMetaData metaData;
     if (!getPluginInfoForLoadedPlugin(metaData))
         return;
@@ -185,11 +184,15 @@
     parseMIMEDescription(metaData.mimeDescription, mimeTypes);
     for (size_t i = 0; i < mimeTypes.size(); ++i) {
         if (mimeTypes[i].type == "application/x-shockwave-flash") {
+#if CPU(X86_64)
             m_pluginQuirks.add(PluginQuirks::IgnoreRightClickInWindowlessMode);
+#endif
+#if PLATFORM(EFL)
+            m_pluginQuirks.add(PluginQuirks::ForceFlashWindowlessMode);
+#endif
             break;
         }
     }
-#endif
 }
 
 static void writeByte(char byte)

Modified: trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h (167758 => 167759)


--- trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h	2014-04-24 15:56:00 UTC (rev 167758)
+++ trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h	2014-04-24 15:59:37 UTC (rev 167759)
@@ -89,6 +89,9 @@
         // freeze when sending right click events to them in windowed mode.
         IgnoreRightClickInWindowlessMode,
 
+        // Some ports don't support windowed plugins.
+        ForceFlashWindowlessMode,
+
         // Windows specific quirks:
 #elif PLUGIN_ARCHITECTURE(WIN)
         // Whether NPN_UserAgent should always return a Mozilla user agent.

Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (167758 => 167759)


--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2014-04-24 15:56:00 UTC (rev 167758)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2014-04-24 15:59:37 UTC (rev 167759)
@@ -600,6 +600,21 @@
         paramValues.append(parameters.values[i].utf8());
     }
 
+#if PLUGIN_ARCHITECTURE(X11)
+    if (equalIgnoringCase(parameters.mimeType, "application/x-shockwave-flash")) {
+        size_t wmodeIndex = parameters.names.find("wmode");
+        if (wmodeIndex != notFound) {
+            // Transparent window mode is not supported by X11 backend.
+            if (equalIgnoringCase(parameters.values[wmodeIndex], "transparent")
+                || (m_pluginModule->pluginQuirks().contains(PluginQuirks::ForceFlashWindowlessMode) && equalIgnoringCase(parameters.values[wmodeIndex], "window")))
+                paramValues[wmodeIndex] = "opaque";
+        } else if (m_pluginModule->pluginQuirks().contains(PluginQuirks::ForceFlashWindowlessMode)) {
+            paramNames.append("wmode");
+            paramValues.append("opaque");
+        }
+    }
+#endif
+
     // The strings that these pointers point to are kept alive by paramNames and paramValues.
     Vector<const char*> names;
     Vector<const char*> values;

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (167758 => 167759)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2014-04-24 15:56:00 UTC (rev 167758)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2014-04-24 15:59:37 UTC (rev 167759)
@@ -1321,23 +1321,6 @@
     parameters.layerHostingMode = m_frame->page()->layerHostingMode();
 #endif
 
-#if PLUGIN_ARCHITECTURE(X11)
-    // FIXME: This should really be X11-specific plug-in quirks.
-    if (equalIgnoringCase(mimeType, "application/x-shockwave-flash")) {
-        // Currently we don't support transparency and windowed mode.
-        // Inject wmode=opaque to make Flash work in these conditions.
-        size_t wmodeIndex = parameters.names.find("wmode");
-        if (wmodeIndex == notFound) {
-            parameters.names.append("wmode");
-            parameters.values.append("opaque");
-        } else if (equalIgnoringCase(parameters.values[wmodeIndex], "window"))
-            parameters.values[wmodeIndex] = "opaque";
-    } else if (equalIgnoringCase(mimeType, "application/x-webkit-test-netscape")) {
-        parameters.names.append("windowedPlugin");
-        parameters.values.append("false");
-    }
-#endif
-
 #if ENABLE(NETSCAPE_PLUGIN_API)
     RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginElement, parameters, parameters.mimeType);
     if (!plugin)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to