Title: [195950] trunk
Revision
195950
Author
[email protected]
Date
2016-01-31 20:44:07 -0800 (Sun, 31 Jan 2016)

Log Message

Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
https://bugs.webkit.org/show_bug.cgi?id=153657
<rdar://problem/24413107>

Reviewed by Darin Adler.

Source/WebCore:

Tested by http/tests/plugins/visible_plugins.html.

A number of poorly-coded sites break when WebKit reports that it understands PDF mime types,
but does not have a list of plugins that the site can iterate through.

To avoid this compatibility problem, we should also expose the "WebKit built-in PDF" plugin
to avoid this edge case.

* plugins/PluginData.cpp:
(WebCore::shouldBePubliclyVisible): Add "WebKit built-in PDF" plugin.

LayoutTests:

* http/tests/plugins/visible_plugins-expected.txt: Added.
* http/tests/plugins/visible_plugins.html: Added.
* platform/mac-wk2/http/tests/plugins: Added.
* platform/mac-wk2/http/tests/plugins/visible_plugins-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195949 => 195950)


--- trunk/LayoutTests/ChangeLog	2016-02-01 04:09:02 UTC (rev 195949)
+++ trunk/LayoutTests/ChangeLog	2016-02-01 04:44:07 UTC (rev 195950)
@@ -1,3 +1,16 @@
+2016-01-31  Brent Fulgham  <[email protected]>
+
+        Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
+        https://bugs.webkit.org/show_bug.cgi?id=153657
+        <rdar://problem/24413107>
+
+        Reviewed by Darin Adler.
+
+        * http/tests/plugins/visible_plugins-expected.txt: Added.
+        * http/tests/plugins/visible_plugins.html: Added.
+        * platform/mac-wk2/http/tests/plugins: Added.
+        * platform/mac-wk2/http/tests/plugins/visible_plugins-expected.txt: Added.
+
 2016-01-31  Doug Russell  <[email protected]>
 
         AX: Add a boundary value to AXTextStateChangeType

Added: trunk/LayoutTests/http/tests/plugins/visible_plugins-expected.txt (0 => 195950)


--- trunk/LayoutTests/http/tests/plugins/visible_plugins-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/visible_plugins-expected.txt	2016-02-01 04:44:07 UTC (rev 195950)
@@ -0,0 +1,3 @@
+Check we only display the valid set of "public" plugins.
+
+None

Added: trunk/LayoutTests/http/tests/plugins/visible_plugins.html (0 => 195950)


--- trunk/LayoutTests/http/tests/plugins/visible_plugins.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/visible_plugins.html	2016-02-01 04:44:07 UTC (rev 195950)
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script>
+function test()
+{
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+        internals.setShowAllPlugins(false);
+    }
+
+    var pluginList = "";
+    Array.prototype.forEach.call(navigator.plugins, function(plugin) {
+        if (pluginList.length)
+            pluginList = pluginList + "\n";
+        pluginList = pluginList + plugin.name;
+    });
+
+    if (pluginList.length)
+        document.getElementById("result").innerText = pluginList;
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+</script>
+</head>
+<body _onload_="test();">
+<p>
+    Check we only display the valid set of "public" plugins.
+</p>
+<div id="result">None</div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/visible_plugins-expected.txt (0 => 195950)


--- trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/visible_plugins-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/visible_plugins-expected.txt	2016-02-01 04:44:07 UTC (rev 195950)
@@ -0,0 +1,3 @@
+Check we only display the valid set of "public" plugins.
+
+WebKit built-in PDF

Modified: trunk/Source/WebCore/ChangeLog (195949 => 195950)


--- trunk/Source/WebCore/ChangeLog	2016-02-01 04:09:02 UTC (rev 195949)
+++ trunk/Source/WebCore/ChangeLog	2016-02-01 04:44:07 UTC (rev 195950)
@@ -1,3 +1,22 @@
+2016-01-31  Brent Fulgham  <[email protected]>
+
+        Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
+        https://bugs.webkit.org/show_bug.cgi?id=153657
+        <rdar://problem/24413107>
+
+        Reviewed by Darin Adler.
+
+        Tested by http/tests/plugins/visible_plugins.html.
+
+        A number of poorly-coded sites break when WebKit reports that it understands PDF mime types,
+        but does not have a list of plugins that the site can iterate through.
+
+        To avoid this compatibility problem, we should also expose the "WebKit built-in PDF" plugin
+        to avoid this edge case.
+
+        * plugins/PluginData.cpp:
+        (WebCore::shouldBePubliclyVisible): Add "WebKit built-in PDF" plugin.
+
 2016-01-31  Doug Russell  <[email protected]>
 
         AX: Add a boundary value to AXTextStateChangeType

Modified: trunk/Source/WebCore/plugins/PluginData.cpp (195949 => 195950)


--- trunk/Source/WebCore/plugins/PluginData.cpp	2016-02-01 04:09:02 UTC (rev 195949)
+++ trunk/Source/WebCore/plugins/PluginData.cpp	2016-02-01 04:44:07 UTC (rev 195950)
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "PluginData.h"
 
+#include "LocalizedStrings.h"
 #include "Page.h"
 #include "PlatformStrategies.h"
 #include "PluginStrategy.h"
@@ -45,6 +46,18 @@
     return plugins;
 }
 
+#if PLATFORM(COCOA)
+static inline bool isBuiltInPDFPlugIn(const PluginInfo& plugIn)
+{
+    return plugIn.name == builtInPDFPluginName();
+}
+#else
+static inline bool isBuiltInPDFPlugIn(const PluginInfo&)
+{
+    return false;
+}
+#endif
+
 static bool shouldBePubliclyVisible(const PluginInfo& plugin)
 {
     // For practical website compatibility, there are a few plugins that need to be
@@ -52,7 +65,8 @@
     // there is a good track record that this does not harm compatibility.
     return plugin.name.containsIgnoringASCIICase("Shockwave")
         || plugin.name.containsIgnoringASCIICase("QuickTime")
-        || plugin.name.containsIgnoringASCIICase("Java");
+        || plugin.name.containsIgnoringASCIICase("Java")
+        || isBuiltInPDFPlugIn(plugin);
 }
 
 Vector<PluginInfo> PluginData::publiclyVisiblePlugins() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to