<!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>[179626] 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/179626">179626</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-02-04 12:55:21 -0800 (Wed, 04 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>When using SVG as an image, we should load datauri images when these images are not in the image cache.
https://bugs.webkit.org/show_bug.cgi?id=99677.

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2015-02-04
Reviewed by Darin Adler.
Source/WebCore:

Data URI sub-resources are not loaded because the networking context of FrameLoader
attached to the SubResourceLoader is set to null. This is done intentionally to
disallow any resource from loading external sub-resources. For example if an &lt;img&gt;
tag has its 'src' attribute points to an svg file, this svg is not allowed to load
an external image through the 'xlink' attribute of an &lt;image&gt; element. This restriction
is not valid if the value of the 'xlink' attribute is a data URI. In this case the image
should be loaded into memory since there is no network traffic involved. All we need
to do is to decode the data part of the URI.

The fix is to pass the root FrameLoader, which has a valid NetworkingContext, through
the FrameLoaderClient, to the ResourceHandle::create() which uses the NetworkingContext
to decode the data and fire the load events of the data URI resources.

Tests:  svg/as-image/svg-image-with-data-uri-background.html
        svg/as-image/svg-image-with-data-uri-from-canvas.html
        svg/as-image/svg-image-with-data-uri-images-disabled.html
        svg/as-image/svg-image-with-data-uri-reloading.html
        svg/as-image/svg-image-with-data-uri-use-data-uri.svg
        svg/as-image/svg-image-with-svg-data-uri.html

* accessibility/AccessibilityRenderObject.cpp:
Remove unreferenced header file.

* loader/FrameLoaderClient.h:
Define the null virtual function dataProtocolLoader() which should return the FrameLoader
for loading data URI resources.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::dataProtocolFrameLoader):
* loader/ResourceLoader.h:
Add ResourceLoader::dataProtocolFrameLoader() which returns the root FrameLoader. The
root FrameLoader is used to get a valid NetworkingContext which can be passed to
ResourceHandle::create() when url().protocolIsData().

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
(WebCore::CachedImage::finishLoading):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldPerformImageLoad):
(WebCore::CachedResourceLoader::shouldDeferImageLoad):
* loader/cache/CachedResourceLoader.h:
Allow loading data URI sub-resources as long as loading images is not disabled. Also we
need to call setDataProtocolLoader() before calling setData() for the isSVGImage case,
setData() will create a page by calling Page::createPageFromBuffer() via SVGImage::dataChanged(),
and we need to pass the correct FrameLoaderClient to the created FrameLoader of the main
 frame of this page.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::dataChanged):
* svg/graphics/SVGImage.h:
Create a new FrameLoaderClient of type SVGFrameLoaderClient and set it in pageConfiguration
which is used when creating the page from the SVG data URI.

* WebCore.xcodeproj/project.pbxproj:
* svg/graphics/SVGImageChromeClient.h: Removed.
* svg/graphics/SVGImageClients.h: Added.
Add a new class SVGImageChromeClient which overrides the function dataProtocolLoader().
Rename the header file SVGImageChromeClient.h to be SVGImageClients.h since it now
includes the classes SVGImageChromeClient and SVGFrameLoaderClient.

LayoutTests:

* svg/as-image/resources/image-with-nested-data-uri-images.svg: Added.
This SVG has a tree of depth = 5 of nested data URI images. All the data URI images are
SVG images expect the innermost one which is a png data URI image.

* svg/as-image/resources/image-with-nested-rects.svg: Added.
This SVG produces the same drawing as image-with-nested-data-uri-images.svg does but
it uses &lt;rect&gt; SVG elements instead.

* svg/as-image/svg-image-with-data-uri-background-expected.html: Added.
* svg/as-image/svg-image-with-data-uri-background.html: Added.
Test the data URI SVG as a css background image.

* svg/as-image/svg-image-with-data-uri-from-canvas-expected.html: Added.
* svg/as-image/svg-image-with-data-uri-from-canvas.html: Added.
Test the data URI image when it is the result of drawing an SVG image on a canvas object.

* svg/as-image/svg-image-with-data-uri-images-disabled-expected.html: Added.
* svg/as-image/svg-image-with-data-uri-images-disabled.html: Added.
Ensure the data uri images are not loaded if imagesEnabled is turned off.

* svg/as-image/svg-image-with-data-uri-reloading-expected.html: Added.
* svg/as-image/svg-image-with-data-uri-reloading.html: Added.
Test the data URI SVG when reloading the page.

* svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg: Added.
* svg/as-image/svg-image-with-data-uri-use-data-uri.svg: Added.
Test the data URI image when it is referenced from an SVG &lt;use&gt; tag.

