<!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>[176264] trunk/Source</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/176264">176264</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2014-11-18 10:04:17 -0800 (Tue, 18 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Subclass CachedFont for SVG fonts
https://bugs.webkit.org/show_bug.cgi?id=138686

Reviewed by Simon Fraser.

Source/WebCore:

CachedFont had many #if ENABLE(SVG_FONTS) scattered throughout it.
Splitting out this SVG-specific code into a subclass of CachedFont
cleans up the design.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData): There are two sections
in this function; one for SVG fonts and one for regular fonts.
I've moved these two sections into CachedFont and SVGCachedFont,
thereby simplifying this function.
(WebCore::CSSFontFaceSource::ensureFontData): Ditto.
(WebCore::CSSFontFaceSource::svgFontFaceElement): Moved to header.
(WebCore::CSSFontFaceSource::setSVGFontFaceElement): Ditto.
(WebCore::CSSFontFaceSource::isSVGFontFaceSource): Ditto.
* css/CSSFontFaceSource.h: Put functions that are simple enough to
be inlined here.
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSVGFontTarget): Convenience
function.
(WebCore::CSSFontFaceSrcValue::cachedFont): Pass through a boolean
from CSSFontSelector to CachedResourceHandle regarding if we should
be using SVGCachedFont instead of CachedFont.
* css/CSSFontFaceSrcValue.h: New convenience function.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Pass through a boolean
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceType): Update for new
CachedResource type
(WebCore::cachedResourcesForFrame): Ditto.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
(WebCore::CachedFont::ensureCustomFontData): Taken from
CSSFontFaceSource::getFontData()
(WebCore::CachedFont::getFontData): Ditto.
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
(WebCore::CachedFont::ensureSVGFontData): Moved to SVGCachedFont.
(WebCore::CachedFont::getSVGFontById): Ditto.
* loader/cache/CachedFont.h:
* loader/cache/CachedResource.cpp:
(WebCore::defaultPriorityForResourceType): Update for new enum
type.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Takes new boolean.
(WebCore::CachedResourceLoader::requestFont): Ditto.
(WebCore::CachedResourceLoader::checkInsecureContent): Update for
new enum type
(WebCore::CachedResourceLoader::canRequest): Ditto.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGFont.cpp: Added.
(WebCore::CachedSVGFont::CachedSVGFont): Moved from
CSSFontFaceSource::getFontData() and CachedFont
(WebCore::CachedSVGFont::getFontData): Ditto.
(WebCore::CachedSVGFont::platformDataFromCustomData): Ditto.
(WebCore::CachedSVGFont::ensureCustomFontData): Ditto.
(WebCore::CachedSVGFont::getSVGFontById): Ditto.
(WebCore::CachedSVGFont::firstFontFace): Ditto.
* loader/cache/CachedSVGFont.h: Subclass CachedFont.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getStatistics): Update for new enum.
* svg/SVGFontFaceUriElement.cpp:
(WebCore::isSVGFontTarget): Convenience function.
(WebCore::SVGFontFaceUriElement::loadFont): Update for new
boolean.

Source/WebKit2:

