Source/WebCore/ChangeLog

 12016-01-26 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 Modularize CSSFontFaceSource
 4 https://bugs.webkit.org/show_bug.cgi?id=153414
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 CSSFontFaceSource has a few supported use cases:
 9 - Downloading remote fonts
 10 - Downloading remote SVG fonts and converting them
 11 - Downloading remote SVG fonts without converting them (Only for ports which haven't enabled the SVG -> OTF converter)
 12 - Local fonts
 13 - In-document SVG fonts and converting them
 14 - In-document SVG fonts without converting them (Only for ports which haven't enabled the SVG -> OTF converter)
 15
 16 In addition, the CSS Font Loading spec adds another use case:
 17 - A font where the backing bytes are provided by JavaScript (in an ArrayBuffer). I call this "immediate data."
 18
 19 All of these use cases have their own needs and requirements:
 20 - Downloading fonts requires a URL and associated loading infrastructure
 21 - Converting fonts requires the SVG -> OTF Converter
 22 - Local fonts require a family name string to look up
 23 - Immediate fonts require an array buffer to hold the bytes
 24 - In-document fonts require a reference to an SVGFontElement
 25
 26 Previously, CSSFontFaceSource supported all of these use cases. Given that each use case has its own data requirements,
 27 along with the fact that these requirements are known at object creation time, this is a great opportunity for subclassing.
 28
 29 There is an added benefit that, because there is a single base class for FontFaceSource, it has a uniform API, and changes
 30 to the object can be deliberately and specifically tracked as explicit state changes. This makes the mapping to the CSS Font
 31 Loading spec's "status" object much easier to understand.
 32
 33 This patch migrates all these use cases to the following heirarchy of classes:
 34 - FontFaceSource
 35 - LocalFontFaceSource
 36 - InDocumentSVGFontFaceSource (when the SVG converter is not enabled; otherwise, this class does not exist)
 37 - ByteBasedFontFaceSource
 38 - ImmediateFontFaceSource
 39 - InDocumentSVGFontFaceSource (when the SVG converter is enabled; otherwise, this class does not exist)
 40 - RemoteFontFaceSource
 41 - DeprecatedRemoteSVGFontFaceSource (Only used when the SVG converter is not enabled; otherwise,
 42 ByteBasedFontFaceSource handles this case)
 43
 44 FontFaceSource is the base class, and is modelled as a state machine. The state diagram looks like this:
 45 => Succeeded
 46 //
 47 Pending => Loading
 48 \\
 49 => Failed
 50
 51 Note that in this model, there is no distinction between a download failure, encoding failure, conversion failure, or any
 52 other kind of failure. This is a feature.
 53
 54 FontFaceSource exposes two API functions:
 55 - load() can be called when in the Pending state, and will take you to any of the downstream states.
 56 - font() can be called when in the Succeeded state only. This function will try to create a Font object, but it may
 57 still fail (even though we're in the Succeeded state). This means that, even if you're in the Succeeded state, you
 58 aren't guaranteed to be able to create a Font.
 59
 60 FontFaceSources are owned by a FontFace, and FontFaceSources maintain a raw pointer to their owner. Fonts internally handle
 61 the transition from the Loading to Succeeded / Failed state (possibly asynchronously, in the case of RemoteFontFaceSource).
 62 If any state transition occurred asynchronously, the owning FontFace has a kick() method which simply notifies it that something
 63 happened. It is then up to the FontFace to figure out what happened (since the FontFaceSource could be in eiter the Succeeded
 64 or Failed state).
 65
 66 A possible future implementation of font downloading timeouts fits this model well, by adding a new state between Loading and
 67 Succeeded / Failed.
 68
 69 FontFaceSource (the base class) also handles caching the result of the font() function. This is elegant because the result of
 70 this function should be cached for all the subclasses.
 71
 72 No new tests because there is no behavior change.
 73
 74 * CMakeLists.txt: Add all the new files.
 75 * WebCore.vcxproj/WebCore.vcxproj: Ditto.
 76 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
 77 * WebCore.xcodeproj/project.pbxproj: Ditto.
 78 * css/ByteBasedFontFaceSource.cpp: Added. This class handles the following things:
 79 a) Calling the SVG -> OTF font converter on bytes that we have received
 80 b) Transcodint WOFF fonts to TTF/OTF (on ports which require this)
 81 b) Interacting with FontCustomPlatformData in order to create the real underlying platform font object which represents
 82 the downloaded bytes
 83 (WebCore::ByteBasedFontFaceSource::ByteBasedFontFaceSource):
 84 (WebCore::ByteBasedFontFaceSource::getSVGFontById): Used for performing SVG -> OTF font conversion
 85 (WebCore::ByteBasedFontFaceSource::bufferProvided): Subclasses call this function when they have their buffer of bytes. This
 86 function performs as much processing as possible on that buffer (now, as opposed to later, so we can enter the failure state
 87 early).
 88 (WebCore::ByteBasedFontFaceSource::createFont): Use the FontCustomPlatformData.
 89 * css/ByteBasedFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 90 * css/CSSAllInOne.cpp: Add all the new files.
 91 * css/CSSFontFace.cpp: Update to use the new API of FontFaceSource.
 92 (WebCore::CSSFontFace::allSourcesHaveFailed):
 93 (WebCore::CSSFontFace::addSource):
 94 (WebCore::CSSFontFace::kick):
 95 (WebCore::CSSFontFace::font): Pump the state machines of the underlying FontFaceSources.
 96 (WebCore::CSSFontFace::isValid): Deleted.
 97 (WebCore::CSSFontFace::fontLoaded): Deleted.
 98 (WebCore::CSSFontFace::notifyFontLoader): Deleted.
 99 (WebCore::CSSFontFace::notifyLoadingDone): Deleted.
 100 (WebCore::CSSFontFace::hasSVGFontFaceSource): Deleted.
 101 * css/CSSFontFace.h: Update to use the new API of FontFaceSource.
 102 (WebCore::CSSFontFace::create):
 103 (WebCore::CSSFontFace::CSSFontFace):
 104 (WebCore::CSSFontFace::loadState): Deleted.
 105 * css/CSSFontFaceSource.cpp: Removed. Out with the old, in with the new
 106 * css/CSSFontFaceSource.h: Removed.
 107 * css/CSSFontSelector.cpp: Update to create the new FontFaceSource objects.
 108 (WebCore::createFontFace):
 109 (WebCore::registerLocalFontFacesForFamily):
 110 (WebCore::CSSFontSelector::addFontFaceRule):
 111 * css/CSSSegmentedFontFace.cpp:
 112 (WebCore::CSSSegmentedFontFace::fontRanges): Update to new API.
 113 * css/DeprecatedInDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Used on platforms
 114 which don't use the SVG -> OTF font converter.
 115 (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
 116 (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
 117 (WebCore::InDocumentSVGFontFaceSource::createFont):
 118 * css/DeprecatedInDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Used on platforms
 119 which don't use the SVG -> OTF font converter.
 120 * css/DeprecatedRemoteSVGFontFaceSource.cpp: Added.
 121 (WebCore::DeprecatedRemoteSVGFontFaceSource::DeprecatedRemoteSVGFontFaceSource):
 122 (WebCore::DeprecatedRemoteSVGFontFaceSource::bufferProvided):
 123 (WebCore::DeprecatedRemoteSVGFontFaceSource::createFont):
 124 * css/DeprecatedRemoteSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 125 * css/FontFaceSource.cpp: Added. Base class, explained above. Handles caching.
 126 (WebCore::FontFaceSource::HashKey::HashKey):
 127 (WebCore::FontFaceSource::HashKey::isHashTableDeletedValue):
 128 (WebCore::FontFaceSource::HashKey::operator==):
 129 (WebCore::FontFaceSource::HashKey::operator!=):
 130 (WebCore::FontFaceSource::HashKey::hash):
 131 (WebCore::FontFaceSource::HashKey::equal):
 132 (WebCore::FontFaceSource::FontFaceSource):
 133 (WebCore::FontFaceSource::load):
 134 (WebCore::FontFaceSource::font):
 135 * css/FontFaceSource.h: Added.
 136 (WebCore::FontFaceSource::~FontFaceSource):
 137 (WebCore::FontFaceSource::state):
 138 (WebCore::FontFaceSource::owner):
 139 (WebCore::FontFaceSource::setState):
 140 (WebCore::FontFaceSource::shouldCache):
 141 * css/FontLoader.cpp:
 142 * css/ImmediateFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Supporting the new use case in the
 143 CSS FontLoading spec.
 144 * css/InDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 145 (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
 146 (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
 147 * css/InDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 148 * css/LocalFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Represents local(Helvetica) or something
 149 like that.
 150 (WebCore::LocalFontFaceSource::LocalFontFaceSource):
 151 (WebCore::LocalFontFaceSource::initiateLoad):
 152 (WebCore::LocalFontFaceSource::createFont):
 153 * css/LocalFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 154 * css/RemoteFontFaceSource.cpp: Added. Uses the existing CachedResourceLoader infrastructure, but simply puts the new FontFaceSource
 155 API on top of it. Kicks the owner if something asynchronous happened.
 156 (WebCore::RemoteFontFaceSource::RemoteFontFaceSource):
 157 (WebCore::RemoteFontFaceSource::~RemoteFontFaceSource):
 158 (WebCore::RemoteFontFaceSource::initiateLoad):
 159 (WebCore::RemoteFontFaceSource::fontLoaded):
 160 * css/RemoteFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 161 * loader/cache/CachedFont.cpp: Update to new API.
 162 (WebCore::CachedFont::didAddClient):
 163 (WebCore::CachedFont::checkNotify):
 164 * loader/cache/CachedFont.h: Ditto.
 165 (WebCore::CachedFont::setHasCreatedFontDataWrappingResource):
 166 * loader/cache/CachedFontClient.h: Ditto.
 167 (WebCore::CachedFontClient::fontLoaded):
 168 * platform/graphics/FontCache.h: Cleanup.
 169 (WebCore::FontDescriptionKey::makeFlagsKey):
 170 * platform/graphics/mac/FontCustomPlatformData.cpp: Helpful comment.
 171 (WebCore::FontCustomPlatformData::fontPlatformData):
 172 * platform/text/TextFlags.h: Cleanup.
 173 (WebCore::FontVariantSettings::operator==):
 174 (WebCore::FontVariantSettings::uniqueValue):
 175 (WebCore::FontVariantSettings::hash):
 176 * svg/SVGFontData.h: Updating comment.
 177
11782016-01-26 Dean Jackson <dino@apple.com>
2179
3180 [iOS] Documents without an explicit width should not get fast tapping

Source/WebCore/CMakeLists.txt

@@set(WebCore_SOURCES
12861286 contentextensions/URLFilterParser.cpp
12871287
12881288 css/BasicShapeFunctions.cpp
 1289 css/ByteBasedFontFaceSource.cpp
12891290 css/CSSAspectRatioValue.cpp
12901291 css/CSSBasicShapes.cpp
12911292 css/CSSBorderImage.cpp

@@set(WebCore_SOURCES
13021303 css/CSSFontFace.cpp
13031304 css/CSSFontFaceLoadEvent.cpp
13041305 css/CSSFontFaceRule.cpp
1305  css/CSSFontFaceSource.cpp
13061306 css/CSSFontFaceSrcValue.cpp
13071307 css/CSSFontFeatureValue.cpp
13081308 css/CSSFontSelector.cpp

@@set(WebCore_SOURCES
13511351 css/CSSValuePool.cpp
13521352 css/CSSVariableDependentValue.cpp
13531353 css/CSSVariableValue.cpp
 1354 css/DeprecatedInDocumentSVGFontFaceSource.cpp
 1355 css/DeprecatedRemoteSVGFontFaceSource.cpp
13541356 css/DOMWindowCSS.cpp
13551357 css/DocumentRuleSets.cpp
13561358 css/ElementRuleCollector.cpp
 1359 css/FontFaceSource.cpp
13571360 css/FontLoader.cpp
 1361 css/InDocumentSVGFontFaceSource.cpp
13581362 css/InspectorCSSOMWrappers.cpp
13591363 css/LengthFunctions.cpp
 1364 css/LocalFontFaceSource.cpp
13601365 css/MediaFeatureNames.cpp
13611366 css/MediaList.cpp
13621367 css/MediaQuery.cpp

@@set(WebCore_SOURCES
13671372 css/PageRuleCollector.cpp
13681373 css/PropertySetCSSStyleDeclaration.cpp
13691374 css/RGBColor.cpp
 1375 css/RemoteFontFaceSource.cpp
13701376 css/RuleFeature.cpp
13711377 css/RuleSet.cpp
13721378 css/SVGCSSComputedStyleDeclaration.cpp

@@set(WebCore_SOURCES
19651971 loader/cache/CachedResourceRequestInitiators.cpp
19661972 loader/cache/CachedSVGDocument.cpp
19671973 loader/cache/CachedSVGDocumentReference.cpp
1968  loader/cache/CachedSVGFont.cpp
19691974 loader/cache/CachedScript.cpp
19701975 loader/cache/CachedXSLStyleSheet.cpp
19711976 loader/cache/MemoryCache.cpp

@@set(WebCore_SOURCES
27672772 svg/SVGTextPathElement.cpp
27682773 svg/SVGTextPositioningElement.cpp
27692774 svg/SVGTitleElement.cpp
 2775 svg/SVGToOTFFontConversion.cpp
27702776 svg/SVGTransform.cpp
27712777 svg/SVGTransformDistance.cpp
27722778 svg/SVGTransformList.cpp

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

74897489 <ClCompile Include="..\loader\archive\mhtml\MHTMLParser.cpp" />
74907490 <ClCompile Include="..\loader\cache\CachedCSSStyleSheet.cpp" />
74917491 <ClCompile Include="..\loader\cache\CachedFont.cpp" />
7492  <ClCompile Include="..\loader\cache\CachedSVGFont.cpp" />
74937492 <ClCompile Include="..\loader\cache\CachedImage.cpp" />
74947493 <ClCompile Include="..\loader\cache\CachedRawResource.cpp" />
74957494 <ClCompile Include="..\loader\cache\CachedResource.cpp" />

82668265 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
82678266 </ClCompile>
82688267 <ClCompile Include="..\svg\graphics\SVGImageForContainer.cpp" />
8269  <ClCompile Include="..\svg\SVGToOTFFontConversion.cpp" />
82708268 <ClCompile Include="..\WebCorePrefix.cpp">
82718269 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
82728270 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>

96239621 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
96249622 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
96259623 </ClCompile>
9626  <ClCompile Include="..\css\CSSFontFaceSource.cpp">
 9624 <ClCompile Include="..\css\FontFaceSource.cpp">
 9625 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9626 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9627 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9628 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9629 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9630 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9631 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9632 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9633 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9634 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9635 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9636 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9637 </ClCompile>
 9638 <ClCompile Include="..\css\LocalFontFaceSource.cpp">
 9639 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9640 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9641 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9642 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9643 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9644 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9645 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9646 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9647 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9648 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9649 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9650 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9651 </ClCompile>
 9652 <ClCompile Include="..\css\ByteBasedFontFaceSource.cpp">
 9653 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9654 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9655 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9656 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9657 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9658 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9659 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9660 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9661 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9662 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9663 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9664 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9665 </ClCompile>
 9666 <ClCompile Include="..\css\RemoteFontFaceSource.cpp">
 9667 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9668 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9669 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9670 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9671 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9672 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9673 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9674 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9675 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9676 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9677 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9678 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9679 </ClCompile>
 9680 <ClCompile Include="..\css\InDocumentSVGFontFaceSource.cpp">
 9681 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9682 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9683 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9684 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9685 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9686 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9687 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9688 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9689 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9690 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9691 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9692 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9693 </ClCompile>
 9694 <ClCompile Include="..\css\DeprecatedInDocumentSVGFontFaceSource.cpp">
 9695 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9696 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9697 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9698 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9699 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9700 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9701 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9702 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9703 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9704 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9705 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9706 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9707 </ClCompile>
 9708 <ClCompile Include="..\css\DeprecatedRemoteSVGFontFaceSource.cpp">
96279709 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
96289710 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
96299711 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>

1910319185 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1910419186 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1910519187 </ClCompile>
 19188 <ClCompile Include="..\svg\SVGToOTFFontConversion.cpp">
 19189 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 19190 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 19191 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 19192 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 19193 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 19194 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 19195 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 19196 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 19197 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 19198 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 19199 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 19200 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 19201 </ClCompile>
1910619202 <ClCompile Include="..\svg\SVGGlyphElement.cpp">
1910719203 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
1910819204 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

2082920925 <ClInclude Include="..\loader\archive\mhtml\MHTMLParser.h" />
2083020926 <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h" />
2083120927 <ClInclude Include="..\loader\cache\CachedFont.h" />
20832  <ClInclude Include="..\loader\cache\CachedSVGFont.h" />
2083320928 <ClInclude Include="..\loader\cache\CachedImage.h" />
2083420929 <ClInclude Include="..\loader\cache\CachedRawResource.h" />
2083520930 <ClInclude Include="..\loader\cache\CachedRawResourceClient.h" />

2161421709 <ClInclude Include="..\css\CSSFontFace.h" />
2161521710 <ClInclude Include="..\css\CSSFontFaceLoadEvent.h" />
2161621711 <ClInclude Include="..\css\CSSFontFaceRule.h" />
21617  <ClInclude Include="..\css\CSSFontFaceSource.h" />
 21712 <ClInclude Include="..\css\FontFaceSource.h" />
 21713 <ClInclude Include="..\css\LocalFontFaceSource.h" />
 21714 <ClInclude Include="..\css\ByteBasedFontFaceSource.h" />
 21715 <ClInclude Include="..\css\RemoteFontFaceSource.h" />
 21716 <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h" />
 21717 <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h" />
 21718 <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h" />
 21719 <ClInclude Include="..\css\ImmediateFontFaceSource.h" />
2161821720 <ClInclude Include="..\css\CSSFontFaceSrcValue.h" />
2161921721 <ClInclude Include="..\css\CSSFontFeatureValue.h" />
2162021722 <ClInclude Include="..\css\CSSFontSelector.h" />

2260422706 <ClInclude Include="..\svg\SVGForeignObjectElement.h" />
2260522707 <ClInclude Include="..\svg\SVGGElement.h" />
2260622708 <ClInclude Include="..\svg\SVGGlyphElement.h" />
 22709 <ClInclude Include="..\svg\SVGToOTFFontConversion.h" />
2260722710 <ClInclude Include="..\svg\SVGGlyphMap.h" />
2260822711 <ClInclude Include="..\svg\SVGGlyphRefElement.h" />
2260922712 <ClInclude Include="..\svg\SVGGradientElement.h" />

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

10011001 <ClCompile Include="..\loader\cache\CachedCSSStyleSheet.cpp">
10021002 <Filter>loader\cache</Filter>
10031003 </ClCompile>
1004  <ClCompile Include="..\loader\cache\CachedSVGFont.cpp">
1005  <Filter>loader\cache</Filter>
1006  </ClCompile>
10071004 <ClCompile Include="..\loader\cache\CachedFont.cpp">
10081005 <Filter>loader\cache</Filter>
10091006 </ClCompile>

20872084 <ClCompile Include="..\css\CSSFontFaceRule.cpp">
20882085 <Filter>css</Filter>
20892086 </ClCompile>
2090  <ClCompile Include="..\css\CSSFontFaceSource.cpp">
 2087 <ClCompile Include="..\css\FontFaceSource.cpp">
 2088 <Filter>css</Filter>
 2089 </ClCompile>
 2090 <ClCompile Include="..\css\LocalFontFaceSource.cpp">
 2091 <Filter>css</Filter>
 2092 </ClCompile>
 2093 <ClCompile Include="..\css\ByteBasedFontFaceSource.cpp">
 2094 <Filter>css</Filter>
 2095 </ClCompile>
 2096 <ClCompile Include="..\css\RemoteFontFaceSource.cpp">
 2097 <Filter>css</Filter>
 2098 </ClCompile>
 2099 <ClCompile Include="..\css\InDocumentSVGFontFaceSource.cpp">
 2100 <Filter>css</Filter>
 2101 </ClCompile>
 2102 <ClCompile Include="..\css\DeprecatedInDocumentSVGFontFaceSource.cpp">
 2103 <Filter>css</Filter>
 2104 </ClCompile>
 2105 <ClCompile Include="..\css\DeprecatedRemoteSVGFontFaceSource.cpp">
20912106 <Filter>css</Filter>
20922107 </ClCompile>
20932108 <ClCompile Include="..\css\CSSFontFaceSrcValue.cpp">

80238038 <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h">
80248039 <Filter>loader\cache</Filter>
80258040 </ClInclude>
8026  <ClInclude Include="..\loader\cache\CachedSVGFont.h">
8027  <Filter>loader\cache</Filter>
8028  </ClInclude>
80298041 <ClInclude Include="..\loader\cache\CachedFont.h">
80308042 <Filter>loader\cache</Filter>
80318043 </ClInclude>

90499061 <ClInclude Include="..\css\CSSFontFaceRule.h">
90509062 <Filter>css</Filter>
90519063 </ClInclude>
9052  <ClInclude Include="..\css\CSSFontFaceSource.h">
 9064 <ClInclude Include="..\css\FontFaceSource.h">
 9065 <Filter>css</Filter>
 9066 </ClInclude>
 9067 <ClInclude Include="..\css\LocalFontFaceSource.h">
 9068 <Filter>css</Filter>
 9069 </ClInclude>
 9070 <ClInclude Include="..\css\ByteBasedFontFaceSource.h">
 9071 <Filter>css</Filter>
 9072 </ClInclude>
 9073 <ClInclude Include="..\css\RemoteFontFaceSource.h">
 9074 <Filter>css</Filter>
 9075 </ClInclude>
 9076 <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h">
 9077 <Filter>css</Filter>
 9078 </ClInclude>
 9079 <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h">
 9080 <Filter>css</Filter>
 9081 </ClInclude>
 9082 <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h">
 9083 <Filter>css</Filter>
 9084 </ClInclude>
 9085 <ClInclude Include="..\css\ImmediateFontFaceSource.h">
90539086 <Filter>css</Filter>
90549087 </ClInclude>
90559088 <ClInclude Include="..\css\CSSFontFaceSrcValue.h">

1479314826 <ClInclude Include="..\svg\SVGFETurbulenceElement.h">
1479414827 <Filter>svg</Filter>
1479514828 </ClInclude>
 14829 <ClInclude Include="..\svg\SVGToOTFFontConversion.h">
 14830 <Filter>svg</Filter>
 14831 </ClInclude>
1479614832 <ClInclude Include="..\svg\SVGGlyphElement.h">
1479714833 <Filter>svg</Filter>
1479814834 </ClInclude>

Source/WebCore/WebCore.xcodeproj/project.pbxproj

923923 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
924924 1C010700192594DF008A4201 /* InlineTextBoxStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */; };
925925 1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */; };
926  1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
927  1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0939E91A13E12900B788E5 /* CachedSVGFont.h */; };
928926 1C11CCB60AA6093700DADB20 /* DOMComment.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85089CD10A98C42700A275AA /* DOMComment.h */; };
929927 1C11CCB70AA6093700DADB20 /* DOMNamedNodeMap.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8518DD760A9CF31B0091B7A6 /* DOMNamedNodeMap.h */; };
930928 1C11CCB80AA6093700DADB20 /* DOMHTMLOptionsCollection.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85DF2F990AA3CAE500AD64C5 /* DOMHTMLOptionsCollection.h */; };

55605558 BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CA0CB4295D005F2B62 /* CachedFont.h */; };
55615559 BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */; };
55625560 BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */; };
5563  BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */; };
5564  BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */; };
55655561 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */; };
55665562 BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */; };
55675563 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */; };

