<!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>[176267] 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/176267">176267</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-18 10:52:38 -0800 (Tue, 18 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/176264">r176264</a>.
https://bugs.webkit.org/show_bug.cgi?id=138837
caused many test failures (Requested by litherum on #webkit).
Reverted changeset:
"Subclass CachedFont for SVG fonts"
https://bugs.webkit.org/show_bug.cgi?id=138686
http://trac.webkit.org/changeset/176264</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>Removed 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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1842,7 +1842,6 @@
</span><span class="cx"> loader/archive/mhtml/MHTMLParser.cpp
</span><span class="cx">
</span><span class="cx"> loader/cache/CachedCSSStyleSheet.cpp
</span><del>- loader/cache/CachedSVGFont.cpp
</del><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/ChangeLog        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-11-18 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r176264.
+ https://bugs.webkit.org/show_bug.cgi?id=138837
+
+ caused many test failures (Requested by litherum on #webkit).
+
+ Reverted changeset:
+
+ "Subclass CachedFont for SVG fonts"
+ https://bugs.webkit.org/show_bug.cgi?id=138686
+ http://trac.webkit.org/changeset/176264
+
</ins><span class="cx"> 2014-11-18 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -7328,7 +7328,6 @@
</span><span class="cx"> <ClCompile Include="..\loader\archive\mhtml\MHTMLParser.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\cache\CachedCSSStyleSheet.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\cache\CachedFont.cpp" />
</span><del>- <ClCompile Include="..\loader\cache\CachedSVGFont.cpp" />
</del><span class="cx"> <ClCompile Include="..\loader\cache\CachedImage.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\cache\CachedRawResource.cpp" />
</span><span class="cx"> <ClCompile Include="..\loader\cache\CachedResource.cpp" />
</span><span class="lines">@@ -19280,7 +19279,6 @@
</span><span class="cx"> <ClInclude Include="..\loader\archive\mhtml\MHTMLParser.h" />
</span><span class="cx"> <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h" />
</span><span class="cx"> <ClInclude Include="..\loader\cache\CachedFont.h" />
</span><del>- <ClInclude Include="..\loader\cache\CachedSVGFont.h" />
</del><span class="cx"> <ClInclude Include="..\loader\cache\CachedImage.h" />
</span><span class="cx"> <ClInclude Include="..\loader\cache\CachedRawResource.h" />
</span><span class="cx"> <ClInclude Include="..\loader\cache\CachedRawResourceClient.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1026,9 +1026,6 @@
</span><span class="cx"> <ClCompile Include="..\loader\cache\CachedCSSStyleSheet.cpp">
</span><span class="cx"> <Filter>loader\cache</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\loader\cache\CachedSVGFont.cpp">
- <Filter>loader\cache</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\loader\cache\CachedFont.cpp">
</span><span class="cx"> <Filter>loader\cache</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -8055,9 +8052,6 @@
</span><span class="cx"> <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h">
</span><span class="cx"> <Filter>loader\cache</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\loader\cache\CachedSVGFont.h">
- <Filter>loader\cache</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\loader\cache\CachedFont.h">
</span><span class="cx"> <Filter>loader\cache</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -927,8 +927,6 @@
</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><del>-                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
-                1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0939E91A13E12900B788E5 /* CachedSVGFont.h */; };
</del><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">@@ -7934,8 +7932,6 @@
</span><span class="cx">                 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
</span><span class="cx">                 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = "<group>"; };
</span><del>-                1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
-                1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = "<group>"; };
</del><span class="cx">                 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
</span><span class="cx">                 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSurfacePool.cpp; path = ../cg/IOSurfacePool.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -19601,8 +19597,6 @@
</span><span class="cx">                                 E467680F1A0177F900B9E26B /* CacheValidation.h */,
</span><span class="cx">                                 BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */,
</span><span class="cx">                                 BCB16BFF0979C3BD00467741 /* MemoryCache.h */,
</span><del>-                                1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */,
-                                1C0939E91A13E12900B788E5 /* CachedSVGFont.h */,
</del><span class="cx">                         );
</span><span class="cx">                         path = cache;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -26245,7 +26239,6 @@
</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><del>-                                1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */,
</del><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">@@ -29457,7 +29450,6 @@
</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><del>-                                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
</del><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "SimpleFontData.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-#include "CachedSVGFont.h"
</del><span class="cx"> #include "FontCustomPlatformData.h"
</span><span class="cx"> #include "SVGFontData.h"
</span><span class="cx"> #include "SVGFontElement.h"
</span><span class="lines">@@ -123,11 +122,42 @@
</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>- // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
- if (!m_font->ensureCustomFontData(m_hasExternalSVGFont))
- return nullptr;
</del><ins>+#if ENABLE(SVG_FONTS)
+ if (m_hasExternalSVGFont) {
+ // For SVG fonts parse the external SVG document, and extract the <font> element.
+ if (!m_font->ensureSVGFontData())
+ return 0;
</ins><span class="cx">
</span><del>- fontData = m_font->getFontData(fontDescription, m_string, syntheticBold, syntheticItalic, m_hasExternalSVGFont);
</del><ins>+ 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->getSVGFontById(fragmentIdentifier);
+ }
+
+ if (!m_externalSVGFontElement)
+ return 0;
+
+ if (auto firstFontFace = childrenOfType<SVGFontFaceElement>(*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 <font-face> tag as referencing font-face element for these cases.
+ m_svgFontFaceElement = firstFontFace;
+ }
+
+ fontData = SimpleFontData::create(std::make_unique<SVGFontData>(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
+ }
+ } else
+#endif
+ {
+ // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
+ if (!m_font->ensureCustomFontData())
+ return 0;
+
+ fontData = SimpleFontData::create(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic,
+ fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
+ }
</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">@@ -149,6 +179,23 @@
</span><span class="cx"> return fontData.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(SVG_FONTS)
+SVGFontFaceElement* CSSFontFaceSource::svgFontFaceElement() const
+{
+ return m_svgFontFaceElement.get();
+}
+
+void CSSFontFaceSource::setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement> element)
+{
+ m_svgFontFaceElement = element;
+}
+
+bool CSSFontFaceSource::isSVGFontFaceSource() const
+{
+ return m_svgFontFaceElement || m_hasExternalSVGFont;
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> bool CSSFontFaceSource::isDecodeError() const
</span><span class="cx"> {
</span><span class="lines">@@ -161,7 +208,11 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_font)
</span><span class="cx"> return false;
</span><del>- return m_font->ensureCustomFontData(m_hasExternalSVGFont);
</del><ins>+#if ENABLE(SVG_FONTS)
+ if (m_hasExternalSVGFont)
+ return m_font->ensureSVGFontData();
+#endif
+ return m_font->ensureCustomFontData();
</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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -28,11 +28,6 @@
</span><span class="cx">
</span><span class="cx"> #include "CachedFontClient.h"
</span><span class="cx"> #include "CachedResourceHandle.h"
</span><del>-#include "SharedBuffer.h"
-#if ENABLE(SVG_FONTS)
-#include "SVGFontElement.h"
-#include "SVGFontFaceElement.h"
-#endif
</del><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="lines">@@ -44,6 +39,10 @@
</span><span class="cx"> class CSSFontSelector;
</span><span class="cx"> class FontDescription;
</span><span class="cx"> class SimpleFontData;
</span><ins>+#if ENABLE(SVG_FONTS)
+class SVGFontElement;
+class SVGFontFaceElement;
+#endif
</ins><span class="cx">
</span><span class="cx"> class CSSFontFaceSource final : public CachedFontClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -64,10 +63,10 @@
</span><span class="cx"> void pruneTable();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>- SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement.get(); }
- void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement> element) { m_svgFontFaceElement = element; }
- bool isSVGFontFaceSource() const { return m_svgFontFaceElement || m_hasExternalSVGFont; }
- void setHasExternalSVGFont() { m_hasExternalSVGFont = true; }
</del><ins>+ SVGFontFaceElement* svgFontFaceElement() const;
+ void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement>);
+ bool isSVGFontFaceSource() const;
+ void setHasExternalSVGFont(bool value) { m_hasExternalSVGFont = value; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="lines">@@ -85,6 +84,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> RefPtr<SVGFontFaceElement> m_svgFontFaceElement;
</span><ins>+ RefPtr<SVGFontElement> m_externalSVGFontElement;
</ins><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -43,11 +43,6 @@
</span><span class="cx"> {
</span><span class="cx"> return equalIgnoringCase(m_format, "svg");
</span><span class="cx"> }
</span><del>-
-bool CSSFontFaceSrcValue::isSVGFontTarget() const
-{
- return isSVGFontFaceSrc() || svgFontFaceElement();
-}
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool CSSFontFaceSrcValue::isSupportedFormat() const
</span><span class="lines">@@ -98,12 +93,12 @@
</span><span class="cx"> return m_cachedFont->loadFailedOrCanceled();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isSVG)
</del><ins>+CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_cachedFont) {
</span><span class="cx"> CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)));
</span><span class="cx"> request.setInitiator(cachedResourceRequestInitiators().css);
</span><del>- m_cachedFont = document->cachedResourceLoader()->requestFont(request, isSVG);
</del><ins>+ m_cachedFont = document->cachedResourceLoader()->requestFont(request);
</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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -58,7 +58,6 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> bool isSVGFontFaceSrc() const;
</span><del>- bool isSVGFontTarget() const;
</del><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">@@ -70,7 +69,7 @@
</span><span class="cx">
</span><span class="cx"> bool hasFailedOrCanceledSubresources() const;
</span><span class="cx">
</span><del>- CachedFont* cachedFont(Document*, bool isSVG);
</del><ins>+ CachedFont* cachedFont(Document*);
</ins><span class="cx">
</span><span class="cx"> bool equals(const CSSFontFaceSrcValue&) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -212,12 +212,12 @@
</span><span class="cx"> Settings* settings = m_document ? m_document->frame() ? &m_document->frame()->settings() : 0 : 0;
</span><span class="cx"> bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
</span><span class="cx"> if (allowDownloading && item.isSupportedFormat() && m_document) {
</span><del>- CachedFont* cachedFont = item.cachedFont(m_document, foundSVGFont);
</del><ins>+ CachedFont* cachedFont = item.cachedFont(m_document);
</ins><span class="cx"> if (cachedFont) {
</span><span class="cx"> source = std::make_unique<CSSFontFaceSource>(item.resource(), cachedFont);
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> if (foundSVGFont)
</span><del>- source->setHasExternalSVGFont();
</del><ins>+ source->setHasExternalSVGFont(true);
</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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -297,9 +297,6 @@
</span><span class="cx"> switch (cachedResource.type()) {
</span><span class="cx"> case CachedResource::ImageResource:
</span><span class="cx"> return InspectorPageAgent::ImageResource;
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><span class="cx"> case CachedResource::FontResource:
</span><span class="cx"> return InspectorPageAgent::FontResource;
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><span class="lines">@@ -457,9 +454,6 @@
</span><span class="cx"> switch (cachedResource->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><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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->stillNeedsLoad())
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "CachedResourceClientWalker.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "FontCustomPlatformData.h"
</span><del>-#include "FontDescription.h"
</del><span class="cx"> #include "FontPlatformData.h"
</span><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="lines">@@ -40,10 +39,6 @@
</span><span class="cx"> #include "WOFFFileFormat.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-#if ENABLE(SVG_OTF_CONVERTER)
-#include "SVGToOTFFontConversion.h"
-#endif
-
</del><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> #include "NodeList.h"
</span><span class="cx"> #include "SVGDocument.h"
</span><span class="lines">@@ -55,8 +50,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-CachedFont::CachedFont(const ResourceRequest& resourceRequest, SessionID sessionID, Type type)
- : CachedResource(resourceRequest, type, sessionID)
</del><ins>+CachedFont::CachedFont(const ResourceRequest& resourceRequest, SessionID sessionID)
+ : CachedResource(resourceRequest, FontResource, sessionID)
</ins><span class="cx"> , m_loadInitiated(false)
</span><span class="cx"> , m_hasCreatedFontDataWrappingResource(false)
</span><span class="cx"> {
</span><span class="lines">@@ -96,7 +91,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CachedFont::ensureCustomFontData(bool)
</del><ins>+bool CachedFont::ensureCustomFontData()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_fontData && !errorOccurred() && !isLoading() && m_data) {
</span><span class="cx"> RefPtr<SharedBuffer> buffer = m_data;
</span><span class="lines">@@ -123,18 +118,46 @@
</span><span class="cx"> return m_fontData.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<SimpleFontData> CachedFont::getFontData(const FontDescription& fontDescription, const AtomicString&, bool syntheticBold, bool syntheticItalic, bool)
-{
- return SimpleFontData::create(platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic,
- fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
-}
-
</del><span class="cx"> FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant, FontRenderingMode renderingMode)
</span><span class="cx"> {
</span><ins>+#if ENABLE(SVG_FONTS)
+ if (m_externalSVGDocument)
+ return FontPlatformData(size, bold, italic);
+#endif
</ins><span class="cx"> ASSERT(m_fontData);
</span><span class="cx"> return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, widthVariant, renderingMode);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(SVG_FONTS)
+
+bool CachedFont::ensureSVGFontData()
+{
+ if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
+ m_externalSVGDocument = SVGDocument::create(nullptr, URL());
+ RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
+ m_externalSVGDocument->setContent(decoder->decodeAndFlush(m_data->data(), m_data->size()));
+ if (decoder->sawError())
+ m_externalSVGDocument = nullptr;
+ }
+ return m_externalSVGDocument;
+}
+
+SVGFontElement* CachedFont::getSVGFontById(const String& fontName) const
+{
+ auto elements = descendantsOfType<SVGFontElement>(*m_externalSVGDocument);
+
+ if (fontName.isEmpty())
+ return elements.first();
+
+ for (auto& element : elements) {
+ if (element.getIdAttribute() == fontName)
+ return &element;
+ }
+ return nullptr;
+}
+
+#endif
+
</ins><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -31,32 +31,31 @@
</span><span class="cx"> #include "FontOrientation.h"
</span><span class="cx"> #include "FontRenderingMode.h"
</span><span class="cx"> #include "FontWidthVariant.h"
</span><del>-#include "SimpleFontData.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class CachedResourceLoader;
</span><del>-class FontDescription;
</del><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 : public CachedResource {
</del><ins>+class CachedFont final : public CachedResource {
</ins><span class="cx"> public:
</span><del>- CachedFont(const ResourceRequest&, SessionID, Type = FontResource);
</del><ins>+ CachedFont(const ResourceRequest&, SessionID);
</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>- virtual bool ensureCustomFontData(bool externalSVG);
</del><ins>+ bool ensureCustomFontData();
+ FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
</ins><span class="cx">
</span><del>- virtual PassRefPtr<SimpleFontData> getFontData(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG);
</del><ins>+#if ENABLE(SVG_FONTS)
+ bool ensureSVGFontData();
+ SVGFontElement* getSVGFontById(const String&) const;
+#endif
</ins><span class="cx">
</span><del>-protected:
- FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
-
</del><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">@@ -72,6 +71,10 @@
</span><span class="cx"> bool m_loadInitiated;
</span><span class="cx"> bool m_hasCreatedFontDataWrappingResource;
</span><span class="cx">
</span><ins>+#if ENABLE(SVG_FONTS)
+ RefPtr<SVGDocument> m_externalSVGDocument;
+#endif
+
</ins><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -69,9 +69,6 @@
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><span class="cx"> return ResourceLoadPriorityHigh;
</span><span class="cx"> case CachedResource::Script:
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -66,9 +66,6 @@
</span><span class="cx"> CSSStyleSheet,
</span><span class="cx"> Script,
</span><span class="cx"> FontResource,
</span><del>-#if ENABLE(SVG_FONTS)
- SVGFontResource,
-#endif
</del><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "CachedImage.h"
</span><span class="cx"> #include "CachedRawResource.h"
</span><span class="cx"> #include "CachedResourceRequest.h"
</span><del>-#include "CachedSVGFont.h"
</del><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "CachedXSLStyleSheet.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="lines">@@ -85,10 +84,6 @@
</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><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
- return new CachedSVGFont(request, sessionID);
-#endif
</del><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">@@ -180,10 +175,8 @@
</span><span class="cx"> return downcast<CachedImage>(requestResource(CachedResource::ImageResource, request).get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CachedResourceHandle<CachedFont> CachedResourceLoader::requestFont(CachedResourceRequest& request, bool isSVG)
</del><ins>+CachedResourceHandle<CachedFont> CachedResourceLoader::requestFont(CachedResourceRequest& request)
</ins><span class="cx"> {
</span><del>- if (isSVG)
- return downcast<CachedSVGFont>(requestResource(CachedResource::SVGFontResource, request).get());
</del><span class="cx"> return downcast<CachedFont>(requestResource(CachedResource::FontResource, request).get());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -281,9 +274,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> case CachedResource::RawResource:
</span><span class="cx"> case CachedResource::ImageResource:
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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">@@ -324,9 +314,6 @@
</span><span class="cx"> case CachedResource::ImageResource:
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><span class="cx"> case CachedResource::Script:
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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">@@ -374,9 +361,6 @@
</span><span class="cx"> if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentSecurityPolicy()->allowImageFromSource(url))
</span><span class="cx"> return false;
</span><span class="cx"> break;
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><span class="cx"> case CachedResource::FontResource: {
</span><span class="cx"> if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentSecurityPolicy()->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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> CachedResourceHandle<CachedCSSStyleSheet> requestCSSStyleSheet(CachedResourceRequest&);
</span><span class="cx"> CachedResourceHandle<CachedCSSStyleSheet> requestUserCSSStyleSheet(CachedResourceRequest&);
</span><span class="cx"> CachedResourceHandle<CachedScript> requestScript(CachedResourceRequest&);
</span><del>- CachedResourceHandle<CachedFont> requestFont(CachedResourceRequest&, bool isSVG);
</del><ins>+ CachedResourceHandle<CachedFont> requestFont(CachedResourceRequest&);
</ins><span class="cx"> CachedResourceHandle<CachedRawResource> requestRawResource(CachedResourceRequest&);
</span><span class="cx"> CachedResourceHandle<CachedRawResource> requestMainResource(CachedResourceRequest&);
</span><span class="cx"> CachedResourceHandle<CachedSVGDocument> requestSVGDocument(CachedResourceRequest&);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFontcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1,116 +0,0 @@
</span><del>-/*
- * 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 "config.h"
-#include "CachedSVGFont.h"
-
-#if ENABLE(SVG_FONTS)
-
-#include "FontDescription.h"
-#include "FontPlatformData.h"
-#include "SVGDocument.h"
-#include "SVGFontData.h"
-#include "SVGFontElement.h"
-#include "SVGFontFaceElement.h"
-#include "SharedBuffer.h"
-#include "TextResourceDecoder.h"
-#include "TypedElementDescendantIterator.h"
-
-namespace WebCore {
-
-CachedSVGFont::CachedSVGFont(const ResourceRequest& resourceRequest, SessionID sessionID)
- : CachedFont(resourceRequest, sessionID, SVGFontResource)
- , m_externalSVGFontElement(nullptr)
-{
-}
-
-PassRefPtr<SimpleFontData> CachedSVGFont::getFontData(const FontDescription& fontDescription, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG)
-{
- if (!externalSVG)
- return CachedFont::getFontData(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG);
-
- if (SVGFontFaceElement* firstFontFace = this->firstFontFace(remoteURI))
- return SimpleFontData::create(std::make_unique<SVGFontData>(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 && !errorOccurred() && !isLoading() && m_data) {
- m_externalSVGDocument = SVGDocument::create(nullptr, URL());
- RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
- m_externalSVGDocument->setContent(decoder->decodeAndFlush(m_data->data(), m_data->size()));
- if (decoder->sawError())
- m_externalSVGDocument = nullptr;
- }
- return m_externalSVGDocument;
-}
-
-SVGFontElement* CachedSVGFont::getSVGFontById(const String& fontName) const
-{
- auto elements = descendantsOfType<SVGFontElement>(*m_externalSVGDocument);
-
- if (fontName.isEmpty())
- return elements.first();
-
- for (auto& element : elements) {
- if (element.getIdAttribute() == fontName)
- return &element;
- }
- return nullptr;
-}
-
-SVGFontFaceElement* CachedSVGFont::firstFontFace(const AtomicString& 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<SVGFontFaceElement>(*m_externalSVGFontElement).first())
- return firstFontFace;
- return nullptr;
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFonth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/loader/cache/CachedSVGFont.h (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.h        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.h        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * 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 "CachedFont.h"
-
-namespace WebCore {
-
-class SVGFontFaceElement;
-
-class CachedSVGFont final : public CachedFont {
-public:
- CachedSVGFont(const ResourceRequest&, SessionID);
-
- virtual bool ensureCustomFontData(bool externalSVG) override;
-
- virtual PassRefPtr<SimpleFontData> getFontData(const FontDescription&, const AtomicString& 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&) const;
-
- SVGFontFaceElement* firstFontFace(const AtomicString& remoteURI);
-
- RefPtr<SVGDocument> m_externalSVGDocument;
- SVGFontElement* m_externalSVGFontElement;
-};
-
-}
-
-SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedSVGFont, CachedResource::SVGFontResource)
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -824,9 +824,6 @@
</span><span class="cx"> stats.xslStyleSheets.addResource(resource);
</span><span class="cx"> break;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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 (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -88,12 +88,6 @@
</span><span class="cx"> return SVGElement::insertedInto(rootParent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isSVGFontTarget(const SVGFontFaceUriElement& element)
-{
- Ref<CSSFontFaceSrcValue> srcValue(element.srcValue());
- return srcValue->isSVGFontTarget();
-}
-
</del><span class="cx"> void SVGFontFaceUriElement::loadFont()
</span><span class="cx"> {
</span><span class="cx"> if (m_cachedFont)
</span><span class="lines">@@ -104,7 +98,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->requestFont(request, isSVGFontTarget(*this));
</del><ins>+ m_cachedFont = cachedResourceLoader->requestFont(request);
</ins><span class="cx"> if (m_cachedFont) {
</span><span class="cx"> m_cachedFont->addClient(this);
</span><span class="cx"> m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-11-18 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r176264.
+ https://bugs.webkit.org/show_bug.cgi?id=138837
+
+ caused many test failures (Requested by litherum on #webkit).
+
+ Reverted changeset:
+
+ "Subclass CachedFont for SVG fonts"
+ https://bugs.webkit.org/show_bug.cgi?id=138686
+ http://trac.webkit.org/changeset/176264
+
</ins><span class="cx"> 2014-11-18 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp (176266 => 176267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-18 18:14:45 UTC (rev 176266)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp        2014-11-18 18:52:38 UTC (rev 176267)
</span><span class="lines">@@ -92,9 +92,6 @@
</span><span class="cx"> switch (resource->type()) {
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><span class="cx"> case CachedResource::Script:
</span><del>-#if ENABLE(SVG_FONTS)
- case CachedResource::SVGFontResource:
-#endif
</del><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>