* svg/as-image/svg-image-with-svg-data-uri-expected.html: Added.
* svg/as-image/svg-image-with-svg-data-uri.html: Added.
Test the data URI image when it is referenced from an HTML &lt;img&gt; tag.</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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderh">trunk/Source/WebCore/loader/ResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImagecpp">trunk/Source/WebCore/loader/cache/CachedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoaderh">trunk/Source/WebCore/loader/cache/CachedResourceLoader.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImagecpp">trunk/Source/WebCore/svg/graphics/SVGImage.cpp</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImageh">trunk/Source/WebCore/svg/graphics/SVGImage.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgasimageresourcesimagewithnesteddatauriimagessvg">trunk/LayoutTests/svg/as-image/resources/image-with-nested-data-uri-images.svg</a></li>
<li><a href="#trunkLayoutTestssvgasimageresourcesimagewithnestedrectssvg">trunk/LayoutTests/svg/as-image/resources/image-with-nested-rects.svg</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauribackgroundexpectedhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauribackgroundhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdataurifromcanvasexpectedhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdataurifromcanvashtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauriimagesdisabledexpectedhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauriimagesdisabledhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdataurireloadingexpectedhtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdataurireloadinghtml">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauriusedatauriexpectedsvg">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithdatauriusedataurisvg">trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri.svg</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithsvgdatauriexpectedhtml">trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgasimagesvgimagewithsvgdataurihtml">trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri.html</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImageClientsh">trunk/Source/WebCore/svg/graphics/SVGImageClients.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImageChromeClienth">trunk/Source/WebCore/svg/graphics/SVGImageChromeClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/LayoutTests/ChangeLog        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2015-02-04  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        When using SVG as an image, we should load datauri images when these images are not in the image cache.
+        https://bugs.webkit.org/show_bug.cgi?id=99677.
+
+        Reviewed by Darin Adler.
+
+        * svg/as-image/resources/image-with-nested-data-uri-images.svg: Added.
+        This SVG has a tree of depth = 5 of nested data URI images. All the data URI images are
+        SVG images expect the innermost one which is a png data URI image.
+        
+        * svg/as-image/resources/image-with-nested-rects.svg: Added.
+        This SVG produces the same drawing as image-with-nested-data-uri-images.svg does but
+        it uses &lt;rect&gt; SVG elements instead.
+        
+        * svg/as-image/svg-image-with-data-uri-background-expected.html: Added.
+        * svg/as-image/svg-image-with-data-uri-background.html: Added.
+        Test the data URI SVG as a css background image.
+        
+        * svg/as-image/svg-image-with-data-uri-from-canvas-expected.html: Added.
+        * svg/as-image/svg-image-with-data-uri-from-canvas.html: Added.
+        Test the data URI image when it is the result of drawing an SVG image on a canvas object.
+        
+        * svg/as-image/svg-image-with-data-uri-images-disabled-expected.html: Added.
+        * svg/as-image/svg-image-with-data-uri-images-disabled.html: Added.
+        Ensure the data uri images are not loaded if imagesEnabled is turned off.
+        
+        * svg/as-image/svg-image-with-data-uri-reloading-expected.html: Added.
+        * svg/as-image/svg-image-with-data-uri-reloading.html: Added.
+        Test the data URI SVG when reloading the page.
+        
+        * svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg: Added.
+        * svg/as-image/svg-image-with-data-uri-use-data-uri.svg: Added.
+        Test the data URI image when it is referenced from an SVG &lt;use&gt; tag.
+        
+        * svg/as-image/svg-image-with-svg-data-uri-expected.html: Added.
+        * svg/as-image/svg-image-with-svg-data-uri.html: Added.
+        Test the data URI image when it is referenced from an HTML &lt;img&gt; tag.
+
</ins><span class="cx"> 2015-02-04  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Unreviewed gardening.
</span></span></pre></div>
<a id="trunkLayoutTestssvgasimageresourcesimagewithnesteddatauriimagessvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/resources/image-with-nested-data-uri-images.svg (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/resources/image-with-nested-data-uri-images.svg                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/resources/image-with-nested-data-uri-images.svg        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,63 @@
</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;200&quot; height=&quot;200&quot;&gt;
+  &lt;defs&gt;
+    &lt;g id=&quot;nested-images&quot;&gt;
+    &lt;rect x=&quot;20&quot; y=&quot;20&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;red&quot;/&gt;
+      &lt;image x=&quot;20&quot; y=&quot;20&quot; width=&quot;100%&quot; height=&quot;100%&quot;
+        xlink:href=&quot;data:image/svg+xml;base64,
+        PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw
+        Oi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIg
+        aGVpZ2h0PSIxMDAlIiBmaWxsPSJMaWdodFNlYUdyZWVuIi8+PHJlY3QgeD0iMjAiIHk9IjIwIiB3
+        aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJyZWQiLz48aW1hZ2UgeD0iMjAiIHk9IjIw
+        IiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bGluazpocmVmPSJkYXRhOmltYWdlL3N2Zyt4
+        bWw7YmFzZTY0LFBITjJaeUI0Yld4dWN6MGlhSFIwY0RvdkwzZDNkeTUzTXk1dmNtY3ZNakF3TUM5
+        emRtY2lJSGh0Ykc1ek9uaHNhVzVyUFNKb2RIUncNCk9pOHZkM2QzTG5jekxtOXlaeTh4T1RrNUwz
+        aHNhVzVySWo0OGNtVmpkQ0I0UFNJd0lpQjVQU0l3SWlCM2FXUjBhRDBpTVRBd0pTSWcNCmFHVnBa
+        MmgwUFNJeE1EQWxJaUJtYVd4c1BTSm5jbVZsYmlJdlBqeHlaV04wSUhnOUlqSXdJaUI1UFNJeU1D
+        SWdkMmxrZEdnOUlqRXcNCk1DVWlJR2hsYVdkb2REMGlNVEF3SlNJZ1ptbHNiRDBpY21Wa0lpOCtQ
+        R2x0WVdkbElIZzlJakl3SWlCNVBTSXlNQ0lnZDJsa2RHZzkNCklqRXdNQ1VpSUdobGFXZG9kRDBp
+        TVRBd0pTSWdlR3hwYm1zNmFISmxaajBpWkdGMFlUcHBiV0ZuWlM5emRtY3JlRzFzTzJKaGMyVTIN
+        Ck5DeFFTRTR5V25sQ05HSlhlSFZqZWpCcFlVaFNNR05FYjNaTU0yUXpaSGsxTTAxNU5YWmpiV04y
+        VFdwQmQwMURPWHBrYldOcFNVaG8NCmRHSkhOWHBQYm1oellWYzFjbEJUU205a1NGSjNEUXBQYVRo
+        MlpETmtNMHh1WTNwTWJUbDVXbms0ZUU5VWF6Vk1NMmh6WVZjMWNrbHENCk5EaGpiVlpxWkVOQ05G
+        QlRTWGRKYVVJMVVGTkpkMGxwUWpOaFYxSXdZVVF3YVUxVVFYZEtVMGxuRFFwaFIxWndXakpvTUZC
+        VFNYaE4NClJFRnNTV2xDYldGWGVITlFVMHB6WVZka2IyUkZaSGxhVjFaMVNXazRLMUJJU214Wk0x
+        Rm5aVVF3YVUxcVFXbEpTR3M1U1dwSmQwbHANClFqTmhWMUl3RFFwaFJEQnBUVlJCZDBwVFNXZGhS
+        MVp3V2pKb01GQlRTWGhOUkVGc1NXbENiV0ZYZUhOUVUwcDVXbGRSYVV4Nk5EaGgNClZ6Rm9XakpW
+        WjJWRU1HbE5ha0ZwU1Vock9VbHFTWGRKYVVJekRRcGhWMUl3WVVRd2FVMVVRWGRLVTBsbllVZFdj
+        Rm95YURCUVUwbDQNClRVUkJiRWxwUWpSaVIyeDFZWHB3YjJOdFZtMVFVMHByV1ZoU2FFOXRiSFJa
+        VjJSc1RETk9NbHA1ZERSaVYzYzNEUXBaYlVaNldsUloNCk1FeEdRa2xVYWtwaFpWVkpNRmxzWkRS
+        a1YwNDJUVWRzYUZOR1NYZFpNRkoyWkd0M2VscEVUbXRsVkZWNlZGaHJNV1J0VG5SWk0xcE8NCllX
+        dEdNMVJWVFRWbGJWSjBEUXBaTW14S1UwZG9NRmxyWXpGbGF6bDFZVWhPYUZaNlZubFZSazVMWWpK
+        U1NWVnVZMDVEYXpsd1QwaGENCmEwMHlVWHBVUnpWcVpXdDRkRTlZYkdGbFZHZzBWREZTY2s1VmQz
+        cGhTRTVvRFFwV2VsWjVVMWR2TUU5SFRuUldiWEJyVVRCSk1GVkcNClRrcGtNR3h3VVdwV1VWVXdi
+        RE5UVjJ4RFRUSkdXRlZxUW1oU1JFSndWRlpTUW1Rd2NGUlRWMk5PUTIxR1NGWnVRbUZOYldkM0RR
+        cFYNClJrNUtaVVV4UlZGWGVFcGhWVXAwV1Zaa05HTXhRbFJUYms1b1ZucEdjMVZxVGt0aVJuQllU
+        a2RzVFdWcVVUUlpNakZYWVcxU1JGRnENClVsRlZNR3cxVkZWT1Nsb3lWbFZOUjJ4T0RRcGhhMFp3
+        VTFWb2EyTkdjRWxWYlRoT1EyeENWRk5ZYUU1U1JVWnpVMWRzUTJJeGNGaGkNClJ6Vm9VMFpGTlZO
+        WGNFWmtNREZFVmxkc1NsSXhjSGRaYTJRelQxVnNkVk50ZUdGUk1Hd3lEUXBWUjNBMFkwZEtXRkp0
+        TldGVk1Fa3cNClZVWk9TbVZWTVVSVFYyUnNWa1JDY0ZSWGNFSmhWV3hKV2toQlRrTnNjRWxWYlRs
+        UlZUQnNORlJWVWtKaVJXeHdVVzA1WVZZeWVIVloNClZXaFNEUXBQVld4eFVsaGtUbEV4Vm5CVFZX
+        aHZZekpHV0U1WVNsQmlWMmcxVjJ4a1drOVZiSFJWYldoclVqQlZNbGxXWTNoaFJtOTUNClZsaGFh
+        bEo2Vm5WVWVrcExZVWROZVZaVVNVNURhelZFRFFwbFNFSlhZVEJ3VVZaWE5XcGtNVTEzV2tjMWFV
+        MUZXa05WVmxaSFZERlYNCmVGWnRPVk5XYkZwMVZWWldSMUZzU1hoU2EwcFNWbFZhUkZsVVFrOVJi
+        R1JXVW10S1VsWlZiM3BVYTJoRERRcFdNVnBXVW10S1VsWlYNCldrTldNRlV4VmtaV2NWRnJiMDVE
+        YkVaWlUyNXdUMUl3TUhsV1ZsWkhVV3hHVm1SRmRGUmlSWEJIVlcxNFYySkdVblZUYWtKT1VtdGEN
+        ClIxWkhkRWRSYkVaV0RRcGlSRTVQVFVVMVJsZHRjRzVPVm05NVdYcEdVbUY2YTNwWmEyaEhXVlph
+        Um1GR1VtbFhSa3AxVlZSQ2MySnMNClJsWlNiRTFPUTJ4S1ZsUnJTbEpOUlZwNVZsZDBSMkpzUmxo
+        aVJYQmhEUXBOUlZwRFZsZDBWMUpHUmxaVWEwcG9UVlZ3UTFkcVFrZGoNClJrNVlXa1ZLVWxacmNF
+        ZFZWRUpIVWtaR1dHUkdUbEpXTWxKRFdWWldjMkpzUmxaU2JFNVRWbFUxUTFWVVFrZGpiRlp5RFFw
+        U2JUUk8NClEyeEdXR0pGY0dGTlJWcERWbGQwVjFKR1JsWlVhMHBvVFZWd1ExZHFRa2RqUms1WVdr
+        VktVbFpyY0VkVlZFSkhVa1pHV0dSR1RsSlcNCk1sSkRXVlpXYzJKc1JsWlNiRTVURFFwV1ZUVkRW
+        VlJDUjJOc1ZuSlNiVFZTVmpKNFMxZHFRa2RSYkZaeVZtdFJUa05zUmxaVWEwcG8NClRWVndRMWRx
+        UWtkalJrNVlXa1ZLVWxacmNFZFZWRUpIVWtaR1dHUkdUbEpXTWxKRERRcFpWbFp6WW14R1ZsSnNU
+        bE5XVlRWRFZWUkMNClIyTnNWbkpTYlRWU1ZqSlNTMVZzVmtkU2JGWnlWbXRTVWxaVk5VTlpWRVpM
+        VVcxU2RWTnRNRTVEYlU1elZXeEtWVkpYVW05Vk1GSlANCkRRcGxSbXh5VW10S1VsWlZXa05WVjNS
+        M1ZURmFWVlpyV21waVdGSk1WMnBLYTJKc1FsVk5SMnhSWVc1a01sbFdZM2hoUm05NVZsTjANClVW
+        RjZiRFphUnpGcVN6QlNVbUl3TlVSYWVqQTVEUXBKYWpRNFRESnNkRmxYWkd4UWFuZDJZek5hYmxC
+        blBUMGlQand2YVcxaFoyVSsNClBDOXpkbWMrIj48L2ltYWdlPjwvc3ZnPg==&quot;&gt;
+      &lt;/image&gt;
+    &lt;/g&gt;
+  &lt;/defs&gt;
+  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;DarkGreen&quot;/&gt;
+  &lt;use xlink:href='#nested-images'/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimageresourcesimagewithnestedrectssvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/resources/image-with-nested-rects.svg (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/resources/image-with-nested-rects.svg                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/resources/image-with-nested-rects.svg        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,18 @@
</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;200&quot; height=&quot;200&quot;&gt;
+  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;DarkGreen&quot;/&gt;
+  &lt;g transform=&quot;translate(20,20)&quot;&gt;
+    &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;LightSeaGreen&quot;/&gt;
+    &lt;g transform=&quot;translate(20,20)&quot;&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;Green&quot;/&gt;
+      &lt;g transform=&quot;translate(20,20)&quot;&gt;
+        &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;LightGreen&quot;/&gt;
+        &lt;g transform=&quot;translate(20,20)&quot;&gt;
+          &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;LimeGreen&quot;/&gt;
+          &lt;g transform=&quot;translate(20,20)&quot;&gt;
+            &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;Lime&quot;/&gt;
+          &lt;/g&gt;
+        &lt;/g&gt;
+      &lt;/g&gt;
+    &lt;/g&gt;
+  &lt;/g&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauribackgroundexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background-expected.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background-expected.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    div {
+      width: 200px;
+      height: 200px;
+      background-color:red;
+      background-image:url(&quot;resources/image-with-nested-rects.svg&quot;);
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;div&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauribackgroundhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-background.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    div {
+      width: 200px;
+      height: 200px;
+      background-color:red;
+      background-image:url(&quot;resources/image-with-nested-data-uri-images.svg&quot;);
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;div&gt;
+  &lt;/div&gt;
+  &lt;script&gt;
+    if (window.testRunner) {
+      testRunner.waitUntilDone();
+      // window load event fires when the the page and its resources are loaded.
+      // However it does not wait till the sub-resources are loaded. And this is
+      // why we need to wait a little bit before we call notifyDone().
+      window.addEventListener(&quot;load&quot;, function() {
+        setTimeout(function () {
+          testRunner.notifyDone();
+        }, 200);
+      });
+    }
+  &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdataurifromcanvasexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas-expected.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas-expected.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img src=&quot;resources/image-with-nested-rects.svg&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdataurifromcanvashtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-from-canvas.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img id=&quot;container&quot; src=&quot;&quot;&gt;
+  &lt;script&gt;
+    if (window.testRunner)
+      testRunner.waitUntilDone();
+
+    var canvas = document.createElement('canvas');
+    canvas.width = 200;
+    canvas.height = 200;
+    var context = canvas.getContext('2d');
+    
+    context.fillStyle = &quot;red&quot;;
+    context.fillRect(0, 0, canvas.width, canvas.height);
+    
+    var image = new Image();
+    image.src = &quot;resources/image-with-nested-data-uri-images.svg&quot;;
+
+    // We need to wait till the image is loaded.
+    image.onload = function() {
+      // But we need to wait a little more till its sub-resources are loaded
+      setTimeout(function () {
+        context.drawImage(image, 0, 0, canvas.width, canvas.height);
+        var img = document.getElementById(&quot;container&quot;);
+        img.src = canvas.toDataURL();
+        var forceLayout = document.body.offsetWidth;
+        // Then we need to wait a litlle more till the page layout is complete
+        setTimeout(function () {
+          testRunner.notifyDone();
+        }, 200);
+      }, 200);
+    }    
+  &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauriimagesdisabledexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled-expected.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled-expected.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    div {
+        width: 200px;
+        height: 200px;
+        background-color: lime;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;div&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauriimagesdisabledhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-images-disabled.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    div {
+        width: 200px;
+        height: 200px;
+        background-color:lime;
+    }
+  &lt;/style&gt;
+  &lt;script&gt;
+    if (window.testRunner) {
+      window.internals.settings.setImagesEnabled(false);
+      testRunner.overridePreference('WebKitDisplayImagesKey', 0);
+      testRunner.queueReload();
+    }
+  &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;div&gt;
+    &lt;img src=&quot;resources/image-with-nested-data-uri-images.svg&quot;&gt;
+  &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdataurireloadingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading-expected.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading-expected.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img src=&quot;resources/image-with-nested-rects.svg&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdataurireloadinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-reloading.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img src=&quot;resources/image-with-nested-data-uri-images.svg&quot;&gt;
+  &lt;script&gt;
+    if (window.testRunner)
+      testRunner.waitUntilDone();
+      
+    window.addEventListener(&quot;load&quot;, function() {
+      setTimeout(function () {
+        if (location.hash == &quot;&quot;) {
+          location.hash = &quot;#reloading&quot;;
+          location.reload(true);
+        } else if (location.hash == &quot;#reloading&quot;) {
+          location.hash = &quot;#finished&quot;;
+          if (window.testRunner)
+            testRunner.notifyDone();
+        }
+      }, 200);
+    });
+  &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauriusedatauriexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri-expected.svg        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='200' height='200'&gt;
+  &lt;rect x='0' y='0' width='100%' height='100%' fill='red'/&gt;
+  &lt;image x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; xlink:href=&quot;resources/image-with-nested-rects.svg&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithdatauriusedataurisvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri.svg (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri.svg                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-data-uri-use-data-uri.svg        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='200' height='200'&gt;
+  &lt;rect x='0' y='0' width='100%' height='100%' fill='DarkGreen'/&gt;
+  &lt;use xlink:href='resources/image-with-nested-data-uri-images.svg#nested-images'/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithsvgdatauriexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri-expected.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri-expected.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img src=&quot;resources/image-with-nested-rects.svg&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgasimagesvgimagewithsvgdataurihtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri.html (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri.html                                (rev 0)
+++ trunk/LayoutTests/svg/as-image/svg-image-with-svg-data-uri.html        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+  &lt;style&gt;
+    img {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+  &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;img src=&quot;resources/image-with-nested-data-uri-images.svg&quot;&gt;
+  &lt;script&gt;
+    if (window.testRunner) {
+      testRunner.waitUntilDone();
+      // window load event fires when the the page and its resources are loaded.
+      // However it does not wait till the sub-resources are loaded. And this is
+      // why we need to wait a little bit before we call notifyDone().
+      window.addEventListener(&quot;load&quot;, function() {
+        setTimeout(function () {
+          testRunner.notifyDone();
+        }, 200);
+      });
+    }
+  &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/ChangeLog        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2015-02-04  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        When using SVG as an image, we should load datauri images when these images are not in the image cache.
+        https://bugs.webkit.org/show_bug.cgi?id=99677.
+
+        Reviewed by Darin Adler.
+        
+        Data URI sub-resources are not loaded because the networking context of FrameLoader
+        attached to the SubResourceLoader is set to null. This is done intentionally to
+        disallow any resource from loading external sub-resources. For example if an &lt;img&gt;
+        tag has its 'src' attribute points to an svg file, this svg is not allowed to load
+        an external image through the 'xlink' attribute of an &lt;image&gt; element. This restriction
+        is not valid if the value of the 'xlink' attribute is a data URI. In this case the image 
+        should be loaded into memory since there is no network traffic involved. All we need
+        to do is to decode the data part of the URI.
+        
+        The fix is to pass the root FrameLoader, which has a valid NetworkingContext, through
+        the FrameLoaderClient, to the ResourceHandle::create() which uses the NetworkingContext
+        to decode the data and fire the load events of the data URI resources.
+
+        Tests:  svg/as-image/svg-image-with-data-uri-background.html
+                svg/as-image/svg-image-with-data-uri-from-canvas.html
+                svg/as-image/svg-image-with-data-uri-images-disabled.html
+                svg/as-image/svg-image-with-data-uri-reloading.html
+                svg/as-image/svg-image-with-data-uri-use-data-uri.svg
+                svg/as-image/svg-image-with-svg-data-uri.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        Remove unreferenced header file.
+
+        * loader/FrameLoaderClient.h:
+        Define the null virtual function dataProtocolLoader() which should return the FrameLoader
+        for loading data URI resources.
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::start):
+        (WebCore::ResourceLoader::dataProtocolFrameLoader):
+        * loader/ResourceLoader.h:
+        Add ResourceLoader::dataProtocolFrameLoader() which returns the root FrameLoader. The
+        root FrameLoader is used to get a valid NetworkingContext which can be passed to
+        ResourceHandle::create() when url().protocolIsData().
+
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::load):
+        (WebCore::CachedImage::finishLoading):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::shouldPerformImageLoad):
+        (WebCore::CachedResourceLoader::shouldDeferImageLoad):
+        * loader/cache/CachedResourceLoader.h:
+        Allow loading data URI sub-resources as long as loading images is not disabled. Also we
+        need to call setDataProtocolLoader() before calling setData() for the isSVGImage case, 
+        setData() will create a page by calling Page::createPageFromBuffer() via SVGImage::dataChanged(),
+        and we need to pass the correct FrameLoaderClient to the created FrameLoader of the main
+         frame of this page.
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::SVGImage):
+        (WebCore::SVGImage::dataChanged):
+        * svg/graphics/SVGImage.h:
+        Create a new FrameLoaderClient of type SVGFrameLoaderClient and set it in pageConfiguration
+        which is used when creating the page from the SVG data URI.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * svg/graphics/SVGImageChromeClient.h: Removed.
+        * svg/graphics/SVGImageClients.h: Added.
+        Add a new class SVGImageChromeClient which overrides the function dataProtocolLoader().
+        Rename the header file SVGImageChromeClient.h to be SVGImageClients.h since it now 
+        includes the classes SVGImageChromeClient and SVGFrameLoaderClient.
+
</ins><span class="cx"> 2015-02-04  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix a misplaced include in CaptionUserPreferencesMediaAF
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -4336,7 +4336,6 @@
</span><span class="cx">                 AAA728F716D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = AAA728F116D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h */; };
</span><span class="cx">                 AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAA728F216D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm */; };
</span><span class="cx">                 AAA728F916D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAA728F316D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm */; };
</span><del>-                AAC08CEF15F933D600F1E188 /* SVGImageChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC08CED15F933D600F1E188 /* SVGImageChromeClient.h */; };
</del><span class="cx">                 AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */; };
</span><span class="cx">                 AAF5B7B71524B6C50004CB49 /* WebSocketFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */; };
</span><span class="cx">                 AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */; };
</span><span class="lines">@@ -9221,6 +9220,7 @@
</span><span class="cx">                 53EF766A16530A61004CBE49 /* SettingsMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMacros.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><ins>+                55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentDistributor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57B791A014C6A62900F202D1 /* ContentDistributor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentDistributor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57CF497214EE36D700ECFF14 /* InsertionPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertionPoint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -11587,7 +11587,6 @@
</span><span class="cx">                 AAA728F116D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAccessibilityObjectWrapperIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAA728F216D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebAccessibilityObjectWrapperIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAA728F316D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AXObjectCacheIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                AAC08CED15F933D600F1E188 /* SVGImageChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageChromeClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 AAC08CF015F941FC00F1E188 /* AccessibilitySVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGRoot.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGRoot.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20376,7 +20375,7 @@
</span><span class="cx">                                 B255990C0D00D8B900BB825C /* SVGImage.h */,
</span><span class="cx">                                 08F859D21463F9CD0067D933 /* SVGImageCache.cpp */,
</span><span class="cx">                                 08F859D31463F9CD0067D933 /* SVGImageCache.h */,
</span><del>-                                AAC08CED15F933D600F1E188 /* SVGImageChromeClient.h */,
</del><ins>+                                55D408F71A7C631800C78450 /* SVGImageClients.h */,
</ins><span class="cx">                                 08F859D21463F9CD0067D934 /* SVGImageForContainer.cpp */,
</span><span class="cx">                                 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -26343,7 +26342,6 @@
</span><span class="cx">                                 650FBF2B0D9AF047008FC292 /* SVGHKernElement.h in Headers */,
</span><span class="cx">                                 B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */,
</span><span class="cx">                                 08F859D51463F9CD0067D933 /* SVGImageCache.h in Headers */,
</span><del>-                                AAC08CEF15F933D600F1E188 /* SVGImageChromeClient.h in Headers */,
</del><span class="cx">                                 B2227A2D0D00BF220071B782 /* SVGImageElement.h in Headers */,
</span><span class="cx">                                 08F859D51463F9CD0067D934 /* SVGImageForContainer.h in Headers */,
</span><span class="cx">                                 B28C6A2A0D00C44800334AA4 /* SVGImageLoader.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -96,7 +96,6 @@
</span><span class="cx"> #include &quot;RenderedPosition.h&quot;
</span><span class="cx"> #include &quot;SVGDocument.h&quot;
</span><span class="cx"> #include &quot;SVGImage.h&quot;
</span><del>-#include &quot;SVGImageChromeClient.h&quot;
</del><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;SVGSVGElement.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -332,6 +332,8 @@
</span><span class="cx">         // FIXME (bug 116233): We need to get rid of EmptyFrameLoaderClient completely, then this will no longer be needed.
</span><span class="cx">         virtual bool isEmptyFrameLoaderClient() { return false; }
</span><span class="cx"> 
</span><ins>+        virtual FrameLoader* dataProtocolLoader() const { return nullptr; }
+
</ins><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx">         virtual void didCreateQuickLookHandle(QuickLookHandle&amp;) { }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -161,6 +161,7 @@
</span><span class="cx">     ASSERT(!m_handle);
</span><span class="cx">     ASSERT(!m_request.isNull());
</span><span class="cx">     ASSERT(m_deferredRequest.isNull());
</span><ins>+    ASSERT(frameLoader());
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="cx">     if (m_documentLoader-&gt;scheduleArchiveLoad(this, m_request))
</span><span class="lines">@@ -175,8 +176,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!m_reachedTerminalState)
-        m_handle = ResourceHandle::create(m_frame-&gt;loader().networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent() == SniffContent);
</del><ins>+    if (!m_reachedTerminalState) {
+        FrameLoader&amp; loader = m_request.url().protocolIsData() ? dataProtocolFrameLoader() : *frameLoader();
+        m_handle = ResourceHandle::create(loader.networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent() == SniffContent);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::setDefersLoading(bool defers)
</span><span class="lines">@@ -200,6 +203,15 @@
</span><span class="cx">     return &amp;m_frame-&gt;loader();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// This function should only be called when frameLoader() is non-null.
+FrameLoader&amp; ResourceLoader::dataProtocolFrameLoader() const
+{
+    FrameLoader* loader = frameLoader();
+    ASSERT(loader);
+    FrameLoader* dataProtocolLoader = loader-&gt;client().dataProtocolLoader();
+    return *(dataProtocolLoader ? dataProtocolLoader : loader);
+}
+
</ins><span class="cx"> void ResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
</span><span class="cx"> { 
</span><span class="cx">     m_options.setDataBufferingPolicy(dataBufferingPolicy); 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT FrameLoader* frameLoader() const;
</span><ins>+    FrameLoader&amp; dataProtocolFrameLoader() const;
</ins><span class="cx">     DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
</span><span class="cx">     WEBCORE_EXPORT const ResourceRequest&amp; originalRequest() const { return m_originalRequest; }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CachedImage::load(CachedResourceLoader&amp; cachedResourceLoader, const ResourceLoaderOptions&amp; options)
</span><span class="cx"> {
</span><del>-    if (cachedResourceLoader.autoLoadImages())
</del><ins>+    if (cachedResourceLoader.shouldPerformImageLoad(resourceRequest().url()))
</ins><span class="cx">         CachedResource::load(cachedResourceLoader, options);
</span><span class="cx">     else
</span><span class="cx">         setLoading(false);
</span><span class="lines">@@ -415,8 +415,11 @@
</span><span class="cx">     if (!m_image &amp;&amp; data)
</span><span class="cx">         createImage();
</span><span class="cx"> 
</span><del>-    if (m_image)
</del><ins>+    if (m_image) {
+        if (m_loader &amp;&amp; m_image-&gt;isSVGImage())
+            downcast&lt;SVGImage&gt;(*m_image).setDataProtocolLoader(&amp;m_loader-&gt;dataProtocolFrameLoader());
</ins><span class="cx">         m_image-&gt;setData(data, true);
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (!m_image || m_image-&gt;isNull()) {
</span><span class="cx">         // Image decoding failed; the image data is malformed.
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -754,9 +754,14 @@
</span><span class="cx">     return !m_imagesEnabled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool CachedResourceLoader::shouldPerformImageLoad(const URL&amp; url) const
+{
+    return m_autoLoadImages || url.protocolIsData();
+}
+
</ins><span class="cx"> bool CachedResourceLoader::shouldDeferImageLoad(const URL&amp; url) const
</span><span class="cx"> {
</span><del>-    return clientDefersImage(url) || !m_autoLoadImages;
</del><ins>+    return clientDefersImage(url) || !shouldPerformImageLoad(url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CachedResourceLoader::reloadImagesIfNotDeferred()
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx">     void setImagesEnabled(bool);
</span><span class="cx"> 
</span><span class="cx">     bool shouldDeferImageLoad(const URL&amp;) const;
</span><ins>+    bool shouldPerformImageLoad(const URL&amp;) const;
</ins><span class="cx">     
</span><span class="cx">     CachePolicy cachePolicy(CachedResource::Type) const;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><ins>+#include &quot;FrameLoader.h&quot;
</ins><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;ImageObserver.h&quot;
</span><span class="lines">@@ -41,7 +42,7 @@
</span><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><span class="cx"> #include &quot;SVGDocument.h&quot;
</span><span class="cx"> #include &quot;SVGForeignObjectElement.h&quot;
</span><del>-#include &quot;SVGImageChromeClient.h&quot;
</del><ins>+#include &quot;SVGImageClients.h&quot;
</ins><span class="cx"> #include &quot;SVGSVGElement.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -344,6 +345,9 @@
</span><span class="cx">         fillWithEmptyClients(pageConfiguration);
</span><span class="cx">         m_chromeClient = std::make_unique&lt;SVGImageChromeClient&gt;(this);
</span><span class="cx">         pageConfiguration.chromeClient = m_chromeClient.get();
</span><ins>+        m_loaderClient = std::make_unique&lt;SVGFrameLoaderClient&gt;(m_dataProtocolLoader);
+        pageConfiguration.loaderClientForMainFrame = m_loaderClient.get();
+
</ins><span class="cx">         bool canHaveScrollbars = false; // SVG Images will always synthesize a viewBox, if it's not available, and thus never see scrollbars.
</span><span class="cx">         bool transparent = true; // SVG Images are transparent.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.h (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.h        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -33,11 +33,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Element;
</span><ins>+class FrameLoader;
</ins><span class="cx"> class FrameView;
</span><span class="cx"> class ImageBuffer;
</span><span class="cx"> class Page;
</span><span class="cx"> class RenderBox;
</span><span class="cx"> class SVGSVGElement;
</span><ins>+class SVGFrameLoaderClient;
</ins><span class="cx"> class SVGImageChromeClient;
</span><span class="cx"> class SVGImageForContainer;
</span><span class="cx"> 
</span><span class="lines">@@ -55,6 +57,7 @@
</span><span class="cx">     virtual FloatSize size() const override { return m_intrinsicSize; }
</span><span class="cx"> 
</span><span class="cx">     void setURL(const URL&amp; url) { m_url = url; }
</span><ins>+    void setDataProtocolLoader(FrameLoader* dataProtocolLoader) { m_dataProtocolLoader = dataProtocolLoader; }
</ins><span class="cx"> 
</span><span class="cx">     virtual bool hasSingleSecurityOrigin() const override;
</span><span class="cx"> 
</span><span class="lines">@@ -98,10 +101,12 @@
</span><span class="cx"> 
</span><span class="cx">     SVGSVGElement* rootElement() const;
</span><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;SVGFrameLoaderClient&gt; m_loaderClient;
</ins><span class="cx">     std::unique_ptr&lt;SVGImageChromeClient&gt; m_chromeClient;
</span><span class="cx">     std::unique_ptr&lt;Page&gt; m_page;
</span><span class="cx">     FloatSize m_intrinsicSize;
</span><span class="cx">     URL m_url;
</span><ins>+    FrameLoader* m_dataProtocolLoader { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> bool isInSVGImage(const Element*);
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImageChromeClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/svg/graphics/SVGImageChromeClient.h (179625 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImageChromeClient.h        2015-02-04 20:51:29 UTC (rev 179625)
+++ trunk/Source/WebCore/svg/graphics/SVGImageChromeClient.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SVGImageChromeClient_h
-#define SVGImageChromeClient_h
-
-#include &quot;EmptyClients.h&quot;
-
-namespace WebCore {
-
-class SVGImageChromeClient : public EmptyChromeClient {
-    WTF_MAKE_NONCOPYABLE(SVGImageChromeClient); WTF_MAKE_FAST_ALLOCATED;
-public:
-    SVGImageChromeClient(SVGImage* image)
-        : m_image(image)
-    {
-    }
-    
-    virtual bool isSVGImageChromeClient() const override { return true; }
-    SVGImage* image() const { return m_image; }
-    
-private:
-    virtual void chromeDestroyed() override
-    {
-        m_image = 0;
-    }
-    
-    virtual void invalidateContentsAndRootView(const IntRect&amp; r) override
-    {
-        // If m_image-&gt;m_page is null, we're being destructed, don't fire changedInRect() in that case.
-        if (m_image &amp;&amp; m_image-&gt;imageObserver() &amp;&amp; m_image-&gt;m_page)
-            m_image-&gt;imageObserver()-&gt;changedInRect(m_image, r);
-    }
-    
-    SVGImage* m_image;
-};
-
-inline SVGImageChromeClient* toSVGImageChromeClient(ChromeClient* client)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!client || client-&gt;isSVGImageChromeClient());
-    return static_cast&lt;SVGImageChromeClient*&gt;(client);
-}
-    
-} 
-
-#endif // SVGImageChromeClient_h
</del></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImageClientshfromrev179625trunkSourceWebCoresvggraphicsSVGImageChromeClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/svg/graphics/SVGImageClients.h (from rev 179625, trunk/Source/WebCore/svg/graphics/SVGImageChromeClient.h) (0 => 179626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImageClients.h                                (rev 0)
+++ trunk/Source/WebCore/svg/graphics/SVGImageClients.h        2015-02-04 20:55:21 UTC (rev 179626)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SVGImageClients_h
+#define SVGImageClients_h
+
+#include &quot;EmptyClients.h&quot;
+
+namespace WebCore {
+
+class SVGImageChromeClient final : public EmptyChromeClient {
+    WTF_MAKE_NONCOPYABLE(SVGImageChromeClient); WTF_MAKE_FAST_ALLOCATED;
+public:
+    SVGImageChromeClient(SVGImage* image)
+        : m_image(image)
+    {
+    }
+    
+    virtual bool isSVGImageChromeClient() const override { return true; }
+    SVGImage* image() const { return m_image; }
+    
+private:
+    virtual void chromeDestroyed() override
+    {
+        m_image = nullptr;
+    }
+    
+    virtual void invalidateContentsAndRootView(const IntRect&amp; r) override
+    {
+        // If m_image-&gt;m_page is null, we're being destructed, don't fire changedInRect() in that case.
+        if (m_image &amp;&amp; m_image-&gt;imageObserver() &amp;&amp; m_image-&gt;m_page)
+            m_image-&gt;imageObserver()-&gt;changedInRect(m_image, r);
+    }
+    
+    SVGImage* m_image;
+};
+
+class SVGFrameLoaderClient final : public EmptyFrameLoaderClient {
+public:
+    SVGFrameLoaderClient(FrameLoader* dataProtocolLoader)
+        : m_dataProtocolLoader(dataProtocolLoader)
+    {
+    }
+
+    virtual FrameLoader* dataProtocolLoader() const override { return m_dataProtocolLoader; }
+private:
+    FrameLoader* m_dataProtocolLoader;
+};
+
+} 
+
+#endif // SVGImageClients_h
</ins></span></pre>
</div>
</div>

</body>
</html>