58745870 C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
58755871 C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
58765872 C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */; };
 5873 C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */; };
 5874 C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */; };
 5875 C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */; };
 5876 C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */; };
 5877 C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */; };
 5878 C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */; };
 5879 C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */; };
 5880 C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */; };
 5881 C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */; };
 5882 C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */; };
 5883 C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */; };
 5884 C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */; };
 5885 C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */; };
 5886 C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */; };
 5887 C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */; };
58775888 C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
58785889 C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
58795890 C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };

82998310 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
83008311 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = "<group>"; };
83018312 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = "<group>"; };
8302  1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
8303  1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = "<group>"; };
83048313 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = "<group>"; };
83058314 1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
83068315 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IOSurfacePool.cpp; sourceTree = "<group>"; };

1337013379 BC64B4CA0CB4295D005F2B62 /* CachedFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFont.h; sourceTree = "<group>"; };
1337113380 BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFace.cpp; sourceTree = "<group>"; };
1337213381 BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFace.h; sourceTree = "<group>"; };
13373  BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSource.cpp; sourceTree = "<group>"; };
13374  BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSource.h; sourceTree = "<group>"; };
1337513382 BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSrcValue.cpp; sourceTree = "<group>"; };
1337613383 BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSrcValue.h; sourceTree = "<group>"; };
1337713384 BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontSelector.cpp; sourceTree = "<group>"; };

1371913726 C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
1372013727 C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontVariantBuilder.h; sourceTree = "<group>"; };
1372113728 C24685131A148E1800811792 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
 13729 C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedInDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13730 C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedInDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
 13731 C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedRemoteSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13732 C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedRemoteSVGFontFaceSource.h; sourceTree = "<group>"; };
1372213733 C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
 13734 C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFaceSource.cpp; sourceTree = "<group>"; };
 13735 C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFaceSource.h; sourceTree = "<group>"; };
 13736 C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalFontFaceSource.cpp; sourceTree = "<group>"; };
 13737 C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalFontFaceSource.h; sourceTree = "<group>"; };
 13738 C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteBasedFontFaceSource.cpp; sourceTree = "<group>"; };
 13739 C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteBasedFontFaceSource.h; sourceTree = "<group>"; };
 13740 C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteFontFaceSource.cpp; sourceTree = "<group>"; };
 13741 C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteFontFaceSource.h; sourceTree = "<group>"; };
 13742 C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmediateFontFaceSource.h; sourceTree = "<group>"; };
 13743 C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13744 C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
1372313745 C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
1372413746 C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
1372513747 C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };

2082820850 1AEF4E68170E174800AB2799 /* CachedSVGDocumentClient.h */,
2082920851 E1B533461717D0A000F205F9 /* CachedSVGDocumentReference.cpp */,
2083020852 FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */,
20831  1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */,
20832  1C0939E91A13E12900B788E5 /* CachedSVGFont.h */,
2083320853 0753860014489E9800B78452 /* CachedTextTrack.cpp */,
2083420854 0753860114489E9800B78452 /* CachedTextTrack.h */,
2083520855 BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */,

2330723327 A80E6CBD0A1989CA007FB8C5 /* CSSFontFaceRule.cpp */,
2330823328 A80E6CD30A1989CA007FB8C5 /* CSSFontFaceRule.h */,
2330923329 85C56CA30AA89CA400D95755 /* CSSFontFaceRule.idl */,
23310  BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */,
23311  BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */,
2331223330 BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */,
2331323331 BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */,
2331423332 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */,

2355023568 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
2355123569 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
2355223570 3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
 23571 C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */,
 23572 C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */,
 23573 C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */,
 23574 C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */,
 23575 C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */,
 23576 C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */,
 23577 C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */,
 23578 C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */,
 23579 C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */,
 23580 C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */,
 23581 C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */,
 23582 C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */,
 23583 C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */,
 23584 C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */,
 23585 C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */,
2355323586 );
2355423587 path = css;
2355523588 sourceTree = "<group>";

