<!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>[175903] releases/WebKitGTK/webkit-2.6</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/175903">175903</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-11 04:14:15 -0800 (Tue, 11 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/175074">r175074</a> - SVG loaded through html &lt;img&gt; can't request to load any external resources.
https://bugs.webkit.org/show_bug.cgi?id=137762.

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2014-10-22
Reviewed by Daniel Bates.

Source/WebCore:

SVG images have unique security rules that prevent them from loading any external
resources. This patch enforces these rules in CachedResourceLoader::canRequest for
all non-data-uri resources.

The fix and the tests are ported but modified a little from the chromium fix:
http://src.chromium.org/viewvc/blink?view=rev&amp;rev=176084

Test: http/tests/security/svg-image-with-cached-remote-image.html
      http/tests/security/svg-image-with-css-cross-domain.html

For the SVG image, prevent loading any external sub-resource except for data urls.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):

LayoutTests:

Ensure that SVG images, which are loaded through the &lt;img&gt; tag or through the
CSS background image, cannot load any external sub-resource except for data-
URL resources (though this doesn't work at the time of writing, see bug #137941).
Also ensure the same rule is enforced on cached resources.

The tests are ported but modified a little from the chromium fix:
http://src.chromium.org/viewvc/blink?view=rev&amp;rev=176084

Set the circle background to orange
* http/tests/security/resources/image-with-css-cross-domain-circle.css: Added.
(circle):

Set the circle stroke-width = 2 and the circle stroke = red
* http/tests/security/resources/image-with-css-cross-domain-circle2.css: Added.
(circle):

This svg references the two css files: one is relative path and the other is absolute path
* http/tests/security/resources/image-with-css-cross-domain.svg: Added.

This svg references an external image.
* http/tests/security/resources/image-with-remote-image.svg: Added.

A helper css which sets the formatting style for some html tags
* http/tests/security/svg-image-with-css-cross-domain.css: Added.
(span):
(span.circle-css-cross-domain):
(embed):
(iframe):

Test the svg which is referenced as a cached image by an &lt;object&gt; tag, does not load
external sub-resource.
* http/tests/security/svg-image-with-cached-remote-image-expected.html: Added.
* http/tests/security/svg-image-with-cached-remote-image.html: Added.

Test loading sub-resources for an svg which is included in the html by different ways
and which references external css files.
Ensure the image object does not load any external sub-resources.
* http/tests/security/svg-image-with-css-cross-domain-expected.html: Added.
* http/tests/security/svg-image-with-css-cross-domain.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreloadercacheCachedResourceLoadercpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomaincirclecss">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle.css</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomaincircle2css">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle2.css</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomainsvg">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain.svg</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithremoteimagesvg">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-remote-image.svg</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcachedremoteimageexpectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcachedremoteimagehtml">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomainexpectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomaincss">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.css</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomainhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog (175902 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-11-11 12:11:51 UTC (rev 175902)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2014-10-22  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        SVG loaded through html &lt;img&gt; can't request to load any external resources.
+        https://bugs.webkit.org/show_bug.cgi?id=137762.
+
+        Reviewed by Daniel Bates.
+
+        Ensure that SVG images, which are loaded through the &lt;img&gt; tag or through the
+        CSS background image, cannot load any external sub-resource except for data-
+        URL resources (though this doesn't work at the time of writing, see bug #137941).
+        Also ensure the same rule is enforced on cached resources.
+
+        The tests are ported but modified a little from the chromium fix:
+        http://src.chromium.org/viewvc/blink?view=rev&amp;rev=176084
+
+        Set the circle background to orange
+        * http/tests/security/resources/image-with-css-cross-domain-circle.css: Added.
+        (circle):
+
+        Set the circle stroke-width = 2 and the circle stroke = red
+        * http/tests/security/resources/image-with-css-cross-domain-circle2.css: Added.
+        (circle):
+
+        This svg references the two css files: one is relative path and the other is absolute path
+        * http/tests/security/resources/image-with-css-cross-domain.svg: Added.
+
+        This svg references an external image.
+        * http/tests/security/resources/image-with-remote-image.svg: Added.
+
+        A helper css which sets the formatting style for some html tags
+        * http/tests/security/svg-image-with-css-cross-domain.css: Added.
+        (span):
+        (span.circle-css-cross-domain):
+        (embed):
+        (iframe):
+
+        Test the svg which is referenced as a cached image by an &lt;object&gt; tag, does not load
+        external sub-resource.
+        * http/tests/security/svg-image-with-cached-remote-image-expected.html: Added.
+        * http/tests/security/svg-image-with-cached-remote-image.html: Added.
+
+        Test loading sub-resources for an svg which is included in the html by different ways
+        and which references external css files.
+        Ensure the image object does not load any external sub-resources.
+        * http/tests/security/svg-image-with-css-cross-domain-expected.html: Added.
+        * http/tests/security/svg-image-with-css-cross-domain.html: Added.
+
</ins><span class="cx"> 2014-10-22  Shivakumar JM  &lt;shiva.jm@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         XMLHttpRequest should support attribute responseURL as per latest XHR spec.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomaincirclecss"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle.css (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle.css                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle.css        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+circle {
+    fill: orange;
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomaincircle2css"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle2.css (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle2.css                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain-circle2.css        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+circle {
+    stroke: red;
+    stroke-width: 2;
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithcsscrossdomainsvg"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain.svg (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain.svg                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-css-cross-domain.svg        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
+&lt;?xml-stylesheet type=&quot;text/css&quot; href=&quot;image-with-css-cross-domain-circle.css&quot;?&gt;
+&lt;?xml-stylesheet type=&quot;text/css&quot; href=&quot;http://localhost:8000/security/resources/image-with-css-cross-domain-circle2.css&quot;?&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;68&quot; height=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot; &gt;
+  &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecurityresourcesimagewithremoteimagesvg"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-remote-image.svg (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-remote-image.svg                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/resources/image-with-remote-image.svg        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;
+  &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;#0f0&quot;/&gt;
+  &lt;rect x=&quot;20%&quot; y=&quot;20%&quot; width=&quot;60%&quot; height=&quot;60%&quot; stroke-width=&quot;1&quot; stroke=&quot;black&quot; fill=&quot;transparent&quot;/&gt;
+  &lt;image xlink:href=&quot;http://localhost:8000/security/resources/abe.png&quot; x=&quot;20%&quot; y=&quot;20%&quot; width=&quot;60%&quot; height=&quot;60%&quot; onload=&quot;window.parent.notifyDidLoadSVG()&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcachedremoteimageexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image-expected.html (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image-expected.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image-expected.html        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;SVG loaded in &amp;lt;img&amp;gt; (should not see head of Abe Lincoln)&lt;/p&gt;
+&lt;svg width=&quot;100&quot; height=&quot;100&quot;&gt;
+  &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;#0f0&quot;/&gt;
+  &lt;rect x=&quot;20%&quot; y=&quot;20%&quot; width=&quot;60%&quot; height=&quot;60%&quot; stroke-width=&quot;1&quot; stroke=&quot;black&quot; fill=&quot;transparent&quot;/&gt;
+&lt;/svg&gt;
+&lt;br&gt;
+&lt;p&gt;SVG loaded in &amp;lt;object&amp;gt; (should see head of Abe Lincoln)&lt;/p&gt;
+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;
+  &lt;rect width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;#0f0&quot;/&gt;
+  &lt;rect x=&quot;20%&quot; y=&quot;20%&quot; width=&quot;60%&quot; height=&quot;60%&quot; stroke-width=&quot;1&quot; stroke=&quot;black&quot; fill=&quot;transparent&quot;/&gt;
+  &lt;image xlink:href=&quot;resources/abe.png&quot; x=&quot;20%&quot; y=&quot;20%&quot; width=&quot;60%&quot; height=&quot;60%&quot;/&gt;
+&lt;/svg&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcachedremoteimagehtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image.html (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-cached-remote-image.html        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+  if (window.testRunner)
+    testRunner.waitUntilDone();
+
+  // Called from resources/image-with-remote-image.svg when loaded inside &lt;object&gt;.
+  function notifyDidLoadSVG() 
+  {
+    function done() 
+    {
+      if (window.testRunner)
+        testRunner.notifyDone();
+    }
+    var image = document.getElementById(&quot;non-interactive-SVG&quot;);
+    image.onload = done;
+    image.src = &quot;resources/image-with-remote-image.svg&quot;;
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;p&gt;SVG loaded in &amp;lt;img&amp;gt; (should not see head of Abe Lincoln)&lt;/p&gt;
+  &lt;img id=&quot;non-interactive-SVG&quot; src=&quot;&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;
+  &lt;br&gt;
+  &lt;p&gt;SVG loaded in &amp;lt;object&amp;gt; (should see head of Abe Lincoln)&lt;/p&gt;
+  &lt;object id=&quot;interactive-SVG&quot; data=&quot;resources/image-with-remote-image.svg&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&lt;/object&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomainexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain-expected.html (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain-expected.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain-expected.html        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;svg-image-with-css-cross-domain.css&quot;/&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;h1&gt;WebKit bug&lt;/h1&gt;
+    &lt;h3&gt;SVG circle with same-origin and different-origin CSS&lt;/h3&gt;
+    &lt;p&gt;Expected: 2 gray circles, 4 orange circles with red borders, 2 gray circle.&lt;/p&gt;
+    &lt;p&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot; /&gt;
+        &lt;/svg&gt;
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot; /&gt;
+        &lt;/svg&gt;
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; stroke=&quot;red&quot; stroke-width=&quot;2&quot; fill=&quot;orange&quot; /&gt;
+        &lt;/svg&gt;        
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; stroke=&quot;red&quot; stroke-width=&quot;2&quot; fill=&quot;orange&quot; /&gt;
+        &lt;/svg&gt;        
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; stroke=&quot;red&quot; stroke-width=&quot;2&quot; fill=&quot;orange&quot; /&gt;
+        &lt;/svg&gt;        
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; stroke=&quot;red&quot; stroke-width=&quot;2&quot; fill=&quot;orange&quot; /&gt;
+        &lt;/svg&gt;        
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot; /&gt;
+        &lt;/svg&gt;
+      &lt;/span&gt;
+      &lt;span class=&quot;image&quot;&gt;
+        &lt;svg height=&quot;68&quot; width=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot; /&gt;
+        &lt;/svg&gt;
+      &lt;/span&gt;
+    &lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomaincss"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.css (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.css                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.css        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+span {
+  display: inline-block;
+  height: 68px;
+  width: 68px;
+}
+
+span.circle-css-cross-domain {
+  background-image: url('resources/image-with-css-cross-domain.svg');
+}
+
+embed {
+  display: inline-block;
+}
+
+iframe {
+  border-width: 0px;
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestshttptestssecuritysvgimagewithcsscrossdomainhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.html (0 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/http/tests/security/svg-image-with-css-cross-domain.html        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;svg-image-with-css-cross-domain.css&quot;/&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;h1&gt;WebKit bug&lt;/h1&gt;
+    &lt;h3&gt;SVG circle with same-origin and different-origin CSS&lt;/h3&gt;
+    &lt;p&gt;Expected: 2 gray circles, 4 orange circles with red borders, 2 gray circle.&lt;/p&gt;
+    &lt;p&gt;
+      &lt;span class=&quot;image&quot;&gt;&lt;img src=&quot;resources/image-with-css-cross-domain.svg&quot; alt=&quot;circle&quot; width=&quot;68&quot; height=&quot;68&quot;/&gt;&lt;/span&gt;
+      &lt;span class=&quot;image circle-css-cross-domain&quot;&gt;&lt;/span&gt;
+      &lt;object data=&quot;resources/image-with-css-cross-domain.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;68&quot; height=&quot;68&quot;&gt;&lt;/object&gt;
+      &lt;embed src=&quot;resources/image-with-css-cross-domain.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;68&quot; height=&quot;68&quot;&gt;&lt;/embed&gt;
+      &lt;iframe src=&quot;resources/image-with-css-cross-domain.svg&quot; width=&quot;68&quot; height=&quot;68&quot;&gt;&lt;/iframe&gt;
+      &lt;iframe src=&quot;resources/image-with-css-cross-domain.svg&quot; width=&quot;68&quot; height=&quot;68&quot; sandbox=&quot;&quot;&gt;&lt;/iframe&gt;
+      &lt;span class=&quot;image&quot;&gt;&lt;img width=&quot;68&quot; height=&quot;68&quot; alt=&quot;circle&quot; src=&quot;data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSJjaXJjbGUuY3NzIj8+DQo8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQvY3NzIiBocmVmPSJodHRwOi8vZG9tMi5jaHJvbWVidWcyLnRlc3QvY2lyY2xlMi5jc3MiPz4NCjxzdmcNCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyINCiAgIHdpZHRoPSI2OCINCiAgIGhlaWdodD0iNjgiDQogICB2aWV3Qm94PSItMzQgLTM0IDY4IDY4Ig0KICAgdmVyc2lvbj0iMS4xIj4NCiAgPGNpcmNsZQ0KICAgICBjeD0iMCINCiAgICAgY3k9IjAiDQogICAgIHI9IjI0Ig0KICAgICBmaWxsPSIjYzhjOGM4Ii8+DQo8L3N2Zz4=&quot;/&gt;&lt;/span&gt;
+          &lt;span class=&quot;image&quot;&gt;
+        &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
+        &lt;?xml-stylesheet type=&quot;text/css&quot; href=&quot;circle.css&quot;?&gt;
+        &lt;?xml-stylesheet type=&quot;text/css&quot; href=&quot;http://localhost:8000/security/circle2.css&quot;?&gt;
+        &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;68&quot; height=&quot;68&quot; viewBox=&quot;-34 -34 68 68&quot; version=&quot;1.1&quot;&gt;
+          &lt;circle cx=&quot;0&quot; cy=&quot;0&quot; r=&quot;24&quot; fill=&quot;#c8c8c8&quot;/&gt;
+        &lt;/svg&gt;
+      &lt;/span&gt;
+    &lt;/p&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (175902 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-11-11 12:11:51 UTC (rev 175902)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-10-22  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        SVG loaded through html &lt;img&gt; can't request to load any external resources.
+        https://bugs.webkit.org/show_bug.cgi?id=137762.
+
+        Reviewed by Daniel Bates.
+
+        SVG images have unique security rules that prevent them from loading any external
+        resources. This patch enforces these rules in CachedResourceLoader::canRequest for
+        all non-data-uri resources.
+
+        The fix and the tests are ported but modified a little from the chromium fix:
+        http://src.chromium.org/viewvc/blink?view=rev&amp;rev=176084
+
+        Test: http/tests/security/svg-image-with-cached-remote-image.html
+              http/tests/security/svg-image-with-css-cross-domain.html
+
+        For the SVG image, prevent loading any external sub-resource except for data urls.
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::canRequest):
+
</ins><span class="cx"> 2014-10-22  Shivakumar JM  &lt;shiva.jm@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         XMLHttpRequest should support attribute responseURL as per latest XHR spec.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/loader/cache/CachedResourceLoader.cpp (175902 => 175903)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-11 12:11:51 UTC (rev 175902)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-11 12:14:15 UTC (rev 175903)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><span class="cx"> #include &quot;CachedScript.h&quot;
</span><span class="cx"> #include &quot;CachedXSLStyleSheet.h&quot;
</span><ins>+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
</ins><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="lines">@@ -379,6 +381,12 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // SVG Images have unique security rules that prevent all subresource requests except for data urls.
+    if (type != CachedResource::MainResource &amp;&amp; frame() &amp;&amp; frame()-&gt;page()) {
+        if (frame()-&gt;page()-&gt;chrome().client().isSVGImageChromeClient() &amp;&amp; !url.protocolIsData())
+            return false;
+    }
+
</ins><span class="cx">     // Last of all, check for insecure content. We do this last so that when
</span><span class="cx">     // folks block insecure content with a CSP policy, they don't get a warning.
</span><span class="cx">     // They'll still get a warning in the console about CSP blocking the load.
</span></span></pre>
</div>
</div>

</body>
</html>