Update for enum type.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::maximumBufferingTime):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSourcecpp">trunk/Source/WebCore/css/CSSFontFaceSource.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSourceh">trunk/Source/WebCore/css/CSSFontFaceSource.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSrcValuecpp">trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSrcValueh">trunk/Source/WebCore/css/CSSFontFaceSrcValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFontcpp">trunk/Source/WebCore/loader/cache/CachedFont.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFonth">trunk/Source/WebCore/loader/cache/CachedFont.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourcecpp">trunk/Source/WebCore/loader/cache/CachedResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceh">trunk/Source/WebCore/loader/cache/CachedResource.h</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="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceUriElementcpp">trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebResourceLoadSchedulercpp">trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGFontcpp">trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGFonth">trunk/Source/WebCore/loader/cache/CachedSVGFont.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -1842,6 +1842,7 @@
</span><span class="cx">     loader/archive/mhtml/MHTMLParser.cpp
</span><span class="cx"> 
</span><span class="cx">     loader/cache/CachedCSSStyleSheet.cpp
</span><ins>+    loader/cache/CachedSVGFont.cpp
</ins><span class="cx">     loader/cache/CachedFont.cpp
</span><span class="cx">     loader/cache/CachedImage.cpp
</span><span class="cx">     loader/cache/CachedRawResource.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/ChangeLog        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2014-11-18  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Subclass CachedFont for SVG fonts
+        https://bugs.webkit.org/show_bug.cgi?id=138686
+
+        Reviewed by Simon Fraser.
+
+        CachedFont had many #if ENABLE(SVG_FONTS) scattered throughout it.
+        Splitting out this SVG-specific code into a subclass of CachedFont
+        cleans up the design.
+
+        No new tests because there is no behavior change.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::getFontData): There are two sections
+        in this function; one for SVG fonts and one for regular fonts.
+        I've moved these two sections into CachedFont and SVGCachedFont,
+        thereby simplifying this function.
+        (WebCore::CSSFontFaceSource::ensureFontData): Ditto.
+        (WebCore::CSSFontFaceSource::svgFontFaceElement): Moved to header.
+        (WebCore::CSSFontFaceSource::setSVGFontFaceElement): Ditto.
+        (WebCore::CSSFontFaceSource::isSVGFontFaceSource): Ditto.
+        * css/CSSFontFaceSource.h: Put functions that are simple enough to
+        be inlined here.
+        * css/CSSFontFaceSrcValue.cpp:
+        (WebCore::CSSFontFaceSrcValue::isSVGFontTarget): Convenience
+        function.
+        (WebCore::CSSFontFaceSrcValue::cachedFont): Pass through a boolean
+        from CSSFontSelector to CachedResourceHandle regarding if we should
+        be using SVGCachedFont instead of CachedFont.
+        * css/CSSFontFaceSrcValue.h: New convenience function.
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule): Pass through a boolean
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::cachedResourceType): Update for new
+        CachedResource type
+        (WebCore::cachedResourcesForFrame): Ditto.
+        * loader/cache/CachedFont.cpp:
+        (WebCore::CachedFont::CachedFont):
+        (WebCore::CachedFont::ensureCustomFontData): Taken from
+        CSSFontFaceSource::getFontData()
+        (WebCore::CachedFont::getFontData): Ditto.
+        (WebCore::CachedFont::platformDataFromCustomData): Ditto.
+        (WebCore::CachedFont::ensureSVGFontData): Moved to SVGCachedFont.
+        (WebCore::CachedFont::getSVGFontById): Ditto.
+        * loader/cache/CachedFont.h:
+        * loader/cache/CachedResource.cpp:
+        (WebCore::defaultPriorityForResourceType): Update for new enum
+        type.
+        * loader/cache/CachedResource.h:
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::createResource): Takes new boolean.
+        (WebCore::CachedResourceLoader::requestFont): Ditto.
+        (WebCore::CachedResourceLoader::checkInsecureContent): Update for
+        new enum type
+        (WebCore::CachedResourceLoader::canRequest): Ditto.
+        * loader/cache/CachedResourceLoader.h:
+        * loader/cache/CachedSVGFont.cpp: Added.
+        (WebCore::CachedSVGFont::CachedSVGFont): Moved from
+        CSSFontFaceSource::getFontData() and CachedFont
+        (WebCore::CachedSVGFont::getFontData): Ditto.
+        (WebCore::CachedSVGFont::platformDataFromCustomData): Ditto.
+        (WebCore::CachedSVGFont::ensureCustomFontData): Ditto.
+        (WebCore::CachedSVGFont::getSVGFontById): Ditto.
+        (WebCore::CachedSVGFont::firstFontFace): Ditto.
+        * loader/cache/CachedSVGFont.h: Subclass CachedFont.
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::getStatistics): Update for new enum.
+        * svg/SVGFontFaceUriElement.cpp:
+        (WebCore::isSVGFontTarget): Convenience function.
+        (WebCore::SVGFontFaceUriElement::loadFont): Update for new
+        boolean.
+
</ins><span class="cx"> 2014-11-18  Myles C. Maxfield  &lt;litherum@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use underlining metrics from the font file
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -7328,6 +7328,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\archive\mhtml\MHTMLParser.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedCSSStyleSheet.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedFont.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\loader\cache\CachedSVGFont.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedImage.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedRawResource.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedResource.cpp&quot; /&gt;
</span><span class="lines">@@ -19279,6 +19280,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\archive\mhtml\MHTMLParser.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedCSSStyleSheet.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedFont.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\loader\cache\CachedSVGFont.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedImage.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedRawResource.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedRawResourceClient.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -1026,6 +1026,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedCSSStyleSheet.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader\cache&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\loader\cache\CachedSVGFont.cpp&quot;&gt;
+      &lt;Filter&gt;loader\cache&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\loader\cache\CachedFont.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader\cache&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -8052,6 +8055,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedCSSStyleSheet.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader\cache&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\loader\cache\CachedSVGFont.h&quot;&gt;
+      &lt;Filter&gt;loader\cache&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\loader\cache\CachedFont.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;loader\cache&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -927,6 +927,8 @@
</span><span class="cx">                 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
</span><span class="cx">                 1C010700192594DF008A4201 /* InlineTextBoxStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */; };
</span><span class="cx">                 1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */; };
</span><ins>+                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
+                1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0939E91A13E12900B788E5 /* CachedSVGFont.h */; };
</ins><span class="cx">                 1C11CCB50AA6093700DADB20 /* DOMNotation.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85CA96E80A9624E900690CCF /* DOMNotation.h */; };
</span><span class="cx">                 1C11CCB60AA6093700DADB20 /* DOMComment.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85089CD10A98C42700A275AA /* DOMComment.h */; };
</span><span class="cx">                 1C11CCB70AA6093700DADB20 /* DOMNamedNodeMap.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8518DD760A9CF31B0091B7A6 /* DOMNamedNodeMap.h */; };
</span><span class="lines">@@ -7926,6 +7928,8 @@
</span><span class="cx">                 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSurfacePool.cpp; path = ../cg/IOSurfacePool.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19579,6 +19583,8 @@
</span><span class="cx">                                 E467680F1A0177F900B9E26B /* CacheValidation.h */,
</span><span class="cx">                                 BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */,
</span><span class="cx">                                 BCB16BFF0979C3BD00467741 /* MemoryCache.h */,
</span><ins>+                                1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */,
+                                1C0939E91A13E12900B788E5 /* CachedSVGFont.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = cache;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -26215,6 +26221,7 @@
</span><span class="cx">                                 B22279E90D00BF220071B782 /* SVGFEFuncRElement.h in Headers */,
</span><span class="cx">                                 B22279EC0D00BF220071B782 /* SVGFEGaussianBlurElement.h in Headers */,
</span><span class="cx">                                 B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */,
</span><ins>+                                1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */,
</ins><span class="cx">                                 B22279EF0D00BF220071B782 /* SVGFEImageElement.h in Headers */,
</span><span class="cx">                                 B22279F20D00BF220071B782 /* SVGFELightElement.h in Headers */,
</span><span class="cx">                                 B22279F40D00BF220071B782 /* SVGFEMergeElement.h in Headers */,
</span><span class="lines">@@ -29426,6 +29433,7 @@
</span><span class="cx">                                 51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
</span><span class="cx">                                 49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */,
</span><span class="cx">                                 4150F9F212B6E0E70008C860 /* SliderThumbElement.cpp in Sources */,
</span><ins>+                                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
</ins><span class="cx">                                 4B6FA6F70C39E4A100087011 /* SmartReplaceCF.cpp in Sources */,
</span><span class="cx">                                 E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */,
</span><span class="cx">                                 E4AFD00D0DAF335500F5F55C /* SMILTimeContainer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><ins>+#include &quot;CachedSVGFont.h&quot;
</ins><span class="cx"> #include &quot;FontCustomPlatformData.h&quot;
</span><span class="cx"> #include &quot;SVGFontData.h&quot;
</span><span class="cx"> #include &quot;SVGFontElement.h&quot;
</span><span class="lines">@@ -122,42 +123,11 @@
</span><span class="cx">     // If we are still loading, then we let the system pick a font.
</span><span class="cx">     if (isLoaded()) {
</span><span class="cx">         if (m_font) {
</span><del>-#if ENABLE(SVG_FONTS)
-            if (m_hasExternalSVGFont) {
-                // For SVG fonts parse the external SVG document, and extract the &lt;font&gt; element.
-                if (!m_font-&gt;ensureSVGFontData())
-                    return 0;
</del><ins>+            // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
+            if (!m_font-&gt;ensureCustomFontData(m_hasExternalSVGFont))
+                return nullptr;
</ins><span class="cx"> 
</span><del>-                if (!m_externalSVGFontElement) {
-                    String fragmentIdentifier;
-                    size_t start = m_string.find('#');
-                    if (start != notFound)
-                        fragmentIdentifier = m_string.string().substring(start + 1);
-                    m_externalSVGFontElement = m_font-&gt;getSVGFontById(fragmentIdentifier);
-                }
-
-                if (!m_externalSVGFontElement)
-                    return 0;
-
-                if (auto firstFontFace = childrenOfType&lt;SVGFontFaceElement&gt;(*m_externalSVGFontElement).first()) {
-                    if (!m_svgFontFaceElement) {
-                        // We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement.
-                        // Use the imported &lt;font-face&gt; tag as referencing font-face element for these cases.
-                        m_svgFontFaceElement = firstFontFace;
-                    }
-
-                    fontData = SimpleFontData::create(std::make_unique&lt;SVGFontData&gt;(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
-                }
-            } else
-#endif
-            {
-                // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
-                if (!m_font-&gt;ensureCustomFontData())
-                    return 0;
-
-                fontData = SimpleFontData::create(m_font-&gt;platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic,
-                    fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
-            }
</del><ins>+            fontData = m_font-&gt;getFontData(fontDescription, m_string, syntheticBold, syntheticItalic, m_hasExternalSVGFont);
</ins><span class="cx">         } else {
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">             // In-Document SVG Fonts
</span><span class="lines">@@ -179,23 +149,6 @@
</span><span class="cx">     return fontData.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(SVG_FONTS)
-SVGFontFaceElement* CSSFontFaceSource::svgFontFaceElement() const
-{
-    return m_svgFontFaceElement.get();
-}
-
-void CSSFontFaceSource::setSVGFontFaceElement(PassRefPtr&lt;SVGFontFaceElement&gt; element)
-{
-    m_svgFontFaceElement = element;
-}
-
-bool CSSFontFaceSource::isSVGFontFaceSource() const
-{
-    return m_svgFontFaceElement || m_hasExternalSVGFont;
-}
-#endif
-
</del><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> bool CSSFontFaceSource::isDecodeError() const
</span><span class="cx"> {
</span><span class="lines">@@ -208,11 +161,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_font)
</span><span class="cx">         return false;
</span><del>-#if ENABLE(SVG_FONTS)
-    if (m_hasExternalSVGFont)
-        return m_font-&gt;ensureSVGFontData();
-#endif
-    return m_font-&gt;ensureCustomFontData();
</del><ins>+    return m_font-&gt;ensureCustomFontData(m_hasExternalSVGFont);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSource.h (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.h        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -28,6 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CachedFontClient.h&quot;
</span><span class="cx"> #include &quot;CachedResourceHandle.h&quot;
</span><ins>+#include &quot;SharedBuffer.h&quot;
+#if ENABLE(SVG_FONTS)
+#include &quot;SVGFontElement.h&quot;
+#include &quot;SVGFontFaceElement.h&quot;
+#endif
</ins><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="lines">@@ -39,10 +44,6 @@
</span><span class="cx"> class CSSFontSelector;
</span><span class="cx"> class FontDescription;
</span><span class="cx"> class SimpleFontData;
</span><del>-#if ENABLE(SVG_FONTS)
-class SVGFontElement;
-class SVGFontFaceElement;
-#endif
</del><span class="cx"> 
</span><span class="cx"> class CSSFontFaceSource final : public CachedFontClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -63,10 +64,10 @@
</span><span class="cx">     void pruneTable();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-    SVGFontFaceElement* svgFontFaceElement() const;
-    void setSVGFontFaceElement(PassRefPtr&lt;SVGFontFaceElement&gt;);
-    bool isSVGFontFaceSource() const;
-    void setHasExternalSVGFont(bool value) { m_hasExternalSVGFont = value; }
</del><ins>+    SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement.get(); }
+    void setSVGFontFaceElement(PassRefPtr&lt;SVGFontFaceElement&gt; element) { m_svgFontFaceElement = element; }
+    bool isSVGFontFaceSource() const { return m_svgFontFaceElement || m_hasExternalSVGFont; }
+    void setHasExternalSVGFont() { m_hasExternalSVGFont = true; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="lines">@@ -84,7 +85,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">     RefPtr&lt;SVGFontFaceElement&gt; m_svgFontFaceElement;
</span><del>-    RefPtr&lt;SVGFontElement&gt; m_externalSVGFontElement;
</del><span class="cx">     bool m_hasExternalSVGFont;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSrcValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -43,6 +43,11 @@
</span><span class="cx"> {
</span><span class="cx">     return equalIgnoringCase(m_format, &quot;svg&quot;);
</span><span class="cx"> }
</span><ins>+
+bool CSSFontFaceSrcValue::isSVGFontTarget() const
+{
+    return isSVGFontFaceSrc() || svgFontFaceElement();
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool CSSFontFaceSrcValue::isSupportedFormat() const
</span><span class="lines">@@ -93,12 +98,12 @@
</span><span class="cx">     return m_cachedFont-&gt;loadFailedOrCanceled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document)
</del><ins>+CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isSVG)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_cachedFont) {
</span><span class="cx">         CachedResourceRequest request(ResourceRequest(document-&gt;completeURL(m_resource)));
</span><span class="cx">         request.setInitiator(cachedResourceRequestInitiators().css);
</span><del>-        m_cachedFont = document-&gt;cachedResourceLoader()-&gt;requestFont(request);
</del><ins>+        m_cachedFont = document-&gt;cachedResourceLoader()-&gt;requestFont(request, isSVG);
</ins><span class="cx">     }
</span><span class="cx">     return m_cachedFont.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSrcValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSrcValue.h (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">     bool isSVGFontFaceSrc() const;
</span><ins>+    bool isSVGFontTarget() const;
</ins><span class="cx"> 
</span><span class="cx">     SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; }
</span><span class="cx">     void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceElement = element; }
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasFailedOrCanceledSubresources() const;
</span><span class="cx"> 
</span><del>-    CachedFont* cachedFont(Document*);
</del><ins>+    CachedFont* cachedFont(Document*, bool isSVG);
</ins><span class="cx"> 
</span><span class="cx">     bool equals(const CSSFontFaceSrcValue&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -212,12 +212,12 @@
</span><span class="cx">             Settings* settings = m_document ? m_document-&gt;frame() ? &amp;m_document-&gt;frame()-&gt;settings() : 0 : 0;
</span><span class="cx">             bool allowDownloading = foundSVGFont || (settings &amp;&amp; settings-&gt;downloadableBinaryFontsEnabled());
</span><span class="cx">             if (allowDownloading &amp;&amp; item.isSupportedFormat() &amp;&amp; m_document) {
</span><del>-                CachedFont* cachedFont = item.cachedFont(m_document);
</del><ins>+                CachedFont* cachedFont = item.cachedFont(m_document, foundSVGFont);
</ins><span class="cx">                 if (cachedFont) {
</span><span class="cx">                     source = std::make_unique&lt;CSSFontFaceSource&gt;(item.resource(), cachedFont);
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">                     if (foundSVGFont)
</span><del>-                        source-&gt;setHasExternalSVGFont(true);
</del><ins>+                        source-&gt;setHasExternalSVGFont();
</ins><span class="cx"> #endif
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -297,6 +297,9 @@
</span><span class="cx">     switch (cachedResource.type()) {
</span><span class="cx">     case CachedResource::ImageResource:
</span><span class="cx">         return InspectorPageAgent::ImageResource;
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource:
</span><span class="cx">         return InspectorPageAgent::FontResource;
</span><span class="cx">     case CachedResource::CSSStyleSheet:
</span><span class="lines">@@ -454,6 +457,9 @@
</span><span class="cx">         switch (cachedResource-&gt;type()) {
</span><span class="cx">         case CachedResource::ImageResource:
</span><span class="cx">             // Skip images that were not auto loaded (images disabled in the user agent).
</span><ins>+#if ENABLE(SVG_FONTS)
+        case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">         case CachedResource::FontResource:
</span><span class="cx">             // Skip fonts that were referenced in CSS but never used/downloaded.
</span><span class="cx">             if (cachedResource-&gt;stillNeedsLoad())
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;CachedResourceClientWalker.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;FontCustomPlatformData.h&quot;
</span><ins>+#include &quot;FontDescription.h&quot;
</ins><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="lines">@@ -39,6 +40,10 @@
</span><span class="cx"> #include &quot;WOFFFileFormat.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(SVG_OTF_CONVERTER)
+#include &quot;SVGToOTFFontConversion.h&quot;
+#endif
+
</ins><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> #include &quot;NodeList.h&quot;
</span><span class="cx"> #include &quot;SVGDocument.h&quot;
</span><span class="lines">@@ -50,8 +55,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-CachedFont::CachedFont(const ResourceRequest&amp; resourceRequest, SessionID sessionID)
-    : CachedResource(resourceRequest, FontResource, sessionID)
</del><ins>+CachedFont::CachedFont(const ResourceRequest&amp; resourceRequest, SessionID sessionID, Type type)
+    : CachedResource(resourceRequest, type, sessionID)
</ins><span class="cx">     , m_loadInitiated(false)
</span><span class="cx">     , m_hasCreatedFontDataWrappingResource(false)
</span><span class="cx"> {
</span><span class="lines">@@ -91,7 +96,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CachedFont::ensureCustomFontData()
</del><ins>+bool CachedFont::ensureCustomFontData(bool)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_fontData &amp;&amp; !errorOccurred() &amp;&amp; !isLoading() &amp;&amp; m_data) {
</span><span class="cx">         RefPtr&lt;SharedBuffer&gt; buffer = m_data;
</span><span class="lines">@@ -118,46 +123,18 @@
</span><span class="cx">     return m_fontData.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;SimpleFontData&gt; CachedFont::getFontData(const FontDescription&amp; fontDescription, const AtomicString&amp;, bool syntheticBold, bool syntheticItalic, bool)
+{
+    return SimpleFontData::create(platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic,
+        fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
+}
+
</ins><span class="cx"> FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
</span><span class="cx"> {
</span><del>-#if ENABLE(SVG_FONTS)
-    if (m_externalSVGDocument)
-        return FontPlatformData(size, bold, italic);
-#endif
</del><span class="cx">     ASSERT(m_fontData);
</span><span class="cx">     return m_fontData-&gt;fontPlatformData(static_cast&lt;int&gt;(size), bold, italic, orientation, widthVariant, renderingMode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(SVG_FONTS)
-
-bool CachedFont::ensureSVGFontData()
-{
-    if (!m_externalSVGDocument &amp;&amp; !errorOccurred() &amp;&amp; !isLoading() &amp;&amp; m_data) {
-        m_externalSVGDocument = SVGDocument::create(nullptr, URL());
-        RefPtr&lt;TextResourceDecoder&gt; decoder = TextResourceDecoder::create(&quot;application/xml&quot;);
-        m_externalSVGDocument-&gt;setContent(decoder-&gt;decodeAndFlush(m_data-&gt;data(), m_data-&gt;size()));
-        if (decoder-&gt;sawError())
-            m_externalSVGDocument = nullptr;
-    }
-    return m_externalSVGDocument;
-}
-
-SVGFontElement* CachedFont::getSVGFontById(const String&amp; fontName) const
-{
-    auto elements = descendantsOfType&lt;SVGFontElement&gt;(*m_externalSVGDocument);
-
-    if (fontName.isEmpty())
-        return elements.first();
-
-    for (auto&amp; element : elements) {
-        if (element.getIdAttribute() == fontName)
-            return &amp;element;
-    }
-    return nullptr;
-}
-
-#endif
-
</del><span class="cx"> void CachedFont::allClientsRemoved()
</span><span class="cx"> {
</span><span class="cx">     m_fontData = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.h (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -31,31 +31,32 @@
</span><span class="cx"> #include &quot;FontOrientation.h&quot;
</span><span class="cx"> #include &quot;FontRenderingMode.h&quot;
</span><span class="cx"> #include &quot;FontWidthVariant.h&quot;
</span><ins>+#include &quot;SimpleFontData.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CachedResourceLoader;
</span><ins>+class FontDescription;
</ins><span class="cx"> class FontPlatformData;
</span><span class="cx"> class SVGDocument;
</span><span class="cx"> class SVGFontElement;
</span><span class="cx"> struct FontCustomPlatformData;
</span><span class="cx"> 
</span><del>-class CachedFont final : public CachedResource {
</del><ins>+class CachedFont : public CachedResource {
</ins><span class="cx"> public:
</span><del>-    CachedFont(const ResourceRequest&amp;, SessionID);
</del><ins>+    CachedFont(const ResourceRequest&amp;, SessionID, Type = FontResource);
</ins><span class="cx">     virtual ~CachedFont();
</span><span class="cx"> 
</span><span class="cx">     void beginLoadIfNeeded(CachedResourceLoader* dl);
</span><span class="cx">     virtual bool stillNeedsLoad() const override { return !m_loadInitiated; }
</span><span class="cx"> 
</span><del>-    bool ensureCustomFontData();
-    FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
</del><ins>+    virtual bool ensureCustomFontData(bool externalSVG);
</ins><span class="cx"> 
</span><del>-#if ENABLE(SVG_FONTS)
-    bool ensureSVGFontData();
-    SVGFontElement* getSVGFontById(const String&amp;) const;
-#endif
</del><ins>+    virtual PassRefPtr&lt;SimpleFontData&gt; getFontData(const FontDescription&amp;, const AtomicString&amp; remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG);
</ins><span class="cx"> 
</span><ins>+protected:
+    FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual void checkNotify() override;
</span><span class="cx">     virtual bool mayTryReplaceEncodedData() const override;
</span><span class="lines">@@ -71,10 +72,6 @@
</span><span class="cx">     bool m_loadInitiated;
</span><span class="cx">     bool m_hasCreatedFontDataWrappingResource;
</span><span class="cx"> 
</span><del>-#if ENABLE(SVG_FONTS)
-    RefPtr&lt;SVGDocument&gt; m_externalSVGDocument;
-#endif
-
</del><span class="cx">     friend class MemoryCache;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -69,6 +69,9 @@
</span><span class="cx">     case CachedResource::CSSStyleSheet:
</span><span class="cx">         return ResourceLoadPriorityHigh;
</span><span class="cx">     case CachedResource::Script:
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource:
</span><span class="cx">     case CachedResource::RawResource:
</span><span class="cx">         return ResourceLoadPriorityMedium;
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">         CSSStyleSheet,
</span><span class="cx">         Script,
</span><span class="cx">         FontResource,
</span><ins>+#if ENABLE(SVG_FONTS)
+        SVGFontResource,
+#endif
</ins><span class="cx">         RawResource,
</span><span class="cx">         SVGDocumentResource
</span><span class="cx"> #if ENABLE(XSLT)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="cx"> #include &quot;CachedRawResource.h&quot;
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><ins>+#include &quot;CachedSVGFont.h&quot;
</ins><span class="cx"> #include &quot;CachedScript.h&quot;
</span><span class="cx"> #include &quot;CachedXSLStyleSheet.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="lines">@@ -84,6 +85,10 @@
</span><span class="cx">         return new CachedScript(request, charset, sessionID);
</span><span class="cx">     case CachedResource::SVGDocumentResource:
</span><span class="cx">         return new CachedSVGDocument(request, sessionID);
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+        return new CachedSVGFont(request, sessionID);
+#endif
</ins><span class="cx">     case CachedResource::FontResource:
</span><span class="cx">         return new CachedFont(request, sessionID);
</span><span class="cx">     case CachedResource::RawResource:
</span><span class="lines">@@ -175,8 +180,10 @@
</span><span class="cx">     return downcast&lt;CachedImage&gt;(requestResource(CachedResource::ImageResource, request).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CachedResourceHandle&lt;CachedFont&gt; CachedResourceLoader::requestFont(CachedResourceRequest&amp; request)
</del><ins>+CachedResourceHandle&lt;CachedFont&gt; CachedResourceLoader::requestFont(CachedResourceRequest&amp; request, bool isSVG)
</ins><span class="cx"> {
</span><ins>+    if (isSVG)
+        return downcast&lt;CachedSVGFont&gt;(requestResource(CachedResource::SVGFontResource, request).get());
</ins><span class="cx">     return downcast&lt;CachedFont&gt;(requestResource(CachedResource::FontResource, request).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -274,6 +281,9 @@
</span><span class="cx"> #endif
</span><span class="cx">     case CachedResource::RawResource:
</span><span class="cx">     case CachedResource::ImageResource:
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource: {
</span><span class="cx">         // These resources can corrupt only the frame's pixels.
</span><span class="cx">         if (Frame* f = frame()) {
</span><span class="lines">@@ -314,6 +324,9 @@
</span><span class="cx">     case CachedResource::ImageResource:
</span><span class="cx">     case CachedResource::CSSStyleSheet:
</span><span class="cx">     case CachedResource::Script:
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource:
</span><span class="cx">     case CachedResource::RawResource:
</span><span class="cx"> #if ENABLE(LINK_PREFETCH)
</span><span class="lines">@@ -361,6 +374,9 @@
</span><span class="cx">         if (!shouldBypassMainWorldContentSecurityPolicy &amp;&amp; !m_document-&gt;contentSecurityPolicy()-&gt;allowImageFromSource(url))
</span><span class="cx">             return false;
</span><span class="cx">         break;
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource: {
</span><span class="cx">         if (!shouldBypassMainWorldContentSecurityPolicy &amp;&amp; !m_document-&gt;contentSecurityPolicy()-&gt;allowFontFromSource(url))
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     CachedResourceHandle&lt;CachedCSSStyleSheet&gt; requestCSSStyleSheet(CachedResourceRequest&amp;);
</span><span class="cx">     CachedResourceHandle&lt;CachedCSSStyleSheet&gt; requestUserCSSStyleSheet(CachedResourceRequest&amp;);
</span><span class="cx">     CachedResourceHandle&lt;CachedScript&gt; requestScript(CachedResourceRequest&amp;);
</span><del>-    CachedResourceHandle&lt;CachedFont&gt; requestFont(CachedResourceRequest&amp;);
</del><ins>+    CachedResourceHandle&lt;CachedFont&gt; requestFont(CachedResourceRequest&amp;, bool isSVG);
</ins><span class="cx">     CachedResourceHandle&lt;CachedRawResource&gt; requestRawResource(CachedResourceRequest&amp;);
</span><span class="cx">     CachedResourceHandle&lt;CachedRawResource&gt; requestMainResource(CachedResourceRequest&amp;);
</span><span class="cx">     CachedResourceHandle&lt;CachedSVGDocument&gt; requestSVGDocument(CachedResourceRequest&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFontcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp (0 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp                                (rev 0)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' 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 INC. OR
+ * 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. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;CachedSVGFont.h&quot;
+
+#if ENABLE(SVG_FONTS)
+
+#include &quot;FontDescription.h&quot;
+#include &quot;FontPlatformData.h&quot;
+#include &quot;SVGDocument.h&quot;
+#include &quot;SVGFontData.h&quot;
+#include &quot;SVGFontElement.h&quot;
+#include &quot;SVGFontFaceElement.h&quot;
+#include &quot;SharedBuffer.h&quot;
+#include &quot;TextResourceDecoder.h&quot;
+#include &quot;TypedElementDescendantIterator.h&quot;
+
+namespace WebCore {
+
+CachedSVGFont::CachedSVGFont(const ResourceRequest&amp; resourceRequest, SessionID sessionID)
+    : CachedFont(resourceRequest, sessionID, SVGFontResource)
+    , m_externalSVGFontElement(nullptr)
+{
+}
+
+PassRefPtr&lt;SimpleFontData&gt; CachedSVGFont::getFontData(const FontDescription&amp; fontDescription, const AtomicString&amp; remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG)
+{
+    if (!externalSVG)
+        return CachedFont::getFontData(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG);
+
+    if (SVGFontFaceElement* firstFontFace = this-&gt;firstFontFace(remoteURI))
+        return SimpleFontData::create(std::make_unique&lt;SVGFontData&gt;(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
+    return nullptr;
+}
+
+FontPlatformData CachedSVGFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
+{
+    if (m_externalSVGDocument)
+        return FontPlatformData(size, bold, italic);
+    return CachedFont::platformDataFromCustomData(size, bold, italic, orientation, widthVariant, renderingMode);
+}
+
+bool CachedSVGFont::ensureCustomFontData(bool externalSVG)
+{
+    if (!externalSVG)
+        return CachedFont::ensureCustomFontData(externalSVG);
+
+    if (!m_externalSVGDocument &amp;&amp; !errorOccurred() &amp;&amp; !isLoading() &amp;&amp; m_data) {
+        m_externalSVGDocument = SVGDocument::create(nullptr, URL());
+        RefPtr&lt;TextResourceDecoder&gt; decoder = TextResourceDecoder::create(&quot;application/xml&quot;);
+        m_externalSVGDocument-&gt;setContent(decoder-&gt;decodeAndFlush(m_data-&gt;data(), m_data-&gt;size()));
+        if (decoder-&gt;sawError())
+            m_externalSVGDocument = nullptr;
+    }
+    return m_externalSVGDocument;
+}
+
+SVGFontElement* CachedSVGFont::getSVGFontById(const String&amp; fontName) const
+{
+    auto elements = descendantsOfType&lt;SVGFontElement&gt;(*m_externalSVGDocument);
+
+    if (fontName.isEmpty())
+        return elements.first();
+
+    for (auto&amp; element : elements) {
+        if (element.getIdAttribute() == fontName)
+            return &amp;element;
+    }
+    return nullptr;
+}
+
+SVGFontFaceElement* CachedSVGFont::firstFontFace(const AtomicString&amp; remoteURI)
+{
+    if (!m_externalSVGFontElement) {
+        String fragmentIdentifier;
+        size_t start = remoteURI.find('#');
+        if (start != notFound)
+            fragmentIdentifier = remoteURI.string().substring(start + 1);
+        m_externalSVGFontElement = getSVGFontById(fragmentIdentifier);
+    }
+
+    if (!m_externalSVGFontElement)
+        return nullptr;
+
+    if (auto* firstFontFace = childrenOfType&lt;SVGFontFaceElement&gt;(*m_externalSVGFontElement).first())
+        return firstFontFace;
+    return nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFonthfromrev176263trunkSourceWebCoreloadercacheCachedFonth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/loader/cache/CachedSVGFont.h (from rev 176263, trunk/Source/WebCore/loader/cache/CachedFont.h) (0 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.h                                (rev 0)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.h        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' 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 INC. OR
+ * 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 CachedSVGFont_h
+#define CachedSVGFont_h
+
+#if ENABLE(SVG_FONTS)
+
+#include &quot;CachedFont.h&quot;
+
+namespace WebCore {
+
+class SVGFontFaceElement;
+
+class CachedSVGFont final : public CachedFont {
+public:
+    CachedSVGFont(const ResourceRequest&amp;, SessionID);
+
+    virtual bool ensureCustomFontData(bool externalSVG) override;
+    
+    virtual PassRefPtr&lt;SimpleFontData&gt; getFontData(const FontDescription&amp;, const AtomicString&amp; remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG) override;
+
+private:
+    FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
+
+    SVGFontElement* getSVGFontById(const String&amp;) const;
+
+    SVGFontFaceElement* firstFontFace(const AtomicString&amp; remoteURI);
+
+    RefPtr&lt;SVGDocument&gt; m_externalSVGDocument;
+    SVGFontElement* m_externalSVGFontElement;
+};
+
+}
+
+SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedSVGFont, CachedResource::SVGFontResource)
+
+#endif
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -824,6 +824,9 @@
</span><span class="cx">                     stats.xslStyleSheets.addResource(resource);
</span><span class="cx">                     break;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(SVG_FONTS)
+                case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">                 case CachedResource::FontResource:
</span><span class="cx">                     stats.fonts.addResource(resource);
</span><span class="cx">                     break;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceUriElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -88,6 +88,12 @@
</span><span class="cx">     return SVGElement::insertedInto(rootParent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isSVGFontTarget(const SVGFontFaceUriElement&amp; element)
+{
+    Ref&lt;CSSFontFaceSrcValue&gt; srcValue(element.srcValue());
+    return srcValue-&gt;isSVGFontTarget();
+}
+
</ins><span class="cx"> void SVGFontFaceUriElement::loadFont()
</span><span class="cx"> {
</span><span class="cx">     if (m_cachedFont)
</span><span class="lines">@@ -98,7 +104,7 @@
</span><span class="cx">         CachedResourceLoader* cachedResourceLoader = document().cachedResourceLoader();
</span><span class="cx">         CachedResourceRequest request(ResourceRequest(document().completeURL(href)));
</span><span class="cx">         request.setInitiator(this);
</span><del>-        m_cachedFont = cachedResourceLoader-&gt;requestFont(request);
</del><ins>+        m_cachedFont = cachedResourceLoader-&gt;requestFont(request, isSVGFontTarget(*this));
</ins><span class="cx">         if (m_cachedFont) {
</span><span class="cx">             m_cachedFont-&gt;addClient(this);
</span><span class="cx">             m_cachedFont-&gt;beginLoadIfNeeded(cachedResourceLoader);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-11-18  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Subclass CachedFont for SVG fonts
+        https://bugs.webkit.org/show_bug.cgi?id=138686
+
+        Reviewed by Simon Fraser.
+
+        Update for enum type.
+
+        * WebProcess/Network/WebResourceLoadScheduler.cpp:
+        (WebKit::maximumBufferingTime):
+
</ins><span class="cx"> 2014-11-18  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Add API to create a WebKitWebContext
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp (176263 => 176264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-18 18:04:13 UTC (rev 176263)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-18 18:04:17 UTC (rev 176264)
</span><span class="lines">@@ -92,6 +92,9 @@
</span><span class="cx">     switch (resource-&gt;type()) {
</span><span class="cx">     case CachedResource::CSSStyleSheet:
</span><span class="cx">     case CachedResource::Script:
</span><ins>+#if ENABLE(SVG_FONTS)
+    case CachedResource::SVGFontResource:
+#endif
</ins><span class="cx">     case CachedResource::FontResource:
</span><span class="cx">         return std::chrono::milliseconds::max();
</span><span class="cx">     case CachedResource::ImageResource:
</span></span></pre>
</div>
</div>

</body>
</html>