2485724890 A104F24414C71F7A009E2C23 /* CachedSVGDocument.h in Headers */,
2485824891 1AEF4E69170E174800AB2799 /* CachedSVGDocumentClient.h in Headers */,
2485924892 FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */,
24860  1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */,
2486124893 0753860314489E9800B78452 /* CachedTextTrack.h in Headers */,
2486224894 BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
2486324895 93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,

2492124953 C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
2492224954 F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
2492324955 EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
 24956 C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */,
2492424957 9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
2492524958 BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
2492624959 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,

2504625079 BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */,
2504725080 409EBDB116B7EE7100CBA3FC /* CSSFontFaceLoadEvent.h in Headers */,
2504825081 A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */,
25049  BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */,
2505025082 BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */,
2505125083 83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
2505225084 4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */,

2556525597 858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
2556625598 85E9E0A10AB3A0C700069CD0 /* DOMXPathExpression.h in Headers */,
2556725599 85E711DA0AC5D5350053270F /* DOMXPathExpressionInternal.h in Headers */,
 25600 C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */,
2556825601 85E9E0A40AB3A0C700069CD0 /* DOMXPathNSResolver.h in Headers */,
2556925602 85E9E0A50AB3A0C700069CD0 /* DOMXPathResult.h in Headers */,
2557025603 85E711DB0AC5D5350053270F /* DOMXPathResultInternal.h in Headers */,

2576225795 0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */,
2576325796 46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */,
2576425797 9746AF2A14F4DDE6003E7A70 /* Geoposition.h in Headers */,
 25798 C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */,
2576525799 086BBD0F136039C2008B15D8 /* Glyph.h in Headers */,
2576625800 B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
2576725801 C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,

2640926443 8A9A588811E84F37008ACFD1 /* JSPerformanceTiming.h in Headers */,
2641026444 FDEA6247152102FC00479DF0 /* JSPeriodicWave.h in Headers */,
2641126445 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */,
 26446 C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */,
2641226447 5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */,
2641326448 598365DD1355F557001B185D /* JSPositionCallback.h in Headers */,
2641426449 FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */,

2656426599 B2FA3DBB0AB75A6F000E5AC4 /* JSSVGPathSegArcRel.h in Headers */,
2656526600 B2FA3DBD0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.h in Headers */,
2656626601 B2FA3DBF0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.h in Headers */,
 26602 C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */,
2656726603 B2FA3DC10AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.h in Headers */,
2656826604 B2FA3DC30AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
2656926605 B2FA3DC50AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.h in Headers */,

2734627382 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
2734727383 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
2734827384 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
 27385 C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */,
2734927386 26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */,
2735027387 514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
2735127388 514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,

2753227569 E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */,
2753327570 582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */,
2753427571 C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
 27572 C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */,
2753527573 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */,
2753627574 FD00D7A514A3F61900734011 /* SincResampler.h in Headers */,
2753727575 51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */,

2814228180 E180810F16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.h in Headers */,
2814328181 E152551516FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.h in Headers */,
2814428182 93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
 28183 C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */,
2814528184 A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */,
2814628185 A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */,
2814728186 A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */,

2871228751 29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
2871328752 BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
2871428753 BCA8CA5F11E4E6D100812FB7 /* BackForwardList.cpp in Sources */,
 28754 C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */,
2871528755 BC124EE70C2641CD009E2349 /* BarProp.cpp in Sources */,
2871628756 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
2871728757 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,

2875028790 1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */,
2875128791 1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
2875228792 1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
 28793 C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */,
2875328794 1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
2875428795 BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
2875528796 BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,

2876528806 BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
2876628807 A104F24314C71F7A009E2C23 /* CachedSVGDocument.cpp in Sources */,
2876728808 E1B533471717D0A100F205F9 /* CachedSVGDocumentReference.cpp in Sources */,
28768  1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
2876928809 0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */,
2877028810 BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
2877128811 E43AF8E61AC5B7E800CA717E /* CacheValidation.cpp in Sources */,

2892428964 BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
2892528965 409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
2892628966 A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
28927  BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */,
2892828967 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
2892928968 4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
2893028969 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,

2924029279 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
2924129280 3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
2924229281 8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
 29282 C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */,
2924329283 31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
2924429284 85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
2924529285 1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,

2939429434 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */,
2939529435 A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
2939629436 7EE6846612D26E3800E79415 /* FormDataStreamCFNet.cpp in Sources */,
 29437 C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */,
2939729438 514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
2939829439 656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
2939929440 41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,

3017130212 1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
3017230213 B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
3017330214 51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
 30215 C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */,
3017430216 51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
3017530217 51E0BAEA0DA55D4A00A9E417 /* JSStorageEvent.cpp in Sources */,
3017630218 0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,

3061430656 F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
3061530657 85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
3061630658 93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
 30659 C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */,
3061730660 85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
3061830661 93309DFB099E64920056E581 /* MoveSelectionCommand.cpp in Sources */,
3061930662 FDB1700514A2BAB200A2B5D9 /* MultiChannelResampler.cpp in Sources */,

3153831581 46DB7D571B20FE46005651B2 /* VNodeTrackerCocoa.cpp in Sources */,
3153931582 BE20507918A458680080647E /* VTTCue.cpp in Sources */,
3154031583 7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
 31584 C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */,
3154131585 7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
3154231586 7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */,
3154331587 A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,

Source/WebCore/css/ByteBasedFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "ByteBasedFontFaceSource.h"
 28
 29#include "SVGDocument.h"
 30#include "SVGFontElement.h"
 31#include "SVGFontFaceElement.h"
 32#include "SVGToOTFFontConversion.h"
 33#include "SharedBuffer.h"
 34#include "TypedElementDescendantIterator.h"
 35#include "WOFFFileFormat.h"
 36
 37#include <runtime/ArrayBuffer.h>
 38
 39namespace WebCore {
 40
 41ByteBasedFontFaceSource::ByteBasedFontFaceSource(CSSFontFace& owner, const AtomicString& remoteURI, bool performConversion)
 42 : FontFaceSource(owner)
 43 , m_remoteURI(remoteURI)
 44 , m_performConversion(performConversion)
 45{
 46}
 47
 48auto ByteBasedFontFaceSource::convertWOFF(SharedBuffer& buffer, Vector<char>& result) -> ConversionStatus
 49{
 50#if PLATFORM(COCOA)
 51 UNUSED_PARAM(buffer);
 52 UNUSED_PARAM(result);
 53 return ConversionStatus::Unnecessary;
 54#else
 55 if (!isWOFF(&buffer))
 56 return ConversionStatus::Unnecessary;
 57 return convertWOFFToSfnt(&buffer, result) ? ConversionStatus::Success : ConversionStatus::Failure;
 58#endif
 59}
 60
 61SVGFontElement* ByteBasedFontFaceSource::getSVGFontById(SVGDocument& externalSVGDocument)
 62{
 63 String fragmentIdentifier;
 64 size_t start = m_remoteURI.find('#');
 65 if (start != notFound)
 66 fragmentIdentifier = m_remoteURI.string().substring(start + 1);
 67
 68 auto elements = descendantsOfType<SVGFontElement>(externalSVGDocument);
 69
 70 if (fragmentIdentifier.isEmpty())
 71 return elements.first();
 72
 73 for (auto& element : elements) {
 74 if (element.getIdAttribute() == fragmentIdentifier)
 75 return &element;
 76 }
 77 return nullptr;
 78}
 79
 80auto ByteBasedFontFaceSource::convertSVGFont(SharedBuffer& buffer, Vector<char>& result) -> ConversionStatus
 81{
 82 RefPtr<SVGDocument> externalSVGDocument = SVGDocument::create(nullptr, URL());
 83 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
 84 externalSVGDocument->setContent(decoder->decodeAndFlush(buffer.data(), buffer.size()));
 85 if (decoder->sawError())
 86 return ConversionStatus::Unnecessary;
 87 if (SVGFontElement* externalSVGFontElement = getSVGFontById(*externalSVGDocument)) {
 88 if (!childrenOfType<SVGFontFaceElement>(*externalSVGFontElement).first())
 89 return ConversionStatus::Failure;
 90 if (const auto& convertedFont = convertSVGToOTFFont(*externalSVGFontElement)) {
 91 result = convertedFont.value();
 92 return ConversionStatus::Success;
 93 }
 94 return ConversionStatus::Unnecessary;
 95 }
 96
 97 return ConversionStatus::Unnecessary;
 98}
 99
 100void ByteBasedFontFaceSource::bufferProvided(JSC::ArrayBuffer& arrayBuffer)
 101{
 102 RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<const char*>(arrayBuffer.data()), arrayBuffer.byteLength());
 103 if (!buffer) {
 104 setState(State::Failed);
 105 return;
 106 }
 107
 108 bufferProvided(*buffer);
 109}
 110
 111bool ByteBasedFontFaceSource::bufferProvided(SharedBuffer& buffer)
 112{
 113 ASSERT(state() == State::Loading);
 114 bool wrapping = true;
 115 RefPtr<SharedBuffer> active = &buffer;
 116
 117 if (m_performConversion) {
 118 // Step 1: Try to convert WOFF to SFNT.
 119 Vector<char> receiver;
 120 switch (convertWOFF(buffer, receiver)) {
 121 case ConversionStatus::Unnecessary:
 122 break;
 123 case ConversionStatus::Success:
 124 wrapping = false;
 125 active = SharedBuffer::adoptVector(receiver);
 126 break;
 127 case ConversionStatus::Failure:
 128 setState(State::Failed);
 129 return false;
 130 }
 131
 132 // Step 2: Try to convert SVG to OTF.
 133 switch (convertSVGFont(*active, receiver)) {
 134 case ConversionStatus::Unnecessary:
 135 break;
 136 case ConversionStatus::Success:
 137 wrapping = false;
 138 active = SharedBuffer::adoptVector(receiver);
 139 break;
 140 case ConversionStatus::Failure:
 141 setState(State::Failed);
 142 return false;
 143 }
 144 }
 145
 146 m_fontCustomPlatformData = createFontCustomPlatformData(*active);
 147 if (!m_fontCustomPlatformData) {
 148 setState(State::Failed);
 149 return false;
 150 }
 151
 152 return wrapping;
 153}
 154
 155RefPtr<Font> ByteBasedFontFaceSource::createFontWithCustomPlatformData(FontCustomPlatformData& customPlatformData, const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
 156{
 157#if PLATFORM(COCOA)
 158 return Font::create(customPlatformData.fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
 159#else
 160 UNUSED_PARAM(fontFaceFeatures);
 161 UNUSED_PARAM(fontFaceVariantSettings);
 162 return Font::create(customPlatformData.fontPlatformData(fontDescription, syntheticBold, syntheticItalic), true, false);
 163#endif
 164}
 165
 166RefPtr<Font> ByteBasedFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
 167{
 168 ASSERT(m_fontCustomPlatformData);
 169 return createFontWithCustomPlatformData(*m_fontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
 170}
 171
 172}

Source/WebCore/css/ByteBasedFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef ByteBasedFontFaceSource_h
 27#define ByteBasedFontFaceSource_h
 28
 29#include "FontCustomPlatformData.h"
 30#include "FontFaceSource.h"
 31
 32namespace JSC {
 33class ArrayBuffer;
 34}
 35
 36namespace WebCore {
 37
 38class SharedBuffer;
 39class SVGDocument;
 40class SVGFontElement;
 41
 42class ByteBasedFontFaceSource : public FontFaceSource {
 43public:
 44 ByteBasedFontFaceSource(CSSFontFace& owner, const AtomicString& remoteURI = AtomicString(), bool performConversion = true);
 45
 46protected:
 47 virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&) override;
 48
 49 // Return value is whether or not I added a reference to the argument.
 50 virtual bool bufferProvided(SharedBuffer&);
 51 void bufferProvided(JSC::ArrayBuffer&);
 52
 53 std::unique_ptr<FontCustomPlatformData>& customPlatformData() { return m_fontCustomPlatformData; }
 54
 55 RefPtr<Font> createFontWithCustomPlatformData(FontCustomPlatformData&, const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&);
 56
 57 SVGFontElement* getSVGFontById(SVGDocument&);
 58
 59private:
 60 enum ConversionStatus {
 61 Unnecessary,
 62 Success,
 63 Failure
 64 };
 65
 66 ConversionStatus convertWOFF(SharedBuffer&, Vector<char>& result);
 67 ConversionStatus convertSVGFont(SharedBuffer&, Vector<char>& result);
 68
 69 std::unique_ptr<FontCustomPlatformData> m_fontCustomPlatformData;
 70 AtomicString m_remoteURI;
 71 bool m_performConversion;
 72};
 73
 74}
 75
 76#endif

Source/WebCore/css/CSSAllInOne.cpp

2626// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
2727
2828#include "BasicShapeFunctions.cpp"
 29#include "ByteBasedFontFaceSource.cpp"
2930#include "CSSAspectRatioValue.cpp"
3031#include "CSSBasicShapes.cpp"
3132#include "CSSBorderImage.cpp"

4243#include "CSSFontFace.cpp"
4344#include "CSSFontFaceLoadEvent.cpp"
4445#include "CSSFontFaceRule.cpp"
45 #include "CSSFontFaceSource.cpp"
4646#include "CSSFontFaceSrcValue.cpp"
4747#include "CSSFontFeatureValue.cpp"
4848#include "CSSFontSelector.cpp"

9191#include "CSSVariableDependentValue.cpp"
9292#include "CSSVariableValue.cpp"
9393#include "DOMWindowCSS.cpp"
 94#include "DeprecatedInDocumentSVGFontFaceSource.cpp"
 95#include "DeprecatedRemoteSVGFontFaceSource.cpp"
9496#include "DocumentRuleSets.cpp"
9597#include "ElementRuleCollector.cpp"
 98#include "FontFaceSource.cpp"
9699#include "FontLoader.cpp"
 100#include "InDocumentSVGFontFaceSource.cpp"
97101#include "InspectorCSSOMWrappers.cpp"
98102#include "LengthFunctions.cpp"
 103#include "LocalFontFaceSource.cpp"
99104#include "MediaList.cpp"
100105#include "MediaQuery.cpp"
101106#include "MediaQueryEvaluator.cpp"

105110#include "PageRuleCollector.cpp"
106111#include "PropertySetCSSStyleDeclaration.cpp"
107112#include "RGBColor.cpp"
 113#include "RemoteFontFaceSource.cpp"
108114#include "RuleFeature.cpp"
109115#include "RuleSet.cpp"
110116#include "SVGCSSComputedStyleDeclaration.cpp"

Source/WebCore/css/CSSFontFace.cpp

2626#include "config.h"
2727#include "CSSFontFace.h"
2828
29 #include "CSSFontFaceSource.h"
3029#include "CSSFontSelector.h"
3130#include "CSSSegmentedFontFace.h"
3231#include "Document.h"

3736
3837namespace WebCore {
3938
40 bool CSSFontFace::isValid() const
 39bool CSSFontFace::allSourcesHaveFailed() const
4140{
42  size_t size = m_sources.size();
43  for (size_t i = 0; i < size; i++) {
44  if (m_sources[i]->isValid())
45  return true;
 41 for (auto& source : m_sources) {
 42 if (source->state() != FontFaceSource::State::Failed)
 43 return false;
4644 }
47  return false;
 45 return true;
4846}
4947
5048void CSSFontFace::addedToSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)

@@void CSSFontFace::removedFromSegmentedFontFace(CSSSegmentedFontFace* segmentedFo
5755 m_segmentedFontFaces.remove(segmentedFontFace);
5856}
5957
60 void CSSFontFace::addSource(std::unique_ptr<CSSFontFaceSource> source)
 58void CSSFontFace::addSource(std::unique_ptr<FontFaceSource>&& source)
6159{
62  source->setFontFace(this);
6360 m_sources.append(WTFMove(source));
6461}
6562
66 void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
 63void CSSFontFace::kick(FontFaceSource&)
6764{
68  if (source != m_activeSource)
69  return;
70 
7165 // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may
7266 // require stopping in-progress font loading when the last
7367 // CSSSegmentedFontFace is removed.

@@void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
7973 CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
8074 fontSelector->fontLoaded();
8175
82 #if ENABLE(FONT_LOAD_EVENTS)
83  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading) {
84  if (source->ensureFontData())
85  notifyFontLoader(Loaded);
86  else if (!isValid())
87  notifyFontLoader(Error);
88  }
89 #endif
90 
9176 for (auto* face : m_segmentedFontFaces)
9277 face->fontLoaded(this);
93 
94 #if ENABLE(FONT_LOAD_EVENTS)
95  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
96  notifyLoadingDone();
97 #endif
9878}
9979
10080RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic)
10181{
102  m_activeSource = 0;
103  if (!isValid())
104  return 0;
105 
106  ASSERT(!m_segmentedFontFaces.isEmpty());
107  CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
108 
109 #if ENABLE(FONT_LOAD_EVENTS)
110  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == NotLoaded)
111  notifyFontLoader(Loading);
112 #endif
113 
114  size_t size = m_sources.size();
115  for (size_t i = 0; i < size; ++i) {
116  if (RefPtr<Font> result = m_sources[i]->font(fontDescription, syntheticBold, syntheticItalic, fontSelector, m_featureSettings, m_variantSettings)) {
117  m_activeSource = m_sources[i].get();
118 #if ENABLE(FONT_LOAD_EVENTS)
119  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading && m_sources[i]->isLoaded()) {
120  notifyFontLoader(Loaded);
121  notifyLoadingDone();
122  }
123 #endif
124  return result.release();
 82 if (allSourcesHaveFailed())
 83 return nullptr;
 84
 85 for (size_t index = 0; index < m_sources.size(); ) {
 86 switch (m_sources[index]->state()) {
 87 case FontFaceSource::State::Pending:
 88 m_sources[index]->load();
 89 break;
 90 case FontFaceSource::State::Loading:
 91 return Font::create(FontCache::singleton().lastResortFallbackFont(fontDescription)->platformData(), true, true);
 92 case FontFaceSource::State::Failed:
 93 ++index;
 94 break;
 95 case FontFaceSource::State::Succeeded:
 96 if (auto result = m_sources[index]->font(fontDescription, syntheticBold, syntheticItalic, m_featureSettings, m_variantSettings))
 97 return result;
 98 ++index;
 99 break;
125100 }
126101 }
127102
128 #if ENABLE(FONT_LOAD_EVENTS)
129  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading) {
130  notifyFontLoader(Error);
131  notifyLoadingDone();
132  }
133 #endif
134103 return nullptr;
135104}
136105
137 #if ENABLE(FONT_LOAD_EVENTS)
138 void CSSFontFace::notifyFontLoader(LoadState newState)
139 {
140  m_loadState = newState;
141 
142  Document* document = (*m_segmentedFontFaces.begin())->fontSelector()->document();
143  if (!document)
144  return;
145 
146  switch (newState) {
147  case Loading:
148  document->fonts()->beginFontLoading(m_rule.get());
149  break;
150  case Loaded:
151  document->fonts()->fontLoaded(m_rule.get());
152  break;
153  case Error:
154  document->fonts()->loadError(m_rule.get(), m_activeSource);
155  break;
156  default:
157  break;
158  }
159 }
160 
161 void CSSFontFace::notifyLoadingDone()
162 {
163  Document* document = (*m_segmentedFontFaces.begin())->fontSelector()->document();
164  if (document)
165  document->fonts()->loadingDone();
166 }
167 #endif
168 
169 #if ENABLE(SVG_FONTS)
170 bool CSSFontFace::hasSVGFontFaceSource() const
171 {
172  size_t size = m_sources.size();
173  for (size_t i = 0; i < size; i++) {
174  if (m_sources[i]->isSVGFontFaceSource())
175  return true;
176  }
177  return false;
178 }
179 #endif
180 
181106}

