<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203611] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203611">203611</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2016-07-22 13:33:11 -0700 (Fri, 22 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>CSP: object-src and plugin-types directives are not respected for plugin replacements
https://bugs.webkit.org/show_bug.cgi?id=159761
<rdar://problem/27365724>
Reviewed by Brent Fulgham.
Source/WebCore:
Apply the Content Security Policy (CSP) object-src and plugin-types directives to content that will
load with a plugin replacement.
Tests: security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html
security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html
security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent): Added.
(WebCore::HTMLPlugInImageElement::requestObject): Only request loading plugin content if we
are allowed to load such content.
* html/HTMLPlugInImageElement.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::pluginIsLoadable): Removed code to check CSP as we will check CSP
earlier in HTMLPlugInImageElement::requestObject().
(WebCore::SubframeLoader::requestPlugin): Ditto.
(WebCore::SubframeLoader::isPluginContentAllowedByContentSecurityPolicy): Deleted; moved implementation
to HTMLPlugInImageElement::allowedToLoadPluginContent().
(WebCore::SubframeLoader::requestObject): Deleted.
* loader/SubframeLoader.h:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded): Changed signature from a non-const
function to a const function since these functions do not modify |this|.
* page/csp/ContentSecurityPolicy.h:
LayoutTests:
Add layout tests to ensure that we apply the CSP object-src and plugin-types directives to content
that loads with either the QuickTime plugin replacement or YouTube plugin replacement.
* security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html: Added.
* security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html: Added.
* security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html: Added.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html: Added.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html: Added.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html: Added.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt: Added.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html: Added.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementh">trunk/Source/WebCore/html/HTMLPlugInImageElement.h</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoaderh">trunk/Source/WebCore/loader/SubframeLoader.h</a></li>
<li><a href="#trunkSourceWebCorepagecspContentSecurityPolicycpp">trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCorepagecspContentSecurityPolicyh">trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksquicktimepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksquicktimepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksyoutubepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksyoutubepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsquicktimepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsquicktimepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsyoutubepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsyoutubepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementwithoutmimetypeexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementwithoutmimetypehtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementwithoutmimetypeexpectedtxt">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementwithoutmimetypehtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html</a></li>
<li><a href="#trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementhtml">trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/LayoutTests/ChangeLog        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-07-22 Daniel Bates <dabates@apple.com>
+
+ CSP: object-src and plugin-types directives are not respected for plugin replacements
+ https://bugs.webkit.org/show_bug.cgi?id=159761
+ <rdar://problem/27365724>
+
+ Reviewed by Brent Fulgham.
+
+ Add layout tests to ensure that we apply the CSP object-src and plugin-types directives to content
+ that loads with either the QuickTime plugin replacement or YouTube plugin replacement.
+
+ * security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html: Added.
+ * security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html: Added.
+ * security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html: Added.
+ * security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html: Added.
+ * security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html: Added.
+
</ins><span class="cx"> 2016-07-22 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Parameters to Node.replaceChild() / insertBefore() should be mandatory
</span></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksquicktimepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load yellow.mov because it does not appear in the object-src directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksquicktimepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="object-src 'none'">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<embed id="embed" width="640" height="480" src="../../plugins/resources/yellow.mov" qtsrc="../../plugins/resources/orange.mov">
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksyoutubepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load https://www.youtube.com/v/UF8uR6Z6KLc because it does not appear in the object-src directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicyobjectsrcnoneblocksyoutubepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="object-src 'none'">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<object width="425" height="350" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
+ <embed width="425" height="350" type="application/x-shockwave-flash" src="https://www.youtube.com/v/UF8uR6Z6KLc">
+</object>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsquicktimepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+ALERT: PASS did load plugin.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsquicktimepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types video/quicktime">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+</script>
+</head>
+<body>
+<embed id="embed" type="video/quicktime" width="640" height="480" src="../../plugins/resources/yellow.mov" qtsrc="../../plugins/resources/orange.mov" postdomevents=true>
+<script>
+document.getElementById("embed").addEventListener("qt_begin", function () {
+ alert("PASS did load plugin.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}, true);
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsyoutubepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+Blocked access to external URL https://www.youtube.com/embed/UF8uR6Z6KLc?showinfo=0
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesallowsyoutubepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types application/x-shockwave-flash">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+// Waiting at least 100ms seems to ensure that YouTube plugin replacement has loaded.
+window.setTimeout(function () {
+ if (window.testRunner)
+ testRunner.notifyDone();
+}, 100);
+</script>
+</head>
+<body>
+<object width="425" height="350" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
+ <embed width="425" height="350" type="application/x-shockwave-flash" src="https://www.youtube.com/v/UF8uR6Z6KLc">
+</object>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load yellow.mov because its MIME type does not appear in the plugin-types directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementwithoutmimetypeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load yellow.mov because its MIME type does not appear in the plugin-types directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementwithoutmimetypehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types text/html">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<embed width="640" height="480" src="../../plugins/resources/yellow.mov" qtsrc="../../plugins/resources/orange.mov">
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksquicktimepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types text/html">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<embed type="video/quicktime" width="640" height="480" src="../../plugins/resources/yellow.mov" qtsrc="../../plugins/resources/orange.mov">
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load https://www.youtube.com/v/UF8uR6Z6KLc because its MIME type does not appear in the plugin-types directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementwithoutmimetypeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type-expected.txt        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+CONSOLE MESSAGE: Refused to load https://www.youtube.com/v/UF8uR6Z6KLc because its MIME type does not appear in the plugin-types directive of the Content Security Policy.
+
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementwithoutmimetypehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types text/html">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<object width="425" height="350" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
+ <embed width="425" height="350" src="https://www.youtube.com/v/UF8uR6Z6KLc">
+</object>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssecuritycontentSecurityPolicypluginstypesblocksyoutubepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html (0 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="plugin-types text/html">
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+if (window.internals)
+ window.internals.settings.setPluginReplacementEnabled(true);
+
+function done()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+document.addEventListener("securitypolicyviolation", done, false);
+</script>
+</head>
+<body>
+<object width="425" height="350" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+ codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
+ <embed width="425" height="350" type="application/x-shockwave-flash" src="https://www.youtube.com/v/UF8uR6Z6KLc">
+</object>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/ChangeLog        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-07-22 Daniel Bates <dabates@apple.com>
+
+ CSP: object-src and plugin-types directives are not respected for plugin replacements
+ https://bugs.webkit.org/show_bug.cgi?id=159761
+ <rdar://problem/27365724>
+
+ Reviewed by Brent Fulgham.
+
+ Apply the Content Security Policy (CSP) object-src and plugin-types directives to content that will
+ load with a plugin replacement.
+
+ Tests: security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html
+ security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html
+ security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
+ security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
+ security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
+ security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html
+ security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html
+ security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html
+
+ * html/HTMLPlugInImageElement.cpp:
+ (WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent): Added.
+ (WebCore::HTMLPlugInImageElement::requestObject): Only request loading plugin content if we
+ are allowed to load such content.
+ * html/HTMLPlugInImageElement.h:
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::pluginIsLoadable): Removed code to check CSP as we will check CSP
+ earlier in HTMLPlugInImageElement::requestObject().
+ (WebCore::SubframeLoader::requestPlugin): Ditto.
+ (WebCore::SubframeLoader::isPluginContentAllowedByContentSecurityPolicy): Deleted; moved implementation
+ to HTMLPlugInImageElement::allowedToLoadPluginContent().
+ (WebCore::SubframeLoader::requestObject): Deleted.
+ * loader/SubframeLoader.h:
+ * page/csp/ContentSecurityPolicy.cpp:
+ (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded): Changed signature from a non-const
+ function to a const function since these functions do not modify |this|.
+ * page/csp/ContentSecurityPolicy.h:
+
</ins><span class="cx"> 2016-07-22 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Parameters to Node.replaceChild() / insertBefore() should be mandatory
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Chrome.h"
</span><span class="cx"> #include "ChromeClient.h"
</span><ins>+#include "ContentSecurityPolicy.h"
</ins><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventHandler.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="lines">@@ -770,8 +771,33 @@
</span><span class="cx"> HTMLPlugInElement::defaultEventHandler(event);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool HTMLPlugInImageElement::allowedToLoadPluginContent(const String& url, const String& mimeType) const
+{
+ URL completedURL;
+ if (!url.isEmpty())
+ completedURL = document().completeURL(url);
+
+ ASSERT(document().contentSecurityPolicy());
+ const ContentSecurityPolicy& contentSecurityPolicy = *document().contentSecurityPolicy();
+
+ contentSecurityPolicy.upgradeInsecureRequestIfNeeded(completedURL, ContentSecurityPolicy::InsecureRequestType::Load);
+
+ String declaredMimeType = document().isPluginDocument() && document().ownerElement() ?
+ document().ownerElement()->attributeWithoutSynchronization(HTMLNames::typeAttr) : attributeWithoutSynchronization(HTMLNames::typeAttr);
+ bool isInUserAgentShadowTree = this->isInUserAgentShadowTree();
+ return contentSecurityPolicy.allowObjectFromSource(completedURL, isInUserAgentShadowTree) && contentSecurityPolicy.allowPluginType(mimeType, declaredMimeType, completedURL, isInUserAgentShadowTree);
+}
+
</ins><span class="cx"> bool HTMLPlugInImageElement::requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
</span><span class="cx"> {
</span><ins>+ if (url.isEmpty() && mimeType.isEmpty())
+ return false;
+
+ if (!allowedToLoadPluginContent(url, mimeType)) {
+ renderEmbeddedObject()->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
+ return false;
+ }
+
</ins><span class="cx"> if (HTMLPlugInElement::requestObject(url, mimeType, paramNames, paramValues))
</span><span class="cx"> return true;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -111,6 +111,8 @@
</span><span class="cx"> bool isPlugInImageElement() const final { return true; }
</span><span class="cx"> bool isRestartedPlugin() const final { return m_isRestartedPlugin; }
</span><span class="cx">
</span><ins>+ bool allowedToLoadPluginContent(const String& url, const String& mimeType) const;
+
</ins><span class="cx"> void finishParsingChildren() final;
</span><span class="cx"> void didAddUserAgentShadowRoot(ShadowRoot*) final;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -108,22 +108,8 @@
</span><span class="cx"> return shouldUsePlugin(completedURL, mimeType, false, useFallback);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool SubframeLoader::isPluginContentAllowedByContentSecurityPolicy(HTMLPlugInImageElement& pluginElement, const URL& url, const String& mimeType) const
</del><ins>+bool SubframeLoader::pluginIsLoadable(const URL& url, const String& mimeType)
</ins><span class="cx"> {
</span><del>- if (!document())
- return true;
-
- ASSERT(document()->contentSecurityPolicy());
- const ContentSecurityPolicy& contentSecurityPolicy = *document()->contentSecurityPolicy();
-
- String declaredMimeType = document()->isPluginDocument() && document()->ownerElement() ?
- document()->ownerElement()->attributeWithoutSynchronization(HTMLNames::typeAttr) : pluginElement.attributeWithoutSynchronization(HTMLNames::typeAttr);
- bool isInUserAgentShadowTree = pluginElement.isInUserAgentShadowTree();
- return contentSecurityPolicy.allowObjectFromSource(url, isInUserAgentShadowTree) && contentSecurityPolicy.allowPluginType(mimeType, declaredMimeType, url, isInUserAgentShadowTree);
-}
-
-bool SubframeLoader::pluginIsLoadable(HTMLPlugInImageElement& pluginElement, const URL& url, const String& mimeType)
-{
</del><span class="cx"> if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
</span><span class="cx"> if (!m_frame.settings().isJavaEnabled())
</span><span class="cx"> return false;
</span><span class="lines">@@ -140,12 +126,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!isPluginContentAllowedByContentSecurityPolicy(pluginElement, url, mimeType)) {
- RenderEmbeddedObject* renderer = pluginElement.renderEmbeddedObject();
- renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
- return false;
- }
-
</del><span class="cx"> if (!m_frame.loader().mixedContentChecker().canRunInsecureContent(document()->securityOrigin(), url))
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -161,7 +141,7 @@
</span><span class="cx"> if ((!allowPlugins() && !MIMETypeRegistry::isApplicationPluginMIMEType(mimeType)))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (!pluginIsLoadable(ownerElement, url, mimeType))
</del><ins>+ if (!pluginIsLoadable(url, mimeType))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> ASSERT(ownerElement.hasTagName(objectTag) || ownerElement.hasTagName(embedTag));
</span><span class="lines">@@ -242,12 +222,6 @@
</span><span class="cx"> return success;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!isPluginContentAllowedByContentSecurityPolicy(ownerElement, completedURL, mimeType)) {
- RenderEmbeddedObject* renderer = ownerElement.renderEmbeddedObject();
- renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
- return false;
- }
-
</del><span class="cx"> // If the plug-in element already contains a subframe, loadOrRedirectSubframe will re-use it. Otherwise,
</span><span class="cx"> // it will create a new frame and set it as the RenderWidget's Widget, causing what was previously
</span><span class="cx"> // in the widget to be torn down.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.h (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.h        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/loader/SubframeLoader.h        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -77,10 +77,8 @@
</span><span class="cx"> Frame* loadSubframe(HTMLFrameOwnerElement&, const URL&, const String& name, const String& referrer);
</span><span class="cx"> bool loadPlugin(HTMLPlugInImageElement&, const URL&, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
</span><span class="cx">
</span><del>- bool isPluginContentAllowedByContentSecurityPolicy(HTMLPlugInImageElement&, const URL&, const String& mimeType) const;
-
</del><span class="cx"> bool shouldUsePlugin(const URL&, const String& mimeType, bool hasFallback, bool& useFallback);
</span><del>- bool pluginIsLoadable(HTMLPlugInImageElement&, const URL&, const String& mimeType);
</del><ins>+ bool pluginIsLoadable(const URL&, const String& mimeType);
</ins><span class="cx">
</span><span class="cx"> Document* document() const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagecspContentSecurityPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -829,7 +829,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ContentSecurityPolicy::upgradeInsecureRequestIfNeeded(ResourceRequest& request, InsecureRequestType requestType)
</del><ins>+void ContentSecurityPolicy::upgradeInsecureRequestIfNeeded(ResourceRequest& request, InsecureRequestType requestType) const
</ins><span class="cx"> {
</span><span class="cx"> URL url = request.url();
</span><span class="cx"> upgradeInsecureRequestIfNeeded(url, requestType);
</span><span class="lines">@@ -836,7 +836,7 @@
</span><span class="cx"> request.setURL(url);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ContentSecurityPolicy::upgradeInsecureRequestIfNeeded(URL& url, InsecureRequestType requestType)
</del><ins>+void ContentSecurityPolicy::upgradeInsecureRequestIfNeeded(URL& url, InsecureRequestType requestType) const
</ins><span class="cx"> {
</span><span class="cx"> if (!url.protocolIs("http") && !url.protocolIs("ws"))
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorepagecspContentSecurityPolicyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h (203610 => 203611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h        2016-07-22 19:54:13 UTC (rev 203610)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h        2016-07-22 20:33:11 UTC (rev 203611)
</span><span class="lines">@@ -155,8 +155,8 @@
</span><span class="cx"> void setUpgradeInsecureRequests(bool);
</span><span class="cx"> bool upgradeInsecureRequests() const { return m_upgradeInsecureRequests; }
</span><span class="cx"> enum class InsecureRequestType { Load, FormSubmission, Navigation };
</span><del>- void upgradeInsecureRequestIfNeeded(ResourceRequest&, InsecureRequestType);
- void upgradeInsecureRequestIfNeeded(URL&, InsecureRequestType);
</del><ins>+ void upgradeInsecureRequestIfNeeded(ResourceRequest&, InsecureRequestType) const;
+ void upgradeInsecureRequestIfNeeded(URL&, InsecureRequestType) const;
</ins><span class="cx">
</span><span class="cx"> HashSet<RefPtr<SecurityOrigin>>&& takeNavigationRequestsToUpgrade();
</span><span class="cx"> void inheritInsecureNavigationRequestsToUpgradeFromOpener(const ContentSecurityPolicy&);
</span></span></pre>
</div>
</div>
</body>
</html>