Source/WebCore/css/CSSFontFace.h

2626#ifndef CSSFontFace_h
2727#define CSSFontFace_h
2828
29 #include "CSSFontFaceRule.h"
30 #include "CSSFontFaceSource.h"
 29#include "FontFaceSource.h"
3130#include "FontFeatureSettings.h"
3231#include "TextFlags.h"
3332#include <memory>

@@class Font;
4544
4645class CSSFontFace : public RefCounted<CSSFontFace> {
4746public:
48  static Ref<CSSFontFace> create(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback = false) { return adoptRef(*new CSSFontFace(traitsMask, WTFMove(rule), isLocalFallback)); }
 47 static Ref<CSSFontFace> create(FontTraitsMask traitsMask, bool isLocalFallback = false) { return adoptRef(*new CSSFontFace(traitsMask, isLocalFallback)); }
4948
5049 FontTraitsMask traitsMask() const { return m_traitsMask; }
5150

@@public:
7574 void addedToSegmentedFontFace(CSSSegmentedFontFace*);
7675 void removedFromSegmentedFontFace(CSSSegmentedFontFace*);
7776
78  bool isValid() const;
 77 bool allSourcesHaveFailed() const;
7978
8079 bool isLocalFallback() const { return m_isLocalFallback; }
8180
82  void addSource(std::unique_ptr<CSSFontFaceSource>);
 81 void addSource(std::unique_ptr<FontFaceSource>&&);
8382
84  void fontLoaded(CSSFontFaceSource*);
 83 // Something asynchronous happened (but nothing in particular; if you want to know, you have to figure it out yourself).
 84 void kick(FontFaceSource&);
8585
8686 RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic);
8787

@@public:
100100 UChar32 m_to;
101101 };
102102
103 #if ENABLE(SVG_FONTS)
104  bool hasSVGFontFaceSource() const;
105 #endif
106 
107 #if ENABLE(FONT_LOAD_EVENTS)
108  enum LoadState { NotLoaded, Loading, Loaded, Error };
109  LoadState loadState() const { return m_loadState; }
110 #endif
111 
112103private:
113  CSSFontFace(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback)
 104 CSSFontFace(FontTraitsMask traitsMask, bool isLocalFallback)
114105 : m_traitsMask(traitsMask)
115  , m_activeSource(0)
116106 , m_isLocalFallback(isLocalFallback)
117 #if ENABLE(FONT_LOAD_EVENTS)
118  , m_loadState(isLocalFallback ? Loaded : NotLoaded)
119  , m_rule(rule)
120 #endif
121107 {
122  UNUSED_PARAM(rule);
123108 }
124109
125110 FontTraitsMask m_traitsMask;

@@private:
127112 HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces;
128113 FontFeatureSettings m_featureSettings;
129114 FontVariantSettings m_variantSettings;
130  Vector<std::unique_ptr<CSSFontFaceSource>> m_sources;
131  CSSFontFaceSource* m_activeSource;
 115 Vector<std::unique_ptr<FontFaceSource>> m_sources;
132116 bool m_isLocalFallback;
133 #if ENABLE(FONT_LOAD_EVENTS)
134  LoadState m_loadState;
135  RefPtr<CSSFontFaceRule> m_rule;
136  void notifyFontLoader(LoadState);
137  void notifyLoadingDone();
138 #endif
139117};
140118
141119}

Source/WebCore/css/CSSFontFaceSource.cpp

1 /*
2  * Copyright (C) 2007, 2008, 2010, 2011 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #include "config.h"
27 #include "CSSFontFaceSource.h"
28 
29 #include "CSSFontFace.h"
30 #include "CSSFontSelector.h"
31 #include "CachedFont.h"
32 #include "CachedResourceLoader.h"
33 #include "Document.h"
34 #include "ElementIterator.h"
35 #include "Font.h"
36 #include "FontCache.h"
37 #include "FontDescription.h"
38 
39 #if ENABLE(SVG_OTF_CONVERTER)
40 #include "FontCustomPlatformData.h"
41 #include "SVGToOTFFontConversion.h"
42 #endif
43 
44 #if ENABLE(SVG_FONTS)
45 #include "CachedSVGFont.h"
46 #include "FontCustomPlatformData.h"
47 #include "SVGFontData.h"
48 #include "SVGFontElement.h"
49 #include "SVGFontFaceElement.h"
50 #include "SVGNames.h"
51 #include "SVGURIReference.h"
52 #endif
53 
54 namespace WebCore {
55 
56 CSSFontFaceSource::CSSFontFaceSource(const String& str, CachedFont* font)
57  : m_string(str)
58  , m_font(font)
59  , m_face(0)
60 {
61  if (m_font)
62  m_font->addClient(this);
63 }
64 
65 CSSFontFaceSource::~CSSFontFaceSource()
66 {
67  if (m_font)
68  m_font->removeClient(this);
69 }
70 
71 bool CSSFontFaceSource::isValid() const
72 {
73  if (m_font)
74  return !m_font->errorOccurred();
75  return true;
76 }
77 
78 void CSSFontFaceSource::fontLoaded(CachedFont*)
79 {
80  if (m_face)
81  m_face->fontLoaded(this);
82 }
83 
84 RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, CSSFontSelector* fontSelector, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
85 {
86  // If the font hasn't loaded or an error occurred, then we've got nothing.
87  if (!isValid())
88  return nullptr;
89 
90  if (!m_font
91 #if ENABLE(SVG_FONTS)
92  && !m_svgFontFaceElement
93 #endif
94  ) {
95  // We're local. Just return a Font from the normal cache.
96  // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
97  return FontCache::singleton().fontForFamily(fontDescription, m_string, true);
98  }
99 
100  if (!m_font || m_font->isLoaded()) {
101  if (m_font) {
102  if (!m_font->ensureCustomFontData(m_string))
103  return nullptr;
104 
105  return m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
106  } else {
107 #if ENABLE(SVG_FONTS)
108  // In-Document SVG Fonts
109  if (m_svgFontFaceElement) {
110 #if ENABLE(SVG_OTF_CONVERTER)
111  if (!m_svgFontFaceElement->parentNode() || !is<SVGFontElement>(m_svgFontFaceElement->parentNode()))
112  return nullptr;
113  SVGFontElement& fontElement = downcast<SVGFontElement>(*m_svgFontFaceElement->parentNode());
114  // FIXME: Re-run this when script modifies the element or any of its descendents
115  // FIXME: We might have already converted this font. Make existing conversions discoverable.
116  if (auto otfFont = convertSVGToOTFFont(fontElement))
117  m_generatedOTFBuffer = SharedBuffer::adoptVector(otfFont.value());
118  if (!m_generatedOTFBuffer)
119  return nullptr;
120  auto customPlatformData = createFontCustomPlatformData(*m_generatedOTFBuffer);
121  if (!customPlatformData)
122  return nullptr;
123  return Font::create(customPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
124 #else
125  return Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
126 #endif
127  }
128 #endif
129  return nullptr;
130  }
131  } else {
132  // Kick off the load. Do it soon rather than now, because we may be in the middle of layout,
133  // and the loader may invoke arbitrary delegate or event handler code.
134  fontSelector->beginLoadingFontSoon(m_font.get());
135 
136  return Font::create(FontCache::singleton().lastResortFallbackFont(fontDescription)->platformData(), true, true);
137  }
138 }
139 
140 #if ENABLE(SVG_FONTS)
141 bool CSSFontFaceSource::isSVGFontFaceSource() const
142 {
143  return m_svgFontFaceElement || is<CachedSVGFont>(m_font.get());
144 }
145 #endif
146 
147 #if ENABLE(FONT_LOAD_EVENTS)
148 bool CSSFontFaceSource::isDecodeError() const
149 {
150  if (m_font)
151  return m_font->status() == CachedResource::DecodeError;
152  return false;
153 }
154 
155 bool CSSFontFaceSource::ensureFontData()
156 {
157  if (!m_font)
158  return false;
159  return m_font->ensureCustomFontData(m_hasExternalSVGFont, m_string);
160 }
161 #endif
162 
163 }

Source/WebCore/css/CSSFontFaceSource.h

1 /*
2  * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef CSSFontFaceSource_h
27 #define CSSFontFaceSource_h
28 
29 #include "CachedFontClient.h"
30 #include "CachedResourceHandle.h"
31 #include "SharedBuffer.h"
32 #if ENABLE(SVG_FONTS)
33 #include "SVGFontElement.h"
34 #include "SVGFontFaceElement.h"
35 #endif
36 #include "Timer.h"
37 #include <wtf/text/AtomicString.h>
38 
39 namespace WebCore {
40 
41 class CSSFontFace;
42 class CSSFontSelector;
43 class Font;
44 class FontDescription;
45 class FontFeatureSettings;
46 struct FontVariantSettings;
47 
48 class CSSFontFaceSource final : public CachedFontClient {
49  WTF_MAKE_FAST_ALLOCATED;
50 public:
51  CSSFontFaceSource(const String&, CachedFont* = nullptr);
52  virtual ~CSSFontFaceSource();
53 
54  bool isValid() const;
55 
56  const AtomicString& string() const { return m_string; }
57 
58  void setFontFace(CSSFontFace* face) { m_face = face; }
59 
60  virtual void fontLoaded(CachedFont*) override;
61 
62  RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, CSSFontSelector*, const FontFeatureSettings&, const FontVariantSettings&);
63 
64  void pruneTable();
65 
66 #if ENABLE(SVG_FONTS)
67  SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement.get(); }
68  void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement> element) { m_svgFontFaceElement = element; }
69  bool isSVGFontFaceSource() const;
70 #endif
71 
72 #if ENABLE(FONT_LOAD_EVENTS)
73  bool isDecodeError() const;
74  bool ensureFontData();
75 #endif
76 
77 private:
78  void startLoadingTimerFired();
79 
80  AtomicString m_string; // URI for remote, built-in font name for local.
81  CachedResourceHandle<CachedFont> m_font; // For remote fonts, a pointer to our cached resource.
82  CSSFontFace* m_face; // Our owning font face.
83 
84 #if ENABLE(SVG_OTF_CONVERTER)
85  RefPtr<SharedBuffer> m_generatedOTFBuffer;
86 #endif
87 
88 #if ENABLE(SVG_FONTS) || ENABLE(SVG_OTF_CONVERTER)
89  RefPtr<SVGFontFaceElement> m_svgFontFaceElement;
90 #endif
91 };
92 
93 }
94 
95 #endif

Source/WebCore/css/CSSFontFaceSrcValue.cpp

@@bool CSSFontFaceSrcValue::traverseSubresources(const std::function<bool (const C
9898 return handler(*m_cachedFont);
9999}
100100
101 CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isSVG, bool isInitiatingElementInUserAgentShadowTree)
 101CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isInitiatingElementInUserAgentShadowTree)
102102{
103103 if (m_cachedFont)
104104 return m_cachedFont.get();

@@CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document, bool isSVG, bool
108108
109109 CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options);
110110 request.setInitiator(cachedResourceRequestInitiators().css);
111  m_cachedFont = document->cachedResourceLoader().requestFont(request, isSVG);
 111 m_cachedFont = document->cachedResourceLoader().requestFont(request);
112112 return m_cachedFont.get();
113113}
114114

Source/WebCore/css/CSSFontFaceSrcValue.h

@@public:
7070
7171 bool traverseSubresources(const std::function<bool (const CachedResource&)>& handler) const;
7272
73  CachedFont* cachedFont(Document*, bool isSVG, bool isInitiatingElementInUserAgentShadowTree);
 73 CachedFont* cachedFont(Document*, bool isInitiatingElementInUserAgentShadowTree);
7474
7575 bool equals(const CSSFontFaceSrcValue&) const;
7676

Source/WebCore/css/CSSFontSelector.cpp

2727#include "config.h"
2828#include "CSSFontSelector.h"
2929
30 #include "CachedFont.h"
3130#include "CSSFontFace.h"
3231#include "CSSFontFaceRule.h"
33 #include "CSSFontFaceSource.h"
3432#include "CSSFontFaceSrcValue.h"
3533#include "CSSFontFamily.h"
3634#include "CSSFontFeatureValue.h"

4139#include "CSSUnicodeRangeValue.h"
4240#include "CSSValueKeywords.h"
4341#include "CSSValueList.h"
 42#include "CachedFont.h"
4443#include "CachedResourceLoader.h"
 44#include "DeprecatedInDocumentSVGFontFaceSource.h"
 45#include "DeprecatedRemoteSVGFontFaceSource.h"
4546#include "Document.h"
4647#include "Font.h"
4748#include "FontCache.h"
4849#include "FontVariantBuilder.h"
4950#include "Frame.h"
5051#include "FrameLoader.h"
 52#include "InDocumentSVGFontFaceSource.h"
 53#include "LocalFontFaceSource.h"
 54#include "RemoteFontFaceSource.h"
5155#include "SVGFontFaceElement.h"
5256#include "SVGNames.h"
5357#include "Settings.h"

@@static Optional<FontTraitsMask> computeTraitsMask(const StyleProperties& style)
152156 return static_cast<FontTraitsMask>(traitsMask);
153157}
154158
155 static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask traitsMask, Document* document, const StyleRuleFontFace& fontFaceRule, bool isInitiatingElementInUserAgentShadowTree)
 159static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask traitsMask, Document* document, CSSFontSelector& fontSelector, bool isInitiatingElementInUserAgentShadowTree)
156160{
157161 RefPtr<CSSFontFaceRule> rule;
158 #if ENABLE(FONT_LOAD_EVENTS)
159  // FIXME: https://bugs.webkit.org/show_bug.cgi?id=112116 - This CSSFontFaceRule has no parent.
160  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
161  rule = static_pointer_cast<CSSFontFaceRule>(fontFaceRule.createCSSOMWrapper());
162 #else
163  UNUSED_PARAM(fontFaceRule);
164 #endif
165162 Ref<CSSFontFace> fontFace = CSSFontFace::create(traitsMask, WTFMove(rule));
166163
167164 int srcLength = srcList.length();

@@static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask tra
171168 for (int i = 0; i < srcLength; i++) {
172169 // An item in the list either specifies a string (local font name) or a URL (remote font to download).
173170 CSSFontFaceSrcValue& item = downcast<CSSFontFaceSrcValue>(*srcList.itemWithoutBoundsCheck(i));
174  std::unique_ptr<CSSFontFaceSource> source;
 171 std::unique_ptr<FontFaceSource> source;
175172
176173#if ENABLE(SVG_FONTS)
177174 foundSVGFont = item.isSVGFontFaceSrc() || item.svgFontFaceElement();

@@static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask tra
180177 Settings* settings = document ? document->settings() : nullptr;
181178 bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
182179 if (allowDownloading && item.isSupportedFormat() && document) {
183  if (CachedFont* cachedFont = item.cachedFont(document, foundSVGFont, isInitiatingElementInUserAgentShadowTree))
184  source = std::make_unique<CSSFontFaceSource>(item.resource(), cachedFont);
 180 if (CachedFont* cachedFont = item.cachedFont(document, isInitiatingElementInUserAgentShadowTree)) {
 181#if ENABLE(SVG_FONTS) && !ENABLE(SVG_OTF_CONVERTER)
 182 if (foundSVGFont)
 183 source = std::make_unique<DeprecatedRemoteSVGFontFaceSource>(fontFace, fontSelector, *cachedFont, item.resource());
 184 else
 185#endif
 186 source = std::make_unique<RemoteFontFaceSource>(fontFace, fontSelector, *cachedFont, item.resource());
 187 }
185188 }
186  } else
187  source = std::make_unique<CSSFontFaceSource>(item.resource());
188 
189  if (source) {
 189 } else {
190190#if ENABLE(SVG_FONTS)
191  source->setSVGFontFaceElement(item.svgFontFaceElement());
 191 if (auto* fontFaceElement = item.svgFontFaceElement())
 192 source = std::make_unique<InDocumentSVGFontFaceSource>(fontFace, *fontFaceElement, item.resource());
 193 else
192194#endif
193  fontFace->addSource(WTFMove(source));
 195 source = std::make_unique<LocalFontFaceSource>(fontFace, item.resource());
194196 }
 197
 198 if (source)
 199 fontFace->addSource(WTFMove(source));
195200 }
196201
197202 return fontFace;

@@static void registerLocalFontFacesForFamily(const String& familyName, HashMap<St
234239
235240 Vector<Ref<CSSFontFace>> faces = { };
236241 for (auto mask : traitsMasks) {
237  Ref<CSSFontFace> face = CSSFontFace::create(mask, nullptr, true);
238  face->addSource(std::make_unique<CSSFontFaceSource>(familyName));
239  ASSERT(face->isValid());
 242 Ref<CSSFontFace> face = CSSFontFace::create(mask, true);
 243 face->addSource(std::make_unique<LocalFontFaceSource>(face, familyName));
 244 ASSERT(!face->allSourcesHaveFailed());
240245 faces.append(WTFMove(face));
241246 }
242247 locallyInstalledFontFaces.add(familyName, WTFMove(faces));

@@void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo
273278 return;
274279 auto traitsMask = computedTraitsMask.value();
275280
276  Ref<CSSFontFace> fontFace = createFontFace(srcList, traitsMask, m_document, fontFaceRule, isInitiatingElementInUserAgentShadowTree);
277  if (!fontFace->isValid())
 281 Ref<CSSFontFace> fontFace = createFontFace(srcList, traitsMask, m_document, *this, isInitiatingElementInUserAgentShadowTree);
 282 if (fontFace->allSourcesHaveFailed())
278283 return;
279284
280285 if (rangeList) {

Source/WebCore/css/CSSSegmentedFontFace.cpp

2727#include "CSSSegmentedFontFace.h"
2828
2929#include "CSSFontFace.h"
30 #include "CSSFontFaceSource.h"
3130#include "CSSFontSelector.h"
3231#include "Document.h"
3332#include "Font.h"

@@static void appendFontWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<F
9897
9998FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription)
10099{
101  FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
102 
103100 auto addResult = m_descriptionToRangesMap.add(FontDescriptionKey(fontDescription), FontRanges());
104101 auto& fontRanges = addResult.iterator->value;
105102
106103 if (addResult.isNewEntry) {
 104 FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
107105 for (auto& face : m_fontFaces) {
108  if (!face->isValid())
 106 if (face->allSourcesHaveFailed())
109107 continue;
110108
111109 FontTraitsMask traitsMask = face->traitsMask();

Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "DeprecatedInDocumentSVGFontFaceSource.h"
 28
 29#if !ENABLE(SVG_OTF_CONVERTER)
 30
 31#include "FontDescription.h"
 32#include "SVGFontData.h"
 33#include "SVGFontFaceElement.h"
 34
 35namespace WebCore {
 36
 37InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement& fontFace, const AtomicString&)
 38 : FontFaceSource(owner)
 39 , m_svgFontFaceElement(fontFace)
 40{
 41}
 42
 43void InDocumentSVGFontFaceSource::initiateLoad()
 44{
 45 setState(State::Succeeded);
 46}
 47
 48RefPtr<Font> InDocumentSVGFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&)
 49{
 50 return Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.ptr()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
 51}
 52
 53}
 54
 55#endif

Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef DeprecatedInDocumentSVGFontFaceSource_h
 27#define DeprecatedInDocumentSVGFontFaceSource_h
 28
 29#include "FontFaceSource.h"
 30
 31#if !ENABLE(SVG_OTF_CONVERTER)
 32
 33namespace WebCore {
 34
 35class SVGFontFaceElement;
 36
 37class InDocumentSVGFontFaceSource final : public FontFaceSource {
 38public:
 39 InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement&, const AtomicString& remoteURI);
 40
 41private:
 42 virtual void initiateLoad() override;
 43
 44 virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings) override;
 45
 46 Ref<SVGFontFaceElement> m_svgFontFaceElement;
 47};
 48
 49}
 50
 51#endif
 52
 53#endif
 54
 55

Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "DeprecatedRemoteSVGFontFaceSource.h"
 28
 29#if !ENABLE(SVG_OTF_CONVERTER)
 30
 31#include "ElementChildIterator.h"
 32#include "FontDescription.h"
 33#include "SVGDocument.h"
 34#include "SVGFontData.h"
 35#include "SVGFontElement.h"
 36#include "SVGFontFaceElement.h"
 37#include "SharedBuffer.h"
 38
 39namespace WebCore {
 40
 41DeprecatedRemoteSVGFontFaceSource::DeprecatedRemoteSVGFontFaceSource(CSSFontFace& owner, CSSFontSelector& fontSelector, CachedFont& cachedFont, const AtomicString& remoteURI)
 42 : RemoteFontFaceSource(owner, fontSelector, cachedFont, remoteURI)
 43{
 44}
 45
 46bool DeprecatedRemoteSVGFontFaceSource::bufferProvided(SharedBuffer& buffer)
 47{
 48 ASSERT(state() == State::Loading);
 49
 50 RefPtr<SVGDocument> externalSVGDocument = SVGDocument::create(nullptr, URL());
 51 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
 52 externalSVGDocument->setContent(decoder->decodeAndFlush(buffer.data(), buffer.size()));
 53 if (decoder->sawError()) {
 54 setState(State::Failed);
 55 return false;
 56 }
 57
 58 if (SVGFontElement* externalSVGFontElement = getSVGFontById(*externalSVGDocument)) {
 59 if ((m_svgFontFaceElement = childrenOfType<SVGFontFaceElement>(*externalSVGFontElement).first()))
 60 return false;
 61 }
 62
 63 setState(State::Failed);
 64 return false;
 65}
 66
 67RefPtr<Font> DeprecatedRemoteSVGFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&)
 68{
 69 return Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
 70}
 71
 72}
 73
 74#endif

Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef DeprecatedRemoteSVGFontFaceSource_h
 27#define DeprecatedRemoteSVGFontFaceSource_h
 28
 29#include "RemoteFontFaceSource.h"
 30
 31#if !ENABLE(SVG_OTF_CONVERTER)
 32
 33namespace WebCore {
 34
 35class SVGFontFaceElement;
 36
 37class DeprecatedRemoteSVGFontFaceSource final : public RemoteFontFaceSource {
 38public:
 39 DeprecatedRemoteSVGFontFaceSource(CSSFontFace& owner, CSSFontSelector&, CachedFont&, const AtomicString& remoteURI);
 40
 41private:
 42 virtual bool bufferProvided(SharedBuffer&) override;
 43
 44 virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&) override;
 45
 46 RefPtr<SVGFontFaceElement> m_svgFontFaceElement;
 47};
 48
 49}
 50
 51#endif
 52
 53#endif
 54
 55

Source/WebCore/css/FontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "FontFaceSource.h"
 28
 29#include "FontDescription.h"
 30#include "TextFlags.h"
 31
 32namespace WebCore {
 33
 34FontFaceSource::HashKey::HashKey()
 35{
 36}
 37
 38FontFaceSource::HashKey::HashKey(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings)
 39 : m_size(fontDescription.computedPixelSize() + 1) // We don't want to collide with an empty cache entry.
 40 , m_widthVariant(fontDescription.widthVariant())
 41 , m_orientation(fontDescription.orientation())
 42 , m_syntheticBold(syntheticBold)
 43 , m_syntheticItalic(syntheticItalic)
 44 , m_textRenderingMode(fontDescription.textRenderingMode())
 45 , m_descriptionFeatureSettings(fontDescription.featureSettings())
 46 , m_fontFaceFeatureSettings(fontFaceFeatureSettings)
 47 , m_descriptionVariantSettings(fontDescription.variantSettings())
 48 , m_fontFaceVariantSettings(fontFaceVariantSettings)
 49{
 50 ASSERT(m_size > 0 && m_size < cHashTableDeletedSize);
 51}
 52
 53FontFaceSource::HashKey::HashKey(WTF::HashTableDeletedValueType)
 54 : m_size(cHashTableDeletedSize)
 55{
 56}
 57
 58bool FontFaceSource::HashKey::isHashTableDeletedValue() const
 59{
 60 return m_size == cHashTableDeletedSize;
 61}
 62
 63bool FontFaceSource::HashKey::operator==(const HashKey& other) const
 64{
 65 return m_size == other.m_size
 66 && m_widthVariant == other.m_widthVariant
 67 && m_orientation == other.m_orientation
 68 && m_syntheticBold == other.m_syntheticBold
 69 && m_syntheticItalic == other.m_syntheticItalic
 70 && m_textRenderingMode == other.m_textRenderingMode
 71 && m_descriptionFeatureSettings == other.m_descriptionFeatureSettings
 72 && m_fontFaceFeatureSettings == other.m_fontFaceFeatureSettings
 73 && m_descriptionVariantSettings == other.m_descriptionVariantSettings
 74 && m_fontFaceVariantSettings == other.m_fontFaceVariantSettings;
 75}
 76
 77bool FontFaceSource::HashKey::operator!=(const HashKey& other) const
 78{
 79 return !(*this == other);
 80}
 81
 82unsigned FontFaceSource::HashKey::hash(const HashKey& key)
 83{
 84 IntegerHasher hasher;
 85 hasher.add(key.m_size);
 86 hasher.add(key.m_widthVariant);
 87 hasher.add(key.m_orientation);
 88 hasher.add(key.m_syntheticBold);
 89 hasher.add(key.m_syntheticItalic);
 90 hasher.add(key.m_textRenderingMode);
 91 hasher.add(key.m_descriptionFeatureSettings.hash());
 92 hasher.add(key.m_fontFaceFeatureSettings.hash());
 93 hasher.add(key.m_descriptionVariantSettings.hash());
 94 hasher.add(key.m_fontFaceVariantSettings.hash());
 95 return hasher.hash();
 96}
 97
 98bool FontFaceSource::HashKey::equal(const HashKey& a, const HashKey& b)
 99{
 100 return a == b;
 101}
 102
 103const unsigned FontFaceSource::HashKey::cHashTableDeletedSize = 0xFFFFFFFFU;
 104
 105FontFaceSource::FontFaceSource(CSSFontFace& owner)
 106 : m_owner(owner)
 107{
 108}
 109
 110void FontFaceSource::load()
 111{
 112 ASSERT(m_state == State::Pending);
 113 setState(State::Loading);
 114 initiateLoad();
 115}
 116
 117RefPtr<Font> FontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings)
 118{
 119 ASSERT(m_state == State::Succeeded);
 120 if (!shouldCache())
 121 return createFont(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatureSettings, fontFaceVariantSettings);
 122
 123 HashKey hashKey(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatureSettings, fontFaceVariantSettings);
 124 auto addResult = m_cache.add(hashKey, nullptr);
 125 if (addResult.isNewEntry)
 126 addResult.iterator->value = createFont(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatureSettings, fontFaceVariantSettings);
 127 return addResult.iterator->value;
 128}
 129
 130}

Source/WebCore/css/FontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef FontFaceSource_h
 27#define FontFaceSource_h
 28
 29#include "Font.h"
 30#include "FontFeatureSettings.h"
 31
 32namespace WebCore {
 33
 34class CSSFontFace;
 35class Font;
 36class FontDescription;
 37class FontFeatureSettings;
 38struct FontVariantSettings;
 39
 40// This class represents a single clause of a src: attribute inside an @font-face block.
 41class FontFaceSource {
 42 WTF_MAKE_FAST_ALLOCATED;
 43public:
 44 FontFaceSource(CSSFontFace& owner);
 45 virtual ~FontFaceSource() { }
 46
 47 // => Succeeded
 48 // //
 49 // Pending => Loading
 50 // \\.
 51 // => Failed
 52 enum class State {
 53 Pending,
 54 Loading,
 55 Failed,
 56 Succeeded
 57 };
 58 State state() const { return m_state; }
 59
 60 // State transition from Pending to Loading
 61 void load();
 62
 63 // Subclasses handle the transition from Loading to Failed/Succeeded.
 64
 65 // Only valid when state is Succeeded
 66 RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings);
 67
 68protected:
 69 CSSFontFace& owner() const { return m_owner; }
 70 void setState(State state) { m_state = state; }
 71
 72private:
 73 // Among the many arguments to font(), this key is only sensitive to the pieces that are actually used when creating a Font.
 74 // Other values are expected (indeed, encouraged) to collide for performance.
 75 class HashKey {
 76 public:
 77 HashKey();
 78 HashKey(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings);
 79
 80 explicit HashKey(WTF::HashTableDeletedValueType);
 81
 82 bool isHashTableDeletedValue() const;
 83
 84 bool operator==(const HashKey& other) const;
 85 bool operator!=(const HashKey& other) const;
 86
 87 static unsigned hash(const HashKey&);
 88 static bool equal(const HashKey&, const HashKey&);
 89
 90 static const bool safeToCompareToEmptyOrDeleted = true;
 91
 92 private:
 93 static const unsigned cHashTableDeletedSize;
 94
 95 unsigned m_size { 0 };
 96 FontWidthVariant m_widthVariant { RegularWidth };
 97 FontOrientation m_orientation { Horizontal };
 98 bool m_syntheticBold { false };
 99 bool m_syntheticItalic { false };
 100 TextRenderingMode m_textRenderingMode { AutoTextRendering };
 101 FontFeatureSettings m_descriptionFeatureSettings;
 102 FontFeatureSettings m_fontFaceFeatureSettings;
 103 FontVariantSettings m_descriptionVariantSettings;
 104 FontVariantSettings m_fontFaceVariantSettings;
 105 };
 106
 107 virtual bool shouldCache() const { return true; }
 108 virtual void initiateLoad() = 0;
 109 virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings) = 0;
 110
 111 CSSFontFace& m_owner;
 112 HashMap<HashKey, RefPtr<Font>, HashKey, WTF::SimpleClassHashTraits<HashKey>> m_cache;
 113 State m_state { State::Pending };
 114};
 115
 116}
 117
 118#endif

Source/WebCore/css/FontLoader.cpp

2929#if ENABLE(FONT_LOAD_EVENTS)
3030
3131#include "CSSFontFaceLoadEvent.h"
32 #include "CSSFontFaceSource.h"
3332#include "CSSFontSelector.h"
3433#include "CSSParser.h"
3534#include "CSSSegmentedFontFace.h"

Source/WebCore/css/ImmediateFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef ImmediateFontFaceSource_h
 27#define ImmediateFontFaceSource_h
 28
 29#include "ByteBasedFontFaceSource.h"
 30
 31namespace WebCore {
 32
 33class ImmediateFontFaceSource final : public ByteBasedFontFaceSource {
 34public:
 35 ImmediateFontFaceSource(CSSFontFace& owner, JSC::ArrayBuffer& data)
 36 : ByteBasedFontFaceSource(owner)
 37 {
 38 setState(State::Loading);
 39 bufferProvided(data);
 40 }
 41
 42private:
 43 virtual void initiateLoad() override
 44 {
 45 ASSERT_NOT_REACHED();
 46 }
 47};
 48
 49}
 50
 51#endif
 52
 53

Source/WebCore/css/InDocumentSVGFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "InDocumentSVGFontFaceSource.h"
 28
 29#if ENABLE(SVG_OTF_CONVERTER)
 30
 31#include "SVGFontElement.h"
 32#include "SVGFontFaceElement.h"
 33#include "SVGToOTFFontConversion.h"
 34#include "SharedBuffer.h"
 35
 36namespace WebCore {
 37
 38InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement& fontFace, const AtomicString& remoteURI)
 39 : ByteBasedFontFaceSource(owner, remoteURI, false)
 40 , m_svgFontFaceElement(fontFace)
 41{
 42}
 43
 44void InDocumentSVGFontFaceSource::initiateLoad()
 45{
 46 if (!m_svgFontFaceElement->parentNode() || !is<SVGFontElement>(m_svgFontFaceElement->parentNode())) {
 47 setState(State::Failed);
 48 return;
 49 }
 50
 51 SVGFontElement& fontElement = downcast<SVGFontElement>(*m_svgFontFaceElement->parentNode());
 52
 53 if (auto otfFont = convertSVGToOTFFont(fontElement)) {
 54 RefPtr<SharedBuffer> buffer = SharedBuffer::adoptVector(otfFont.value());
 55 bufferProvided(*buffer);
 56 return;
 57 }
 58
 59 setState(State::Failed);
 60}
 61
 62}
 63
 64#endif

Source/WebCore/css/InDocumentSVGFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26
 27#ifndef InDocumentSVGFontFaceSource_h
 28#define InDocumentSVGFontFaceSource_h
 29
 30#include "ByteBasedFontFaceSource.h"
 31
 32#if ENABLE(SVG_OTF_CONVERTER)
 33
 34namespace WebCore {
 35
 36class SVGFontFaceElement;
 37
 38class InDocumentSVGFontFaceSource final : public ByteBasedFontFaceSource {
 39public:
 40 InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement&, const AtomicString& remoteURI);
 41
 42private:
 43 virtual void initiateLoad() override;
 44
 45 Ref<SVGFontFaceElement> m_svgFontFaceElement;
 46};
 47
 48}
 49
 50#endif
 51
 52#endif
 53
 54

Source/WebCore/css/LocalFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "LocalFontFaceSource.h"
 28
 29#include "FontCache.h"
 30
 31namespace WebCore {
 32
 33LocalFontFaceSource::LocalFontFaceSource(CSSFontFace& owner, const String& familyName)
 34 : FontFaceSource(owner)
 35 , m_familyName(familyName)
 36{
 37}
 38
 39void LocalFontFaceSource::initiateLoad()
 40{
 41 setState(State::Succeeded);
 42}
 43
 44RefPtr<Font> LocalFontFaceSource::createFont(const FontDescription& fontDescription, bool, bool, const FontFeatureSettings&, const FontVariantSettings&)
 45{
 46 // The @font-face block's bold/italic style may disagree with our own knowledge of the real traits of a preinstalled font.
 47 // In this situation, we should consider the real traits of the preinstalled font when determining if we should apply synthetic bold/italic.
 48 // Luckily, FontCache automatically does this for us, so we simply disregard the @font-face block's bold/italic style.
 49
 50 // FIXME: This local font face needs to apply the @font-face's font feature properties.
 51 return FontCache::singleton().fontForFamily(fontDescription, m_familyName, true);
 52}
 53
 54}

Source/WebCore/css/LocalFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef LocalFontFaceSource_h
 27#define LocalFontFaceSource_h
 28
 29#include "FontFaceSource.h"
 30
 31namespace WebCore {
 32
 33// This class represents an entry of "src: local(xyz)" in an @font-face block.
 34class LocalFontFaceSource final : public FontFaceSource {
 35public:
 36 LocalFontFaceSource(CSSFontFace& owner, const String& familyName);
 37
 38private:
 39 // We internally use FontCache, which is sensitive to more pieces of the FontDescription than our cache is sensitive to, so the FontFaceSource's cache would yield false hits.
 40 // Luckily, FontCache internally caches fonts, so we are still on a fast path.
 41 virtual bool shouldCache() const override { return false; }
 42
 43 virtual void initiateLoad() override;
 44
 45 virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings) override;
 46
 47 String m_familyName;
 48};
 49
 50}
 51
 52#endif

Source/WebCore/css/RemoteFontFaceSource.cpp

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "RemoteFontFaceSource.h"
 28
 29#include "CSSFontFace.h"
 30#include "CSSFontSelector.h"
 31#include "CachedFont.h"
 32
 33namespace WebCore {
 34
 35RemoteFontFaceSource::RemoteFontFaceSource(CSSFontFace& owner, CSSFontSelector& fontSelector, CachedFont& cachedFont, const AtomicString& remoteURI)
 36 : ByteBasedFontFaceSource(owner, remoteURI)
 37 , m_fontSelector(fontSelector)
 38 , m_cachedFont(cachedFont)
 39{
 40 m_cachedFont.addClient(this);
 41}
 42
 43RemoteFontFaceSource::~RemoteFontFaceSource()
 44{
 45 m_cachedFont.removeClient(this);
 46}
 47
 48void RemoteFontFaceSource::initiateLoad()
 49{
 50 // Kick off the load. Do it soon rather than now, because we may be in the middle of layout,
 51 // and the loader may invoke arbitrary delegate or event handler code.
 52 m_fontSelector.beginLoadingFontSoon(&m_cachedFont);
 53}
 54
 55class OwnerKicker {
 56public:
 57 OwnerKicker(RemoteFontFaceSource& source)
 58 : m_source(source)
 59 {
 60 }
 61
 62 ~OwnerKicker()
 63 {
 64 m_source.kickOwner();
 65 }
 66private:
 67 RemoteFontFaceSource& m_source;
 68};
 69
 70void RemoteFontFaceSource::kickOwner()
 71{
 72 owner().kick(*this);
 73}
 74
 75void RemoteFontFaceSource::fontLoaded(CachedFont& font)
 76{
 77 ASSERT_UNUSED(font, &font == &m_cachedFont);
 78 ASSERT(!m_cachedFont.isLoading());
 79
 80 OwnerKicker kicker(*this);
 81
 82 if (m_cachedFont.errorOccurred() || !m_cachedFont.resourceBuffer()) {
 83 setState(State::Failed);
 84 return;
 85 }
 86
 87 // If the font is in the cache, this function will be called synchronously from CachedFont::addClient().
 88 // We also may share CachedFont objects with other RemoteFontFaceSources (which are in a different state than we are).
 89 if (state() == State::Pending)
 90 setState(State::Loading);
 91
 92 if (m_cachedFont.customPlatformData()) {
 93 setState(State::Succeeded);
 94 return;
 95 }
 96
 97 if (bufferProvided(*m_cachedFont.resourceBuffer()))
 98 m_cachedFont.hasCreatedFontDataWrappingResource();
 99
 100 if (state() != State::Failed) {
 101 m_cachedFont.setCustomPlatformData(WTFMove(customPlatformData()));
 102 setState(State::Succeeded); // Finally!!
 103 }
 104
 105 ASSERT(state() != State::Loading);
 106}
 107
 108RefPtr<Font> RemoteFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
 109{
 110 if (auto* fontCustomPlatformData = m_cachedFont.customPlatformData())
 111 return createFontWithCustomPlatformData(*fontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
 112 return ByteBasedFontFaceSource::createFont(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
 113}
 114
 115}

Source/WebCore/css/RemoteFontFaceSource.h

 1/*
 2 * Copyright (C) 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef RemoteFontFaceSource_h
 27#define RemoteFontFaceSource_h
 28
 29#include "ByteBasedFontFaceSource.h"
 30#include "CachedFontClient.h"
 31
 32namespace WebCore {
 33
 34class CachedFont;
 35class CSSFontSelector;
 36class OwnerKicker;
 37
 38class RemoteFontFaceSource : public ByteBasedFontFaceSource, public CachedFontClient {
 39public:
 40 RemoteFontFaceSource(CSSFontFace& owner, CSSFontSelector&, CachedFont&, const AtomicString& remoteURI);
 41 virtual ~RemoteFontFaceSource();
 42
 43private:
 44 friend class OwnerKicker;
 45
 46 virtual void initiateLoad() override;
 47
 48 RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&) override;
 49
 50 // CachedFontClient
 51 virtual void fontLoaded(CachedFont&) override;
 52
 53 void kickOwner();
 54
 55 CSSFontSelector& m_fontSelector;
 56 CachedFont& m_cachedFont;
 57};
 58
 59}
 60
 61#endif

Source/WebCore/inspector/InspectorPageAgent.cpp

@@InspectorPageAgent::ResourceType InspectorPageAgent::cachedResourceType(const Ca
301301 switch (cachedResource.type()) {
302302 case CachedResource::ImageResource:
303303 return InspectorPageAgent::ImageResource;
304 #if ENABLE(SVG_FONTS)
305  case CachedResource::SVGFontResource:
306 #endif
307304 case CachedResource::FontResource:
308305 return InspectorPageAgent::FontResource;
309306 case CachedResource::CSSStyleSheet:

@@static Vector<CachedResource*> cachedResourcesForFrame(Frame* frame)
458455 switch (cachedResource->type()) {
459456 case CachedResource::ImageResource:
460457 // Skip images that were not auto loaded (images disabled in the user agent).
461 #if ENABLE(SVG_FONTS)
462  case CachedResource::SVGFontResource:
463 #endif
464458 case CachedResource::FontResource:
465459 // Skip fonts that were referenced in CSS but never used/downloaded.
466460 if (cachedResource->stillNeedsLoad())

Source/WebCore/loader/ResourceLoadInfo.cpp

@@ResourceType toResourceType(CachedResource::Type type)
5050 return ResourceType::Script;
5151
5252 case CachedResource::FontResource:
53 #if ENABLE(SVG_FONTS)
54  case CachedResource::SVGFontResource:
55 #endif
5653 return ResourceType::Font;
5754
5855 case CachedResource::RawResource:

Source/WebCore/loader/SubresourceLoader.cpp

@@static void logResourceLoaded(Frame* frame, CachedResource::Type type)
337337 resourceType = DiagnosticLoggingKeys::scriptKey();
338338 break;
339339 case CachedResource::FontResource:
340 #if ENABLE(SVG_FONTS)
341  case CachedResource::SVGFontResource:
342 #endif
343340 resourceType = DiagnosticLoggingKeys::fontKey();
344341 break;
345342 case CachedResource::RawResource:

Source/WebCore/loader/cache/CachedFont.cpp

@@void CachedFont::didAddClient(CachedResourceClient* c)
7373{
7474 ASSERT(c->resourceClientType() == CachedFontClient::expectedType());
7575 if (!isLoading())
76  static_cast<CachedFontClient*>(c)->fontLoaded(this);
 76 static_cast<CachedFontClient*>(c)->fontLoaded(*this);
7777}
7878
7979void CachedFont::finishLoading(SharedBuffer* data)

@@void CachedFont::beginLoadIfNeeded(CachedResourceLoader& loader)
9292 }
9393}
9494
95 bool CachedFont::ensureCustomFontData(const AtomicString&)
96 {
97  return ensureCustomFontData(m_data.get());
98 }
99 
100 bool CachedFont::ensureCustomFontData(SharedBuffer* data)
101 {
102  if (!m_fontCustomPlatformData && !errorOccurred() && !isLoading() && data) {
103  RefPtr<SharedBuffer> buffer(data);
104 
105 #if !PLATFORM(COCOA)
106  if (isWOFF(buffer.get())) {
107  Vector<char> convertedFont;
108  if (!convertWOFFToSfnt(buffer.get(), convertedFont))
109  buffer = nullptr;
110  else
111  buffer = SharedBuffer::adoptVector(convertedFont);
112  }
113 #endif
114 
115  m_fontCustomPlatformData = buffer ? createFontCustomPlatformData(*buffer) : nullptr;
116  m_hasCreatedFontDataWrappingResource = m_fontCustomPlatformData && (buffer == m_data);
117  if (!m_fontCustomPlatformData)
118  setStatus(DecodeError);
119  }
120 
121  return m_fontCustomPlatformData.get();
122 }
123 
124 RefPtr<Font> CachedFont::createFont(const FontDescription& fontDescription, const AtomicString&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
125 {
126  return Font::create(platformDataFromCustomData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
127 }
128 
129 FontPlatformData CachedFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
130 {
131  ASSERT(m_fontCustomPlatformData);
132 #if PLATFORM(COCOA)
133  return m_fontCustomPlatformData->fontPlatformData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings);
134 #else
135  UNUSED_PARAM(fontFaceFeatures);
136  UNUSED_PARAM(fontFaceVariantSettings);
137  return m_fontCustomPlatformData->fontPlatformData(fontDescription, bold, italic);
138 #endif
139 }
140 
14195void CachedFont::allClientsRemoved()
14296{
14397 m_fontCustomPlatformData = nullptr;

@@void CachedFont::checkNotify()
150104
151105 CachedResourceClientWalker<CachedFontClient> w(m_clients);
152106 while (CachedFontClient* c = w.next())
153  c->fontLoaded(this);
 107 c->fontLoaded(*this);
154108}
155109
156110bool CachedFont::mayTryReplaceEncodedData() const

Source/WebCore/loader/cache/CachedFont.h

2929#include "CachedResource.h"
3030#include "CachedResourceClient.h"
3131#include "Font.h"
 32#include "FontCustomPlatformData.h"
3233#include "TextFlags.h"
3334
3435namespace WebCore {

@@class FontFeatureSettings;
3940class FontPlatformData;
4041class SVGDocument;
4142class SVGFontElement;
42 struct FontCustomPlatformData;
4343
4444class CachedFont : public CachedResource {
4545public:

@@public:
4949 void beginLoadIfNeeded(CachedResourceLoader&);
5050 virtual bool stillNeedsLoad() const override { return !m_loadInitiated; }
5151
52  virtual bool ensureCustomFontData(const AtomicString& remoteURI);
 52 void hasCreatedFontDataWrappingResource() { m_hasCreatedFontDataWrappingResource = true; }
5353
54  virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&);
55 
56 protected:
57  FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&);
58 
59  bool ensureCustomFontData(SharedBuffer* data);
 54 void setCustomPlatformData(std::unique_ptr<FontCustomPlatformData>&& fontCustomPlatformData) { m_fontCustomPlatformData = WTFMove(fontCustomPlatformData); }
 55 FontCustomPlatformData* customPlatformData() const { return m_fontCustomPlatformData.get(); }
6056
6157private:
6258 virtual void checkNotify() override;

Source/WebCore/loader/cache/CachedFontClient.h

@@public:
3737 virtual ~CachedFontClient() { }
3838 static CachedResourceClientType expectedType() { return FontType; }
3939 virtual CachedResourceClientType resourceClientType() const override { return expectedType(); }
40  virtual void fontLoaded(CachedFont*) { }
 40 virtual void fontLoaded(CachedFont&) { }
4141};
4242
4343} // namespace WebCore

Source/WebCore/loader/cache/CachedResource.cpp

@@static ResourceLoadPriority defaultPriorityForResourceType(CachedResource::Type
7171 case CachedResource::CSSStyleSheet:
7272 return ResourceLoadPriority::High;
7373 case CachedResource::Script:
74 #if ENABLE(SVG_FONTS)
75  case CachedResource::SVGFontResource:
76 #endif
7774 case CachedResource::FontResource:
7875 case CachedResource::RawResource:
7976 return ResourceLoadPriority::Medium;

Source/WebCore/loader/cache/CachedResource.h

@@public:
6666 CSSStyleSheet,
6767 Script,
6868 FontResource,
69 #if ENABLE(SVG_FONTS)
70  SVGFontResource,
71 #endif
7269 RawResource,
7370 SVGDocumentResource
7471#if ENABLE(XSLT)

Source/WebCore/loader/cache/CachedResourceLoader.cpp

3333#include "CachedImage.h"
3434#include "CachedRawResource.h"
3535#include "CachedResourceRequest.h"
36 #include "CachedSVGFont.h"
3736#include "CachedScript.h"
3837#include "CachedXSLStyleSheet.h"
3938#include "Chrome.h"

@@static CachedResource* createResource(CachedResource::Type type, ResourceRequest
9493 return new CachedScript(request, charset, sessionID);
9594 case CachedResource::SVGDocumentResource:
9695 return new CachedSVGDocument(request, sessionID);
97 #if ENABLE(SVG_FONTS)
98  case CachedResource::SVGFontResource:
99  return new CachedSVGFont(request, sessionID);
100 #endif
10196 case CachedResource::FontResource:
10297 return new CachedFont(request, sessionID);
10398 case CachedResource::RawResource:

@@CachedResourceHandle<CachedImage> CachedResourceLoader::requestImage(CachedResou
189184 return downcast<CachedImage>(requestResource(CachedResource::ImageResource, request).get());
190185}
191186
192 CachedResourceHandle<CachedFont> CachedResourceLoader::requestFont(CachedResourceRequest& request, bool isSVG)
 187CachedResourceHandle<CachedFont> CachedResourceLoader::requestFont(CachedResourceRequest& request)
193188{
194 #if ENABLE(SVG_FONTS)
195  if (isSVG)
196  return downcast<CachedSVGFont>(requestResource(CachedResource::SVGFontResource, request).get());
197 #else
198  UNUSED_PARAM(isSVG);
199 #endif
200189 return downcast<CachedFont>(requestResource(CachedResource::FontResource, request).get());
201190}
202191

@@static MixedContentChecker::ContentType contentTypeFromResourceType(CachedResour
286275 case CachedResource::FontResource:
287276 return MixedContentChecker::ContentType::Active;
288277
289 #if ENABLE(SVG_FONTS)
290  case CachedResource::SVGFontResource:
291  return MixedContentChecker::ContentType::Active;
292 #endif
293 
294278 case CachedResource::RawResource:
295279 case CachedResource::SVGDocumentResource:
296280 return MixedContentChecker::ContentType::Active;

@@bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const
335319#endif
336320 case CachedResource::RawResource:
337321 case CachedResource::ImageResource:
338 #if ENABLE(SVG_FONTS)
339  case CachedResource::SVGFontResource:
340 #endif
341322 case CachedResource::FontResource: {
342323 // These resources can corrupt only the frame's pixels.
343324 if (Frame* f = frame()) {

@@bool CachedResourceLoader::canRequest(CachedResource::Type type, const URL& url,
377358 case CachedResource::ImageResource:
378359 case CachedResource::CSSStyleSheet:
379360 case CachedResource::Script:
380 #if ENABLE(SVG_FONTS)
381  case CachedResource::SVGFontResource:
382 #endif
383361 case CachedResource::FontResource:
384362 case CachedResource::RawResource:
385363#if ENABLE(LINK_PREFETCH)

@@bool CachedResourceLoader::canRequest(CachedResource::Type type, const URL& url,
427405 if (!m_document->contentSecurityPolicy()->allowImageFromSource(url, skipContentSecurityPolicyCheck))
428406 return false;
429407 break;
430 #if ENABLE(SVG_FONTS)
431  case CachedResource::SVGFontResource:
432 #endif
433408 case CachedResource::FontResource: {
434409 if (!m_document->contentSecurityPolicy()->allowFontFromSource(url, skipContentSecurityPolicyCheck))
435410 return false;

Source/WebCore/loader/cache/CachedResourceLoader.h

@@public:
7575 CachedResourceHandle<CachedCSSStyleSheet> requestCSSStyleSheet(CachedResourceRequest&);
7676 CachedResourceHandle<CachedCSSStyleSheet> requestUserCSSStyleSheet(CachedResourceRequest&);
7777 CachedResourceHandle<CachedScript> requestScript(CachedResourceRequest&);
78  CachedResourceHandle<CachedFont> requestFont(CachedResourceRequest&, bool isSVG);
 78 CachedResourceHandle<CachedFont> requestFont(CachedResourceRequest&);
7979 CachedResourceHandle<CachedRawResource> requestRawResource(CachedResourceRequest&);
8080 CachedResourceHandle<CachedRawResource> requestMainResource(CachedResourceRequest&);
8181 CachedResourceHandle<CachedSVGDocument> requestSVGDocument(CachedResourceRequest&);

Source/WebCore/loader/cache/CachedSVGFont.cpp

1 /*
2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3  * Copyright (C) 2009 Torch Mobile, Inc.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #include "config.h"
28 #include "CachedSVGFont.h"
29 
30 #if ENABLE(SVG_FONTS)
31 
32 #include "FontDescription.h"
33 #include "FontPlatformData.h"
34 #include "SVGDocument.h"
35 #include "SVGFontData.h"
36 #include "SVGFontElement.h"
37 #include "SVGFontFaceElement.h"
38 #include "SharedBuffer.h"
39 #include "TextResourceDecoder.h"
40 #include "TypedElementDescendantIterator.h"
41 
42 #if ENABLE(SVG_OTF_CONVERTER)
43 #include "SVGToOTFFontConversion.h"
44 #endif
45 
46 namespace WebCore {
47 
48 CachedSVGFont::CachedSVGFont(const ResourceRequest& resourceRequest, SessionID sessionID)
49  : CachedFont(resourceRequest, sessionID, SVGFontResource)
50  , m_externalSVGFontElement(nullptr)
51 {
52 }
53 
54 RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
55 {
56 #if ENABLE(SVG_OTF_CONVERTER)
57  if (firstFontFace(remoteURI))
58  return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
59 #else
60  UNUSED_PARAM(fontFaceFeatures);
61  UNUSED_PARAM(fontFaceVariantSettings);
62  if (SVGFontFaceElement* firstFontFace = this->firstFontFace(remoteURI))
63  return Font::create(std::make_unique<SVGFontData>(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
64 #endif
65  return nullptr;
66 }
67 
68 FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
69 {
70  if (m_externalSVGDocument)
71  return FontPlatformData(fontDescription.computedPixelSize(), bold, italic);
72  return CachedFont::platformDataFromCustomData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings);
73 }
74 
75 bool CachedSVGFont::ensureCustomFontData(const AtomicString& remoteURI)
76 {
77  if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
78  m_externalSVGDocument = SVGDocument::create(nullptr, URL());
79  RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
80  m_externalSVGDocument->setContent(decoder->decodeAndFlush(m_data->data(), m_data->size()));
81  if (decoder->sawError())
82  m_externalSVGDocument = nullptr;
83 #if ENABLE(SVG_OTF_CONVERTER)
84  if (m_externalSVGDocument)
85  maybeInitializeExternalSVGFontElement(remoteURI);
86  if (!m_externalSVGFontElement)
87  return false;
88  if (auto convertedFont = convertSVGToOTFFont(*m_externalSVGFontElement))
89  m_convertedFont = SharedBuffer::adoptVector(convertedFont.value());
90  else {
91  m_externalSVGDocument = nullptr;
92  return false;
93  }
94 #else
95  UNUSED_PARAM(remoteURI);
96 #endif
97  }
98 
99 #if !ENABLE(SVG_OTF_CONVERTER)
100  return m_externalSVGDocument;
101 #else
102  return m_externalSVGDocument && CachedFont::ensureCustomFontData(m_convertedFont.get());
103 #endif
104 }
105 
106 SVGFontElement* CachedSVGFont::getSVGFontById(const String& fontName) const
107 {
108  ASSERT(m_externalSVGDocument);
109  auto elements = descendantsOfType<SVGFontElement>(*m_externalSVGDocument);
110 
111  if (fontName.isEmpty())
112  return elements.first();
113 
114  for (auto& element : elements) {
115  if (element.getIdAttribute() == fontName)
116  return &element;
117  }
118  return nullptr;
119 }
120 
121 SVGFontElement* CachedSVGFont::maybeInitializeExternalSVGFontElement(const AtomicString& remoteURI)
122 {
123  if (m_externalSVGFontElement)
124  return m_externalSVGFontElement;
125  String fragmentIdentifier;
126  size_t start = remoteURI.find('#');
127  if (start != notFound)
128  fragmentIdentifier = remoteURI.string().substring(start + 1);
129  m_externalSVGFontElement = getSVGFontById(fragmentIdentifier);
130  return m_externalSVGFontElement;
131 }
132 
133 SVGFontFaceElement* CachedSVGFont::firstFontFace(const AtomicString& remoteURI)
134 {
135  if (!maybeInitializeExternalSVGFontElement(remoteURI))
136  return nullptr;
137 
138  if (auto* firstFontFace = childrenOfType<SVGFontFaceElement>(*m_externalSVGFontElement).first())
139  return firstFontFace;
140  return nullptr;
141 }
142 
143 }
144 
145 #endif

Source/WebCore/loader/cache/CachedSVGFont.h

1 /*
2  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef CachedSVGFont_h
27 #define CachedSVGFont_h
28 
29 #if ENABLE(SVG_FONTS)
30 
31 #include "CachedFont.h"
32 
33 namespace WebCore {
34 
35 class SVGFontFaceElement;
36 
37 class CachedSVGFont final : public CachedFont {
38 public:
39  CachedSVGFont(const ResourceRequest&, SessionID);
40 
41  virtual bool ensureCustomFontData(const AtomicString& remoteURI) override;
42 
43  virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&) override;
44 
45 private:
46  FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&);
47 
48  SVGFontElement* getSVGFontById(const String&) const;
49 
50  SVGFontElement* maybeInitializeExternalSVGFontElement(const AtomicString& remoteURI);
51  SVGFontFaceElement* firstFontFace(const AtomicString& remoteURI);
52 
53 #if ENABLE(SVG_OTF_CONVERTER)
54  RefPtr<SharedBuffer> m_convertedFont;
55 #endif
56  RefPtr<SVGDocument> m_externalSVGDocument;
57  SVGFontElement* m_externalSVGFontElement;
58 };
59 
60 }
61 
62 SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedSVGFont, CachedResource::SVGFontResource)
63 
64 #endif
65 
66 #endif

Source/WebCore/loader/cache/MemoryCache.cpp

@@MemoryCache::Statistics MemoryCache::getStatistics()
677677 stats.xslStyleSheets.addResource(*resource);
678678 break;
679679#endif
680 #if ENABLE(SVG_FONTS)
681  case CachedResource::SVGFontResource:
682 #endif
683680 case CachedResource::FontResource:
684681 stats.fonts.addResource(*resource);
685682 break;

Source/WebCore/platform/graphics/FontCache.h

@@private:
118118 | static_cast<unsigned>(description.orientation()) << 2
119119 | static_cast<unsigned>(description.italic()) << 1
120120 | static_cast<unsigned>(description.renderingMode());
121  unsigned second = static_cast<unsigned>(description.variantEastAsianRuby()) << 27
122  | static_cast<unsigned>(description.variantEastAsianWidth()) << 25
123  | static_cast<unsigned>(description.variantEastAsianVariant()) << 22
124  | static_cast<unsigned>(description.variantAlternates()) << 21
125  | static_cast<unsigned>(description.variantNumericSlashedZero()) << 20
126  | static_cast<unsigned>(description.variantNumericOrdinal()) << 19
127  | static_cast<unsigned>(description.variantNumericFraction()) << 17
128  | static_cast<unsigned>(description.variantNumericSpacing()) << 15
129  | static_cast<unsigned>(description.variantNumericFigure()) << 13
130  | static_cast<unsigned>(description.variantCaps()) << 10
131  | static_cast<unsigned>(description.variantPosition()) << 8
132  | static_cast<unsigned>(description.variantContextualAlternates()) << 6
133  | static_cast<unsigned>(description.variantHistoricalLigatures()) << 4
134  | static_cast<unsigned>(description.variantDiscretionaryLigatures()) << 2
135  | static_cast<unsigned>(description.variantCommonLigatures());
 121 unsigned second = description.variantSettings().uniqueValue();
136122 return {{ first, second }};
137123 }
138124

Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp

@@FontCustomPlatformData::~FontCustomPlatformData()
3636
3737FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
3838{
 39 // This function must be consistent with FontFaceSource::HashKey.
3940 int size = fontDescription.computedPixelSize();
4041 FontOrientation orientation = fontDescription.orientation();
4142 FontWidthVariant widthVariant = fontDescription.widthVariant();

Source/WebCore/platform/text/TextFlags.h

2626#ifndef TextFlags_h
2727#define TextFlags_h
2828
 29#include <wtf/Hasher.h>
 30
2931namespace WebCore {
3032
3133enum TextRenderingMode { AutoTextRendering, OptimizeSpeed, OptimizeLegibility, GeometricPrecision };

@@struct FontVariantSettings {
212214 && eastAsianRuby == FontVariantEastAsianRuby::Normal;
213215 }
214216
215  bool operator==(const FontVariantSettings& other)
 217 bool operator==(const FontVariantSettings& other) const
216218 {
217219 return commonLigatures == other.commonLigatures
218220 && discretionaryLigatures == other.discretionaryLigatures

@@struct FontVariantSettings {
231233 && eastAsianRuby == other.eastAsianRuby;
232234 }
233235
 236 // Each combination of these variant features can be uniquely represented by a 32-bit number.
 237 unsigned uniqueValue() const
 238 {
 239 return static_cast<unsigned>(eastAsianRuby) << 27
 240 | static_cast<unsigned>(eastAsianWidth) << 25
 241 | static_cast<unsigned>(eastAsianVariant) << 22
 242 | static_cast<unsigned>(alternates) << 21
 243 | static_cast<unsigned>(numericSlashedZero) << 20
 244 | static_cast<unsigned>(numericOrdinal) << 19
 245 | static_cast<unsigned>(numericFraction) << 17
 246 | static_cast<unsigned>(numericSpacing) << 15
 247 | static_cast<unsigned>(numericFigure) << 13
 248 | static_cast<unsigned>(caps) << 10
 249 | static_cast<unsigned>(position) << 8
 250 | static_cast<unsigned>(contextualAlternates) << 6
 251 | static_cast<unsigned>(historicalLigatures) << 4
 252 | static_cast<unsigned>(discretionaryLigatures) << 2
 253 | static_cast<unsigned>(commonLigatures);
 254 }
 255
 256 unsigned hash() const
 257 {
 258 IntegerHasher hasher;
 259 hasher.add(uniqueValue());
 260 return hasher.hash();
 261 }
 262
234263 FontVariantLigatures commonLigatures;
235264 FontVariantLigatures discretionaryLigatures;
236265 FontVariantLigatures historicalLigatures;

Source/WebCore/svg/SVGAllInOne.cpp

165165#include "SVGTextPathElement.cpp"
166166#include "SVGTextPositioningElement.cpp"
167167#include "SVGTitleElement.cpp"
 168#include "SVGToOTFFontConversion.cpp"
168169#include "SVGTransform.cpp"
169170#include "SVGTransformDistance.cpp"
170171#include "SVGTransformList.cpp"

Source/WebCore/svg/SVGFontData.h

@@private:
5656 bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, bool enableKerning, bool requiresShaping) const = delete;
5757
5858 // Ths SVGFontFaceElement is kept alive --
59  // 1) in the external font case: by the CSSFontFaceSource, which holds a reference to the external SVG document
 59 // 1) in the external font case: by the FontFaceSource, which holds a reference to the external SVG document
6060 // containing the element;
6161 // 2) in the in-document font case: by virtue of being in the document tree and making sure that when it is removed
6262 // from the document, it removes the @font-face rule it owns from the document's mapped element sheet and forces

Source/WebCore/svg/SVGFontFaceUriElement.cpp

@@Node::InsertionNotificationRequest SVGFontFaceUriElement::insertedInto(Container
8787 return SVGElement::insertedInto(rootParent);
8888}
8989
90 static bool isSVGFontTarget(const SVGFontFaceUriElement& element)
91 {
92  Ref<CSSFontFaceSrcValue> srcValue(element.srcValue());
93  return srcValue->isSVGFontTarget();
94 }
95 
9690void SVGFontFaceUriElement::loadFont()
9791{
9892 if (m_cachedFont)

@@void SVGFontFaceUriElement::loadFont()
106100 CachedResourceLoader& cachedResourceLoader = document().cachedResourceLoader();
107101 CachedResourceRequest request(ResourceRequest(document().completeURL(href)), options);
108102 request.setInitiator(this);
109  m_cachedFont = cachedResourceLoader.requestFont(request, isSVGFontTarget(*this));
 103 m_cachedFont = cachedResourceLoader.requestFont(request);
110104 if (m_cachedFont) {
111105 m_cachedFont->addClient(this);
112106 m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);