Source/WebCore/ChangeLog

 12016-01-27 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Font Loading] Implement FontFace JavaScript object
 4 https://bugs.webkit.org/show_bug.cgi?id=153345
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test: fast/text/font-face-javascript.html
 9
 10 * CMakeLists.txt:
 11 * DerivedSources.cpp:
 12 * DerivedSources.make:
 13 * WebCore.vcxproj/WebCore.vcxproj:
 14 * WebCore.vcxproj/WebCore.vcxproj.filters:
 15 * WebCore.xcodeproj/project.pbxproj:
 16 * bindings/js/JSBindingsAllInOne.cpp:
 17 * bindings/js/JSDOMPromise.h:
 18 (WebCore::DeferredWrapper::jsObject):
 19 (WebCore::DOMPromise::jsObject):
 20 (WebCore::DOMPromise::DOMPromise): Deleted.
 21 * bindings/js/JSFontFaceCustom.cpp: Added.
 22 (WebCore::constructJSFontFace):
 23 (WebCore::JSFontFace::loaded):
 24 (WebCore::JSFontFace::load):
 25 * css/ByteBasedFontFaceSource.cpp: Added.
 26 (WebCore::ByteBasedFontFaceSource::ByteBasedFontFaceSource):
 27 (WebCore::ByteBasedFontFaceSource::getSVGFontById):
 28 (WebCore::ByteBasedFontFaceSource::bufferProvided):
 29 (WebCore::ByteBasedFontFaceSource::createFontWithCustomPlatformData):
 30 (WebCore::ByteBasedFontFaceSource::createFont):
 31 * css/ByteBasedFontFaceSource.h: Added.
 32 (WebCore::ByteBasedFontFaceSource::customPlatformData):
 33 * css/CSSAllInOne.cpp:
 34 * css/CSSComputedStyleDeclaration.cpp:
 35 (WebCore::ComputedStyleExtractor::propertyValue):
 36 (WebCore::identifierForFamily): Deleted.
 37 (WebCore::valueForFamily): Deleted.
 38 (WebCore::fontVariantFromStyle): Deleted.
 39 * css/CSSFontFace.cpp: Removed.
 40 (WebCore::CSSFontFace::isValid): Deleted.
 41 (WebCore::CSSFontFace::addedToSegmentedFontFace): Deleted.
 42 (WebCore::CSSFontFace::removedFromSegmentedFontFace): Deleted.
 43 (WebCore::CSSFontFace::addSource): Deleted.
 44 (WebCore::CSSFontFace::fontLoaded): Deleted.
 45 (WebCore::CSSFontFace::font): Deleted.
 46 (WebCore::CSSFontFace::notifyFontLoader): Deleted.
 47 (WebCore::CSSFontFace::notifyLoadingDone): Deleted.
 48 (WebCore::CSSFontFace::hasSVGFontFaceSource): Deleted.
 49 * css/CSSFontFace.h: Removed.
 50 (WebCore::CSSFontFace::create): Deleted.
 51 (WebCore::CSSFontFace::traitsMask): Deleted.
 52 (WebCore::CSSFontFace::addRange): Deleted.
 53 (WebCore::CSSFontFace::ranges): Deleted.
 54 (WebCore::CSSFontFace::insertFeature): Deleted.
 55 (WebCore::CSSFontFace::setVariantCommonLigatures): Deleted.
 56 (WebCore::CSSFontFace::setVariantDiscretionaryLigatures): Deleted.
 57 (WebCore::CSSFontFace::setVariantHistoricalLigatures): Deleted.
 58 (WebCore::CSSFontFace::setVariantContextualAlternates): Deleted.
 59 (WebCore::CSSFontFace::setVariantPosition): Deleted.
 60 (WebCore::CSSFontFace::setVariantCaps): Deleted.
 61 (WebCore::CSSFontFace::setVariantNumericFigure): Deleted.
 62 (WebCore::CSSFontFace::setVariantNumericSpacing): Deleted.
 63 (WebCore::CSSFontFace::setVariantNumericFraction): Deleted.
 64 (WebCore::CSSFontFace::setVariantNumericOrdinal): Deleted.
 65 (WebCore::CSSFontFace::setVariantNumericSlashedZero): Deleted.
 66 (WebCore::CSSFontFace::setVariantAlternates): Deleted.
 67 (WebCore::CSSFontFace::setVariantEastAsianVariant): Deleted.
 68 (WebCore::CSSFontFace::setVariantEastAsianWidth): Deleted.
 69 (WebCore::CSSFontFace::setVariantEastAsianRuby): Deleted.
 70 (WebCore::CSSFontFace::isLocalFallback): Deleted.
 71 (WebCore::CSSFontFace::UnicodeRange::UnicodeRange): Deleted.
 72 (WebCore::CSSFontFace::UnicodeRange::from): Deleted.
 73 (WebCore::CSSFontFace::UnicodeRange::to): Deleted.
 74 (WebCore::CSSFontFace::loadState): Deleted.
 75 (WebCore::CSSFontFace::CSSFontFace): Deleted.
 76 * css/CSSFontFaceSource.cpp: Removed.
 77 (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
 78 (WebCore::CSSFontFaceSource::~CSSFontFaceSource): Deleted.
 79 (WebCore::CSSFontFaceSource::isValid): Deleted.
 80 (WebCore::CSSFontFaceSource::fontLoaded): Deleted.
 81 (WebCore::CSSFontFaceSource::font): Deleted.
 82 (WebCore::CSSFontFaceSource::isSVGFontFaceSource): Deleted.
 83 (WebCore::CSSFontFaceSource::isDecodeError): Deleted.
 84 (WebCore::CSSFontFaceSource::ensureFontData): Deleted.
 85 * css/CSSFontFaceSource.h: Removed.
 86 * css/CSSFontFaceSrcValue.cpp:
 87 (WebCore::CSSFontFaceSrcValue::createCachedFont):
 88 (WebCore::CSSFontFaceSrcValue::cachedFont):
 89 * css/CSSFontFaceSrcValue.h:
 90 * css/CSSFontSelector.cpp:
 91 (WebCore::CSSFontSelector::addSourcesToFontFace):
 92 (WebCore::CSSFontSelector::familyNameFromPrimitive):
 93 (WebCore::registerLocalFontFacesForFamily):
 94 (WebCore::CSSFontSelector::addFontFaceRule):
 95 (WebCore::CSSFontSelector::fontFaceWillChange):
 96 (WebCore::CSSFontSelector::fontLoaded):
 97 (WebCore::FontFaceComparator::operator()):
 98 (WebCore::CSSFontSelector::getFontFace):
 99 (WebCore::createFontFace): Deleted.
 100 (WebCore::familyNameFromPrimitive): Deleted.
 101 * css/CSSFontSelector.h:
 102 * css/CSSSegmentedFontFace.cpp:
 103 (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
 104 (WebCore::CSSSegmentedFontFace::fontLoaded):
 105 (WebCore::CSSSegmentedFontFace::appendFontFace):
 106 (WebCore::appendFontWithInvalidUnicodeRangeIfLoading):
 107 (WebCore::CSSSegmentedFontFace::fontRanges):
 108 (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace): Deleted.
 109 (WebCore::CSSSegmentedFontFace::isLoading): Deleted.
 110 (WebCore::CSSSegmentedFontFace::checkFont): Deleted.
 111 (WebCore::CSSSegmentedFontFace::loadFont): Deleted.
 112 * css/CSSSegmentedFontFace.h:
 113 (WebCore::CSSSegmentedFontFace::fontSelector):
 114 (WebCore::CSSSegmentedFontFace::create): Deleted.
 115 (WebCore::CSSSegmentedFontFace::LoadFontCallback::~LoadFontCallback): Deleted.
 116 * css/DeprecatedInDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 117 (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
 118 (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
 119 (WebCore::InDocumentSVGFontFaceSource::createFont):
 120 * css/DeprecatedInDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 121 * css/DeprecatedRemoteSVGFontFaceSource.cpp: Added.
 122 (WebCore::DeprecatedRemoteSVGFontFaceSource::DeprecatedRemoteSVGFontFaceSource):
 123 (WebCore::DeprecatedRemoteSVGFontFaceSource::bufferProvided):
 124 (WebCore::DeprecatedRemoteSVGFontFaceSource::createFont):
 125 * css/DeprecatedRemoteSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 126 * css/FontFace.cpp: Added.
 127 (WebCore::valueFromDictionary):
 128 (WebCore::stringOr):
 129 (WebCore::createPromise):
 130 (WebCore::FontFace::FontFace):
 131 (WebCore::FontFace::~FontFace):
 132 (WebCore::FontFace::canSuspendForDocumentSuspension):
 133 (WebCore::FontFace::addSource):
 134 (WebCore::FontFace::allSourcesHaveFailed):
 135 (WebCore::FontFace::status):
 136 (WebCore::FontFace::family):
 137 (WebCore::FontFace::setFamily):
 138 (WebCore::FontFace::style):
 139 (WebCore::FontFace::setStyle):
 140 (WebCore::FontFace::weight):
 141 (WebCore::FontFace::setWeight):
 142 (WebCore::FontFace::stretch):
 143 (WebCore::FontFace::setStretch):
 144 (WebCore::FontFace::unicodeRange):
 145 (WebCore::FontFace::setUnicodeRange):
 146 (WebCore::FontFace::variant):
 147 (WebCore::FontFace::setVariant):
 148 (WebCore::FontFace::featureSettings):
 149 (WebCore::FontFace::setFeatureSettings):
 150 (WebCore::FontFace::pump):
 151 (WebCore::FontFace::load):
 152 (WebCore::FontFace::kick):
 153 (WebCore::FontFace::font):
 154 (WebCore::FontFace::resolvePromise):
 155 (WebCore::FontFace::rejectPromise):
 156 * css/FontFace.h: Added.
 157 * css/FontFace.idl: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 158 * css/FontFaceSource.cpp: Added.
 159 (WebCore::FontFaceSource::HashKey::HashKey):
 160 (WebCore::FontFaceSource::HashKey::isHashTableDeletedValue):
 161 (WebCore::FontFaceSource::HashKey::operator==):
 162 (WebCore::FontFaceSource::HashKey::operator!=):
 163 (WebCore::FontFaceSource::HashKey::hash):
 164 (WebCore::FontFaceSource::HashKey::equal):
 165 (WebCore::FontFaceSource::FontFaceSource):
 166 (WebCore::FontFaceSource::load):
 167 (WebCore::FontFaceSource::font):
 168 * css/FontFaceSource.h: Added.
 169 (WebCore::FontFaceSource::~FontFaceSource):
 170 (WebCore::FontFaceSource::state):
 171 (WebCore::FontFaceSource::owner):
 172 (WebCore::FontFaceSource::setState):
 173 (WebCore::FontFaceSource::shouldCache):
 174 * css/FontLoader.cpp:
 175 * css/FontVariantBuilder.cpp: Added.
 176 (WebCore::computeFontVariant):
 177 * css/FontVariantBuilder.h:
 178 (WebCore::applyValueFontVariantLigatures):
 179 (WebCore::applyValueFontVariantNumeric):
 180 (WebCore::applyValueFontVariantEastAsian):
 181 (WebCore::identifierForFamily):
 182 (WebCore::valueForFamily):
 183 * css/ImmediateFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 184 * css/InDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 185 (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
 186 (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
 187 * css/InDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 188 * css/LocalFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 189 (WebCore::LocalFontFaceSource::LocalFontFaceSource):
 190 (WebCore::LocalFontFaceSource::initiateLoad):
 191 (WebCore::LocalFontFaceSource::createFont):
 192 * css/LocalFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 193 * css/RemoteFontFaceSource.cpp: Added.
 194 (WebCore::RemoteFontFaceSource::RemoteFontFaceSource):
 195 (WebCore::RemoteFontFaceSource::~RemoteFontFaceSource):
 196 (WebCore::RemoteFontFaceSource::initiateLoad):
 197 (WebCore::OwnerKicker::OwnerKicker):
 198 (WebCore::OwnerKicker::~OwnerKicker):
 199 (WebCore::RemoteFontFaceSource::kickOwner):
 200 (WebCore::RemoteFontFaceSource::fontLoaded):
 201 (WebCore::RemoteFontFaceSource::createFont):
 202 * css/RemoteFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
 203 * css/RuleSet.cpp:
 204 (WebCore::RuleSet::addChildRules):
 205 * css/StyleBuilderCustom.h:
 206 (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
 207 (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
 208 (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
 209 * css/StyleResolver.cpp:
 210 (WebCore::StyleResolver::StyleResolver):
 211 * inspector/InspectorPageAgent.cpp:
 212 (WebCore::InspectorPageAgent::cachedResourceType): Deleted.
 213 (WebCore::cachedResourcesForFrame): Deleted.
 214 * loader/ResourceLoadInfo.cpp:
 215 (WebCore::toResourceType): Deleted.
 216 * loader/SubresourceLoader.cpp:
 217 (WebCore::logResourceLoaded): Deleted.
 218 * loader/cache/CachedFont.cpp:
 219 (WebCore::CachedFont::didAddClient):
 220 (WebCore::CachedFont::checkNotify):
 221 (WebCore::CachedFont::ensureCustomFontData): Deleted.
 222 (WebCore::CachedFont::createFont): Deleted.
 223 (WebCore::CachedFont::platformDataFromCustomData): Deleted.
 224 * loader/cache/CachedFont.h:
 225 (WebCore::CachedFont::hasCreatedFontDataWrappingResource):
 226 (WebCore::CachedFont::setCustomPlatformData):
 227 (WebCore::CachedFont::customPlatformData):
 228 * loader/cache/CachedFontClient.h:
 229 (WebCore::CachedFontClient::fontLoaded):
 230 * loader/cache/CachedResource.cpp:
 231 (WebCore::defaultPriorityForResourceType): Deleted.
 232 * loader/cache/CachedResource.h:
 233 * loader/cache/CachedResourceLoader.cpp:
 234 (WebCore::CachedResourceLoader::requestFont):
 235 (WebCore::createResource): Deleted.
 236 (WebCore::contentTypeFromResourceType): Deleted.
 237 (WebCore::CachedResourceLoader::checkInsecureContent): Deleted.
 238 (WebCore::CachedResourceLoader::canRequest): Deleted.
 239 * loader/cache/CachedResourceLoader.h:
 240 * loader/cache/CachedSVGFont.cpp: Removed.
 241 (WebCore::CachedSVGFont::CachedSVGFont): Deleted.
 242 (WebCore::CachedSVGFont::createFont): Deleted.
 243 (WebCore::CachedSVGFont::platformDataFromCustomData): Deleted.
 244 (WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
 245 (WebCore::CachedSVGFont::getSVGFontById): Deleted.
 246 (WebCore::CachedSVGFont::maybeInitializeExternalSVGFontElement): Deleted.
 247 (WebCore::CachedSVGFont::firstFontFace): Deleted.
 248 * loader/cache/CachedSVGFont.h: Removed.
 249 * loader/cache/MemoryCache.cpp:
 250 (WebCore::MemoryCache::getStatistics): Deleted.
 251 * platform/graphics/FontCache.h:
 252 (WebCore::FontDescriptionKey::makeFlagsKey):
 253 * platform/graphics/mac/FontCustomPlatformData.cpp:
 254 (WebCore::FontCustomPlatformData::fontPlatformData):
 255 * platform/text/TextFlags.h:
 256 (WebCore::FontVariantSettings::operator==):
 257 (WebCore::FontVariantSettings::uniqueValue):
 258 (WebCore::FontVariantSettings::hash):
 259 * svg/SVGAllInOne.cpp:
 260 * svg/SVGFontData.h:
 261 * svg/SVGFontFaceUriElement.cpp:
 262 (WebCore::SVGFontFaceUriElement::loadFont):
 263 (WebCore::isSVGFontTarget): Deleted.
 264
12652016-01-27 Ryosuke Niwa <rniwa@webkit.org>
2266
3267 Add API to access closed shadowRoot in InjectedBundle

Source/WebKit2/ChangeLog

 12016-01-27 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Font Loading] Implement FontFace JavaScript object
 4 https://bugs.webkit.org/show_bug.cgi?id=153345
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * WebProcess/Network/WebLoaderStrategy.cpp:
 9 (WebKit::maximumBufferingTime): Deleted.
 10
1112016-01-27 Ryosuke Niwa <rniwa@webkit.org>
212
313 Add API to access closed shadowRoot in InjectedBundle

Source/WebCore/CMakeLists.txt

@@set(WebCore_NON_SVG_IDL_FILES
336336 css/CSSValueList.idl
337337 css/Counter.idl
338338 css/DOMWindowCSS.idl
 339 css/FontFace.idl
339340 css/FontLoader.idl
340341 css/MediaList.idl
341342 css/MediaQueryList.idl

@@set(WebCore_SOURCES
11601161 bindings/js/JSEventTargetCustom.cpp
11611162 bindings/js/JSExceptionBase.cpp
11621163 bindings/js/JSFileReaderCustom.cpp
 1164 bindings/js/JSFontFaceCustom.cpp
11631165 bindings/js/JSGeolocationCustom.cpp
11641166 bindings/js/JSHTMLAllCollectionCustom.cpp
11651167 bindings/js/JSHTMLAppletElementCustom.cpp

@@set(WebCore_SOURCES
12871289 contentextensions/URLFilterParser.cpp
12881290
12891291 css/BasicShapeFunctions.cpp
 1292 css/ByteBasedFontFaceSource.cpp
12901293 css/CSSAspectRatioValue.cpp
12911294 css/CSSBasicShapes.cpp
12921295 css/CSSBorderImage.cpp

@@set(WebCore_SOURCES
13031306 css/CSSFontFace.cpp
13041307 css/CSSFontFaceLoadEvent.cpp
13051308 css/CSSFontFaceRule.cpp
1306  css/CSSFontFaceSource.cpp
13071309 css/CSSFontFaceSrcValue.cpp
13081310 css/CSSFontFeatureValue.cpp
13091311 css/CSSFontSelector.cpp

@@set(WebCore_SOURCES
13521354 css/CSSValuePool.cpp
13531355 css/CSSVariableDependentValue.cpp
13541356 css/CSSVariableValue.cpp
 1357 css/DeprecatedInDocumentSVGFontFaceSource.cpp
 1358 css/DeprecatedRemoteSVGFontFaceSource.cpp
13551359 css/DOMWindowCSS.cpp
13561360 css/DocumentRuleSets.cpp
13571361 css/ElementRuleCollector.cpp
 1362 css/FontFace.cpp
 1363 css/FontFaceSource.cpp
13581364 css/FontLoader.cpp
 1365 css/InDocumentSVGFontFaceSource.cpp
13591366 css/InspectorCSSOMWrappers.cpp
13601367 css/LengthFunctions.cpp
 1368 css/LocalFontFaceSource.cpp
13611369 css/MediaFeatureNames.cpp
13621370 css/MediaList.cpp
13631371 css/MediaQuery.cpp

@@set(WebCore_SOURCES
13681376 css/PageRuleCollector.cpp
13691377 css/PropertySetCSSStyleDeclaration.cpp
13701378 css/RGBColor.cpp
 1379 css/RemoteFontFaceSource.cpp
13711380 css/RuleFeature.cpp
13721381 css/RuleSet.cpp
13731382 css/SVGCSSComputedStyleDeclaration.cpp

@@set(WebCore_SOURCES
19671976 loader/cache/CachedResourceRequestInitiators.cpp
19681977 loader/cache/CachedSVGDocument.cpp
19691978 loader/cache/CachedSVGDocumentReference.cpp
1970  loader/cache/CachedSVGFont.cpp
19711979 loader/cache/CachedScript.cpp
19721980 loader/cache/CachedXSLStyleSheet.cpp
19731981 loader/cache/MemoryCache.cpp

@@set(WebCore_SOURCES
27712779 svg/SVGTextPathElement.cpp
27722780 svg/SVGTextPositioningElement.cpp
27732781 svg/SVGTitleElement.cpp
 2782 svg/SVGToOTFFontConversion.cpp
27742783 svg/SVGTransform.cpp
27752784 svg/SVGTransformDistance.cpp
27762785 svg/SVGTransformList.cpp

Source/WebCore/DerivedSources.cpp

162162#include "JSFileReader.cpp"
163163#include "JSFileReaderSync.cpp"
164164#include "JSFocusEvent.cpp"
 165#include "JSFontFace.cpp"
165166#if ENABLE(FONT_LOAD_EVENTS)
166167#include "JSFontLoader.cpp"
167168#endif

Source/WebCore/DerivedSources.make

@@NON_SVG_BINDING_IDLS = \
239239 $(WebCore)/css/CSSValueList.idl \
240240 $(WebCore)/css/Counter.idl \
241241 $(WebCore)/css/DOMWindowCSS.idl \
 242 $(WebCore)/css/FontFace.idl \
242243 $(WebCore)/css/FontLoader.idl \
243244 $(WebCore)/css/MediaList.idl \
244245 $(WebCore)/css/MediaQueryList.idl \

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

19851985 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
19861986 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
19871987 </ClCompile>
 1988 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontFace.cpp">
 1989 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 1990 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 1991 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 1992 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 1993 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 1994 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 1995 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 1996 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 1997 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 1998 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 1999 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 2000 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 2001 </ClCompile>
19882002 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontLoader.cpp">
19892003 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
19902004 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

75037517 <ClCompile Include="..\loader\archive\mhtml\MHTMLParser.cpp" />
75047518 <ClCompile Include="..\loader\cache\CachedCSSStyleSheet.cpp" />
75057519 <ClCompile Include="..\loader\cache\CachedFont.cpp" />
7506  <ClCompile Include="..\loader\cache\CachedSVGFont.cpp" />
75077520 <ClCompile Include="..\loader\cache\CachedImage.cpp" />
75087521 <ClCompile Include="..\loader\cache\CachedRawResource.cpp" />
75097522 <ClCompile Include="..\loader\cache\CachedResource.cpp" />

82808293 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
82818294 </ClCompile>
82828295 <ClCompile Include="..\svg\graphics\SVGImageForContainer.cpp" />
8283  <ClCompile Include="..\svg\SVGToOTFFontConversion.cpp" />
82848296 <ClCompile Include="..\WebCorePrefix.cpp">
82858297 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
82868298 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>

96379649 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
96389650 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
96399651 </ClCompile>
9640  <ClCompile Include="..\css\CSSFontFaceSource.cpp">
 9652 <ClCompile Include="..\css\FontFaceSource.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\LocalFontFaceSource.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\ByteBasedFontFaceSource.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\RemoteFontFaceSource.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\InDocumentSVGFontFaceSource.cpp">
 9709 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9710 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9711 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9712 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9713 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9714 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9715 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9716 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9717 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9718 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9719 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9720 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9721 </ClCompile>
 9722 <ClCompile Include="..\css\DeprecatedInDocumentSVGFontFaceSource.cpp">
 9723 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 9724 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 9725 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 9726 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 9727 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 9728 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 9729 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 9730 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 9731 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 9732 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 9733 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 9734 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 9735 </ClCompile>
 9736 <ClCompile Include="..\css\DeprecatedRemoteSVGFontFaceSource.cpp">
96419737 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
96429738 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
96439739 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>

1025410350 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1025510351 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1025610352 </ClCompile>
 10353 <ClCompile Include="..\css\FontFace.cpp">
 10354 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 10355 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 10356 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 10357 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 10358 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 10359 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 10360 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 10361 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 10362 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 10363 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 10364 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 10365 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 10366 </ClCompile>
1025710367 <ClCompile Include="..\css\FontLoader.cpp">
1025810368 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
1025910369 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

1817318283 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1817418284 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1817518285 </ClCompile>
 18286 <ClCompile Include="..\bindings\js\JSFontFaceCustom.cpp">
 18287 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 18288 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 18289 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 18290 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 18291 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 18292 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 18293 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 18294 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 18295 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 18296 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 18297 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 18298 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 18299 </ClCompile>
1817618300 <ClCompile Include="..\bindings\js\JSFileReaderCustom.cpp">
1817718301 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
1817818302 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

1913119255 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1913219256 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1913319257 </ClCompile>
 19258 <ClCompile Include="..\svg\SVGToOTFFontConversion.cpp">
 19259 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 19260 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 19261 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 19262 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 19263 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 19264 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 19265 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 19266 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 19267 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 19268 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 19269 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 19270 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 19271 </ClCompile>
1913419272 <ClCompile Include="..\svg\SVGGlyphElement.cpp">
1913519273 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
1913619274 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

1992620064 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFileList.h" />
1992720065 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFileReader.h" />
1992820066 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFileReaderSync.h" />
 20067 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontFace.h" />
1992920068 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontLoader.h" />
1993020069 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSGamepad.h" />
1993120070 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSGamepadButton.h" />

2085820997 <ClInclude Include="..\loader\archive\mhtml\MHTMLParser.h" />
2085920998 <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h" />
2086020999 <ClInclude Include="..\loader\cache\CachedFont.h" />
20861  <ClInclude Include="..\loader\cache\CachedSVGFont.h" />
2086221000 <ClInclude Include="..\loader\cache\CachedImage.h" />
2086321001 <ClInclude Include="..\loader\cache\CachedRawResource.h" />
2086421002 <ClInclude Include="..\loader\cache\CachedRawResourceClient.h" />

2164321781 <ClInclude Include="..\css\CSSFontFace.h" />
2164421782 <ClInclude Include="..\css\CSSFontFaceLoadEvent.h" />
2164521783 <ClInclude Include="..\css\CSSFontFaceRule.h" />
21646  <ClInclude Include="..\css\CSSFontFaceSource.h" />
 21784 <ClInclude Include="..\css\FontFaceSource.h" />
 21785 <ClInclude Include="..\css\LocalFontFaceSource.h" />
 21786 <ClInclude Include="..\css\ByteBasedFontFaceSource.h" />
 21787 <ClInclude Include="..\css\RemoteFontFaceSource.h" />
 21788 <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h" />
 21789 <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h" />
 21790 <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h" />
 21791 <ClInclude Include="..\css\ImmediateFontFaceSource.h" />
2164721792 <ClInclude Include="..\css\CSSFontFaceSrcValue.h" />
2164821793 <ClInclude Include="..\css\CSSFontFeatureValue.h" />
2164921794 <ClInclude Include="..\css\CSSFontSelector.h" />

2169421839 <ClInclude Include="..\css\CSSVariableDependentValue.h" />
2169521840 <ClInclude Include="..\css\CSSVariableValue.h" />
2169621841 <ClInclude Include="..\css\DashboardRegion.h" />
 21842 <ClInclude Include="..\css\FontFace.h" />
2169721843 <ClInclude Include="..\css\FontLoader.h" />
2169821844 <ClInclude Include="..\css\LengthFunctions.h" />
2169921845 <ClInclude Include="..\css\LengthRepeat.h" />

2263422780 <ClInclude Include="..\svg\SVGForeignObjectElement.h" />
2263522781 <ClInclude Include="..\svg\SVGGElement.h" />
2263622782 <ClInclude Include="..\svg\SVGGlyphElement.h" />
 22783 <ClInclude Include="..\svg\SVGToOTFFontConversion.h" />
2263722784 <ClInclude Include="..\svg\SVGGlyphMap.h" />
2263822785 <ClInclude Include="..\svg\SVGGlyphRefElement.h" />
2263922786 <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">

22162231 <ClCompile Include="..\css\CSSVariableValue.cpp">
22172232 <Filter>css</Filter>
22182233 </ClCompile>
 2234 <ClCompile Include="..\css\FontFace.cpp">
 2235 <Filter>css</Filter>
 2236 </ClCompile>
22192237 <ClCompile Include="..\css\FontLoader.cpp">
22202238 <Filter>css</Filter>
22212239 </ClCompile>

48864904 <ClCompile Include="..\bindings\js\JSExceptionBase.cpp">
48874905 <Filter>bindings\js</Filter>
48884906 </ClCompile>
 4907 <ClCompile Include="..\bindings\js\JSFontFaceCustom.cpp">
 4908 <Filter>bindings\js</Filter>
 4909 </ClCompile>
48894910 <ClCompile Include="..\bindings\js\JSFileReaderCustom.cpp">
48904911 <Filter>bindings\js</Filter>
48914912 </ClCompile>

52655286 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFileReaderSync.cpp">
52665287 <Filter>DerivedSources</Filter>
52675288 </ClCompile>
 5289 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontFace.cpp">
 5290 <Filter>DerivedSources</Filter>
 5291 </ClCompile>
52685292 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontLoader.cpp">
52695293 <Filter>DerivedSources</Filter>
52705294 </ClCompile>

80298053 <ClInclude Include="..\loader\cache\CachedCSSStyleSheet.h">
80308054 <Filter>loader\cache</Filter>
80318055 </ClInclude>
8032  <ClInclude Include="..\loader\cache\CachedSVGFont.h">
8033  <Filter>loader\cache</Filter>
8034  </ClInclude>
80358056 <ClInclude Include="..\loader\cache\CachedFont.h">
80368057 <Filter>loader\cache</Filter>
80378058 </ClInclude>

90559076 <ClInclude Include="..\css\CSSFontFaceRule.h">
90569077 <Filter>css</Filter>
90579078 </ClInclude>
9058  <ClInclude Include="..\css\CSSFontFaceSource.h">
 9079 <ClInclude Include="..\css\FontFaceSource.h">
 9080 <Filter>css</Filter>
 9081 </ClInclude>
 9082 <ClInclude Include="..\css\LocalFontFaceSource.h">
 9083 <Filter>css</Filter>
 9084 </ClInclude>
 9085 <ClInclude Include="..\css\ByteBasedFontFaceSource.h">
 9086 <Filter>css</Filter>
 9087 </ClInclude>
 9088 <ClInclude Include="..\css\RemoteFontFaceSource.h">
 9089 <Filter>css</Filter>
 9090 </ClInclude>
 9091 <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h">
 9092 <Filter>css</Filter>
 9093 </ClInclude>
 9094 <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h">
 9095 <Filter>css</Filter>
 9096 </ClInclude>
 9097 <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h">
 9098 <Filter>css</Filter>
 9099 </ClInclude>
 9100 <ClInclude Include="..\css\ImmediateFontFaceSource.h">
90599101 <Filter>css</Filter>
90609102 </ClInclude>
90619103 <ClInclude Include="..\css\CSSFontFaceSrcValue.h">

92029244 <ClInclude Include="..\css\DashboardRegion.h">
92039245 <Filter>css</Filter>
92049246 </ClInclude>
 9247 <ClInclude Include="..\css\FontFace.h">
 9248 <Filter>css</Filter>
 9249 </ClInclude>
92059250 <ClInclude Include="..\css\FontLoader.h">
92069251 <Filter>css</Filter>
92079252 </ClInclude>

1268412729 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFileReaderSync.h">
1268512730 <Filter>DerivedSources</Filter>
1268612731 </ClInclude>
 12732 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontFace.h">
 12733 <Filter>DerivedSources</Filter>
 12734 </ClInclude>
1268712735 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSFontLoader.h">
1268812736 <Filter>DerivedSources</Filter>
1268912737 </ClInclude>

1480514853 <ClInclude Include="..\svg\SVGFETurbulenceElement.h">
1480614854 <Filter>svg</Filter>
1480714855 </ClInclude>
 14856 <ClInclude Include="..\svg\SVGToOTFFontConversion.h">
 14857 <Filter>svg</Filter>
 14858 </ClInclude>
1480814859 <ClInclude Include="..\svg\SVGGlyphElement.h">
1480914860 <Filter>svg</Filter>
1481014861 </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 */; };

946944 1C11CCC80AA6093700DADB20 /* DOMHTMLElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85DF2EEB0AA387CB00AD64C5 /* DOMHTMLElement.h */; };
947945 1C18DA58181AF6A500C4EF22 /* TextPainter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */; };
948946 1C18DA59181AF6A500C4EF22 /* TextPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C18DA57181AF6A500C4EF22 /* TextPainter.h */; };
 947 1C1927531C589CB200515C06 /* FontVariantBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C1927521C589CB200515C06 /* FontVariantBuilder.cpp */; };
949948 1C21E57C183ED1FF001C289D /* IOSurfacePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */; };
950949 1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C21E57B183ED1FF001C289D /* IOSurfacePool.h */; settings = {ATTRIBUTES = (Private, ); }; };
951950 1C2417BA1992C04100EF9938 /* SpellingDot@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C2417B91992C04100EF9938 /* SpellingDot@3x.png */; };

55675566 BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */; };
55685567 BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4C90CB4295D005F2B62 /* CachedFont.cpp */; };
55695568 BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CA0CB4295D005F2B62 /* CachedFont.h */; };
5570  BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */; };
5571  BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */; };
5572  BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */; };
5573  BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */; };
55745569 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */; };
55755570 BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */; };
55765571 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */; };

58835878 C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
58845879 C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
58855880 C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */; };
 5881 C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */; };
 5882 C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */; };
 5883 C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */; };
 5884 C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */; };
 5885 C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */; };
 5886 C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */; };
 5887 C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */; };
 5888 C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */; };
 5889 C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */; };
 5890 C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */; };
 5891 C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */; };
 5892 C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */; };
 5893 C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */; };
 5894 C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */; };
 5895 C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */; };
 5896 C2DE6C3D1C51D91700D774D3 /* JSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DE6C3C1C51D8FA00D774D3 /* JSFontFace.h */; };
 5897 C2DE6C3E1C51D91B00D774D3 /* JSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DE6C3B1C51D8FA00D774D3 /* JSFontFace.cpp */; };
 5898 C2DE6C401C51DB2000D774D3 /* FontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DE6C3F1C51DB0D00D774D3 /* FontFace.h */; };
 5899 C2DE6C421C51DB4100D774D3 /* FontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DE6C411C51DB4100D774D3 /* FontFace.cpp */; };
 5900 C2DE6C441C51E4A500D774D3 /* JSFontFaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DE6C431C51E4A500D774D3 /* JSFontFaceCustom.cpp */; };
58865901 C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
58875902 C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
58885903 C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };

83088323 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
83098324 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = "<group>"; };
83108325 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = "<group>"; };
8311  1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
8312  1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = "<group>"; };
83138326 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = "<group>"; };
83148327 1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
 8328 1C1927521C589CB200515C06 /* FontVariantBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontVariantBuilder.cpp; sourceTree = "<group>"; };
83158329 1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IOSurfacePool.cpp; sourceTree = "<group>"; };
83168330 1C21E57B183ED1FF001C289D /* IOSurfacePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurfacePool.h; sourceTree = "<group>"; };
83178331 1C2417B91992C04100EF9938 /* SpellingDot@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SpellingDot@3x.png"; sourceTree = "<group>"; };

1338713401 BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringMapCustom.cpp; sourceTree = "<group>"; };
1338813402 BC64B4C90CB4295D005F2B62 /* CachedFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedFont.cpp; sourceTree = "<group>"; };
1338913403 BC64B4CA0CB4295D005F2B62 /* CachedFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFont.h; sourceTree = "<group>"; };
13390  BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFace.cpp; sourceTree = "<group>"; };
13391  BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFace.h; sourceTree = "<group>"; };
13392  BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSource.cpp; sourceTree = "<group>"; };
13393  BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSource.h; sourceTree = "<group>"; };
1339413404 BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSrcValue.cpp; sourceTree = "<group>"; };
1339513405 BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSrcValue.h; sourceTree = "<group>"; };
1339613406 BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontSelector.cpp; sourceTree = "<group>"; };

1373813748 C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
1373913749 C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontVariantBuilder.h; sourceTree = "<group>"; };
1374013750 C24685131A148E1800811792 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
 13751 C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedInDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13752 C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedInDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
 13753 C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedRemoteSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13754 C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedRemoteSVGFontFaceSource.h; sourceTree = "<group>"; };
1374113755 C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
 13756 C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFaceSource.cpp; sourceTree = "<group>"; };
 13757 C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFaceSource.h; sourceTree = "<group>"; };
 13758 C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalFontFaceSource.cpp; sourceTree = "<group>"; };
 13759 C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalFontFaceSource.h; sourceTree = "<group>"; };
 13760 C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteBasedFontFaceSource.cpp; sourceTree = "<group>"; };
 13761 C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteBasedFontFaceSource.h; sourceTree = "<group>"; };
 13762 C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteFontFaceSource.cpp; sourceTree = "<group>"; };
 13763 C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteFontFaceSource.h; sourceTree = "<group>"; };
 13764 C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmediateFontFaceSource.h; sourceTree = "<group>"; };
 13765 C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
 13766 C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
 13767 C2DE6C3A1C51D59000D774D3 /* FontFace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FontFace.idl; sourceTree = "<group>"; };
 13768 C2DE6C3B1C51D8FA00D774D3 /* JSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFace.cpp; sourceTree = "<group>"; };
 13769 C2DE6C3C1C51D8FA00D774D3 /* JSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFontFace.h; sourceTree = "<group>"; };
 13770 C2DE6C3F1C51DB0D00D774D3 /* FontFace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontFace.h; sourceTree = "<group>"; };
 13771 C2DE6C411C51DB4100D774D3 /* FontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFace.cpp; sourceTree = "<group>"; };
 13772 C2DE6C431C51E4A500D774D3 /* JSFontFaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceCustom.cpp; sourceTree = "<group>"; };
1374213773 C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
1374313774 C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
1374413775 C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };

1741717448 656580EC09D12B20000E61D7 /* Derived Sources */ = {
1741817449 isa = PBXGroup;
1741917450 children = (
 17451 C2DE6C3B1C51D8FA00D774D3 /* JSFontFace.cpp */,
 17452 C2DE6C3C1C51D8FA00D774D3 /* JSFontFace.h */,
1742017453 9908B0F31BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltins.cpp */,
1742117454 9908B0F51BCAD07D00ED0F65 /* ByteLengthQueuingStrategyBuiltins.h */,
1742217455 656581AC09D14EE6000E61D7 /* CharsetData.cpp */,

2085720890 1AEF4E68170E174800AB2799 /* CachedSVGDocumentClient.h */,
2085820891 E1B533461717D0A000F205F9 /* CachedSVGDocumentReference.cpp */,
2085920892 FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */,
20860  1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */,
20861  1C0939E91A13E12900B788E5 /* CachedSVGFont.h */,
2086220893 0753860014489E9800B78452 /* CachedTextTrack.cpp */,
2086320894 0753860114489E9800B78452 /* CachedTextTrack.h */,
2086420895 BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */,

2231122342 BC348BBD0DB7F531004ABAB9 /* JSXMLHttpRequestCustom.cpp */,
2231222343 A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */,
2231322344 BCEFE1E40DCA5F3300739219 /* JSXSLTProcessorCustom.cpp */,
 22345 C2DE6C431C51E4A500D774D3 /* JSFontFaceCustom.cpp */,
2231422346 );
2231522347 name = Custom;
2231622348 sourceTree = "<group>";

2332823360 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */,
2332923361 FB965B8217BBB62C00E835B9 /* CSSFilterImageValue.cpp */,
2333023362 FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */,
23331  BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */,
23332  BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */,
2333323363 409EBDAC16B7EE1C00CBA3FC /* CSSFontFaceLoadEvent.cpp */,
2333423364 409EBDAE16B7EE2800CBA3FC /* CSSFontFaceLoadEvent.h */,
2333523365 409EBDAF16B7EE5700CBA3FC /* CSSFontFaceLoadEvent.idl */,
2333623366 A80E6CBD0A1989CA007FB8C5 /* CSSFontFaceRule.cpp */,
2333723367 A80E6CD30A1989CA007FB8C5 /* CSSFontFaceRule.h */,
2333823368 85C56CA30AA89CA400D95755 /* CSSFontFaceRule.idl */,
23339  BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */,
23340  BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */,
2334123369 BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */,
2334223370 BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */,
2334323371 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */,

2357923607 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
2358023608 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
2358123609 3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
 23610 C2DE6C3A1C51D59000D774D3 /* FontFace.idl */,
 23611 C2DE6C3F1C51DB0D00D774D3 /* FontFace.h */,
 23612 C2DE6C411C51DB4100D774D3 /* FontFace.cpp */,
 23613 C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */,
 23614 C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */,
 23615 C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */,
 23616 C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */,
 23617 C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */,
 23618 C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */,
 23619 C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */,
 23620 C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */,
 23621 C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */,
 23622 C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */,
 23623 C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */,
 23624 C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */,
 23625 C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */,
 23626 C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */,
 23627 C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */,
 23628 1C1927521C589CB200515C06 /* FontVariantBuilder.cpp */,
2358223629 );
2358323630 path = css;
2358423631 sourceTree = "<group>";

2488624933 A104F24414C71F7A009E2C23 /* CachedSVGDocument.h in Headers */,
2488724934 1AEF4E69170E174800AB2799 /* CachedSVGDocumentClient.h in Headers */,
2488824935 FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */,
24889  1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */,
2489024936 0753860314489E9800B78452 /* CachedTextTrack.h in Headers */,
2489124937 BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
2489224938 93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,

2490724953 2E3C8C621BFBA97500309566 /* CaptureDeviceManager.h in Headers */,
2490824954 99CC0B4F18BE9849006CEBCC /* CapturingInputCursor.h in Headers */,
2490924955 CDC734151977896D0046BFC5 /* CARingBuffer.h in Headers */,
 24956 C2DE6C401C51DB2000D774D3 /* FontFace.h in Headers */,
2491024957 6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
2491124958 CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */,
2491224959 CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */,

2495024997 C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
2495124998 F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
2495224999 EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
 25000 C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */,
2495325001 9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
2495425002 BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
2495525003 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,

2507225120 BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */,
2507325121 4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */,
2507425122 FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */,
25075  BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */,
2507625123 409EBDB116B7EE7100CBA3FC /* CSSFontFaceLoadEvent.h in Headers */,
2507725124 A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */,
25078  BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */,
2507925125 BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */,
2508025126 83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
2508125127 4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */,

2559525641 858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
2559625642 85E9E0A10AB3A0C700069CD0 /* DOMXPathExpression.h in Headers */,
2559725643 85E711DA0AC5D5350053270F /* DOMXPathExpressionInternal.h in Headers */,
 25644 C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */,
2559825645 85E9E0A40AB3A0C700069CD0 /* DOMXPathNSResolver.h in Headers */,
2559925646 85E9E0A50AB3A0C700069CD0 /* DOMXPathResult.h in Headers */,
2560025647 85E711DB0AC5D5350053270F /* DOMXPathResultInternal.h in Headers */,

2579225839 0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */,
2579325840 46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */,
2579425841 9746AF2A14F4DDE6003E7A70 /* Geoposition.h in Headers */,
 25842 C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */,
2579525843 086BBD0F136039C2008B15D8 /* Glyph.h in Headers */,
2579625844 B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
2579725845 C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,

2605326101 510192D618B6B9B7007FC7A1 /* ImageControlsRootElement.h in Headers */,
2605426102 510192D218B6B9AB007FC7A1 /* ImageControlsRootElementMac.h in Headers */,
2605526103 A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
 26104 C2DE6C3D1C51D91700D774D3 /* JSFontFace.h in Headers */,
2605626105 97205AB61239291000B17380 /* ImageDocument.h in Headers */,
2605726106 F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
2605826107 089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,

2644026489 8A9A588811E84F37008ACFD1 /* JSPerformanceTiming.h in Headers */,
2644126490 FDEA6247152102FC00479DF0 /* JSPeriodicWave.h in Headers */,
2644226491 93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */,
 26492 C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */,
2644326493 5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */,
2644426494 598365DD1355F557001B185D /* JSPositionCallback.h in Headers */,
2644526495 FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */,

2659526645 B2FA3DBB0AB75A6F000E5AC4 /* JSSVGPathSegArcRel.h in Headers */,
2659626646 B2FA3DBD0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.h in Headers */,
2659726647 B2FA3DBF0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.h in Headers */,
 26648 C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */,
2659826649 B2FA3DC10AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.h in Headers */,
2659926650 B2FA3DC30AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
2660026651 B2FA3DC50AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.h in Headers */,

2737827429 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
2737927430 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
2738027431 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
 27432 C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */,
2738127433 26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */,
2738227434 514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
2738327435 514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,

2756427616 E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */,
2756527617 582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */,
2756627618 C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
 27619 C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */,
2756727620 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */,
2756827621 FD00D7A514A3F61900734011 /* SincResampler.h in Headers */,
2756927622 51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */,

2817528228 E180810F16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.h in Headers */,
2817628229 E152551516FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.h in Headers */,
2817728230 93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
 28231 C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */,
2817828232 A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */,
2817928233 A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */,
2818028234 A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */,

2874628800 29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
2874728801 BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
2874828802 BCA8CA5F11E4E6D100812FB7 /* BackForwardList.cpp in Sources */,
 28803 C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */,
2874928804 BC124EE70C2641CD009E2349 /* BarProp.cpp in Sources */,
2875028805 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
2875128806 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,

2878428839 1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */,
2878528840 1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
2878628841 1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
 28842 C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */,
2878728843 1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
2878828844 BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
2878928845 BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,

2879928855 BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
2880028856 A104F24314C71F7A009E2C23 /* CachedSVGDocument.cpp in Sources */,
2880128857 E1B533471717D0A100F205F9 /* CachedSVGDocumentReference.cpp in Sources */,
28802  1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
2880328858 0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */,
2880428859 BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
2880528860 E43AF8E61AC5B7E800CA717E /* CacheValidation.cpp in Sources */,

2895529010 AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */,
2895629011 4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */,
2895729012 FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
28958  BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
2895929013 409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
2896029014 A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
28961  BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */,
2896229015 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
2896329016 4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
2896429017 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,

2927729330 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
2927829331 3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
2927929332 8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
 29333 C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */,
2928029334 31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
2928129335 85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
2928229336 1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,

2941029464 1C3969D01B74211E002BCFA7 /* FontCacheCoreText.cpp in Sources */,
2941129465 3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */,
2941229466 B2AFFC7C0D00A5C10030074D /* FontCacheMac.mm in Sources */,
 29467 C2DE6C441C51E4A500D774D3 /* JSFontFaceCustom.cpp in Sources */,
2941329468 B2C3DA600D006CD600EF6F26 /* FontCascade.cpp in Sources */,
2941429469 B2AFFC800D00A5C10030074D /* FontCascadeCocoa.mm in Sources */,
2941529470 B2C3DA670D006CD600EF6F26 /* FontCascadeFonts.cpp in Sources */,

2943129486 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */,
2943229487 A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
2943329488 7EE6846612D26E3800E79415 /* FormDataStreamCFNet.cpp in Sources */,
 29489 C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */,
2943429490 514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
2943529491 656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
2943629492 41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,

2959829654 A871DB300A150BD600B12A68 /* HTMLTableRowElement.cpp in Sources */,
2959929655 93442CA00D2B336000338FF9 /* HTMLTableRowsCollection.cpp in Sources */,
2960029656 A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */,
 29657 1C1927531C589CB200515C06 /* FontVariantBuilder.cpp in Sources */,
2960129658 D66817FA166FE6D700FA07B4 /* HTMLTemplateElement.cpp in Sources */,
2960229659 A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */,
2960329660 9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */,

2965929716 5185FCA31BB4C4E80012898F /* IDBOpenDBRequest.cpp in Sources */,
2966029717 5103105A1BA8DB56003329C0 /* IDBOpenDBRequestImpl.cpp in Sources */,
2966129718 51F41A7B1BA73B5B002E053B /* IDBPendingTransactionMonitor.cpp in Sources */,
 29719 C2DE6C3E1C51D91B00D774D3 /* JSFontFace.cpp in Sources */,
2966229720 5185FCA81BB4C4E80012898F /* IDBRequest.cpp in Sources */,
2966329721 510A58F91BACC7F200C19282 /* IDBRequestData.cpp in Sources */,
2966429722 5103105C1BA8DB56003329C0 /* IDBRequestImpl.cpp in Sources */,

3001630074 1AE2AEC70A1D297B00B42B25 /* JSHTMLQuoteElement.cpp in Sources */,
3001730075 1AE2ABAC0A1CE90500B42B25 /* JSHTMLScriptElement.cpp in Sources */,
3001830076 E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */,
 30077 C2DE6C421C51DB4100D774D3 /* FontFace.cpp in Sources */,
3001930078 BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */,
3002030079 9B69D3B81B99100700E3512B /* JSHTMLSlotElement.cpp in Sources */,
3002130080 E446143B0CD689CC00FADA75 /* JSHTMLSourceElement.cpp in Sources */,

3020830267 1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
3020930268 B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
3021030269 51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
 30270 C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */,
3021130271 51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
3021230272 51E0BAEA0DA55D4A00A9E417 /* JSStorageEvent.cpp in Sources */,
3021330273 0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,

3065130711 F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
3065230712 85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
3065330713 93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
 30714 C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */,
3065430715 85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
3065530716 93309DFB099E64920056E581 /* MoveSelectionCommand.cpp in Sources */,
3065630717 FDB1700514A2BAB200A2B5D9 /* MultiChannelResampler.cpp in Sources */,

3157531636 46DB7D571B20FE46005651B2 /* VNodeTrackerCocoa.cpp in Sources */,
3157631637 BE20507918A458680080647E /* VTTCue.cpp in Sources */,
3157731638 7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
 31639 C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */,
3157831640 7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
3157931641 7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */,
3158031642 A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,

Source/WebCore/bindings/js/JSBindingsAllInOne.cpp

7878#include "JSEventTargetCustom.cpp"
7979#include "JSExceptionBase.cpp"
8080#include "JSFileReaderCustom.cpp"
 81#include "JSFontFaceCustom.cpp"
8182#include "JSGeolocationCustom.cpp"
8283#include "JSHTMLAllCollectionCustom.cpp"
8384#include "JSHTMLAppletElementCustom.cpp"

Source/WebCore/bindings/js/JSDOMPromise.h

3131#include <runtime/JSPromiseDeferred.h>
3232#include <wtf/Optional.h>
3333
 34namespace JSC {
 35class JSObject;
 36}
 37
3438namespace WebCore {
3539
3640class DeferredWrapper {

@@public:
4549
4650 JSDOMGlobalObject& globalObject() const;
4751
 52 JSC::JSObject* jsObject() const { return m_deferred.get()->promise(); }
 53
4854private:
4955 void callFunction(JSC::ExecState&, JSC::JSValue function, JSC::JSValue resolution);
5056 void resolve(JSC::ExecState& state, JSC::JSValue resolution) { callFunction(state, m_deferred->resolve(), resolution); }

@@template <typename Value, typename Error>
7177class DOMPromise {
7278public:
7379 DOMPromise(DeferredWrapper&& wrapper) : m_wrapper(WTFMove(wrapper)) { }
74  DOMPromise(DOMPromise&& promise) : m_wrapper(WTFMove(promise.m_wrapper)) { }
75 
76  DOMPromise(const DOMPromise&)= delete;
77  DOMPromise& operator=(DOMPromise const&) = delete;
7880
7981 void resolve(const Value& value) { m_wrapper.resolve<Value>(value); }
8082 void reject(const Error& error) { m_wrapper.reject<Error>(error); }
8183
 84 JSC::JSObject* jsObject() const { return m_wrapper.jsObject(); }
 85
8286private:
8387 DeferredWrapper m_wrapper;
8488};

Source/WebCore/bindings/js/JSFontFaceCustom.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 "JSFontFace.h"
 28
 29#include "JSDOMConstructor.h"
 30
 31namespace WebCore {
 32
 33JSC::EncodedJSValue JSC_HOST_CALL constructJSFontFace(JSC::ExecState* state)
 34{
 35 auto* castedThis = JSC::jsCast<JSDOMConstructor<JSFontFace>*>(state->callee());
 36
 37 // For now, we only support constructing these in a Document context (not a worker).
 38 if (!castedThis->scriptExecutionContext()->isDocument())
 39 return throwVMError(state, createError(state, String("Cannot be run from a worker", String::ConstructFromLiteral)));
 40 Document& document = *downcast<Document>(castedThis->scriptExecutionContext());
 41
 42 if (UNLIKELY(state->argumentCount() < 3))
 43 return throwVMError(state, createNotEnoughArgumentsError(state));
 44 String family = state->argument(0).toString(state)->value(state);
 45 if (UNLIKELY(state->hadException()))
 46 return JSC::JSValue::encode(JSC::jsUndefined());
 47 Dictionary descriptors = { state, state->argument(2) };
 48 if (UNLIKELY(state->hadException()))
 49 return JSC::JSValue::encode(JSC::jsUndefined());
 50
 51 //FontFace::Promise promise(DeferredWrapper(state, castedThis->globalObject(), JSC::JSPromiseDeferred::create(state, castedThis->globalObject())));
 52 const auto& argument1 = state->argument(1);
 53 RefPtr<FontFace> object;
 54 if (argument1.isString()) {
 55 String source = argument1.toString(state)->value(state);
 56 object = FontFace::create(document, family, source, descriptors);
 57 } else if (argument1.isCell()) {
 58 const auto& cell = *argument1.asCell();
 59 if (cell.inherits(JSC::JSArrayBuffer::info())) {
 60 if (ArrayBuffer* data = toArrayBuffer(argument1))
 61 object = FontFace::create(document, family, data->data(), data->byteLength(), descriptors);
 62 } else if (cell.inherits(JSC::JSArrayBufferView::info())) {
 63 if (auto* wrapper = JSC::jsDynamicCast<JSC::JSArrayBufferView*>(argument1)) {
 64 if (RefPtr<JSC::ArrayBufferView> data = wrapper->impl())
 65 object = FontFace::create(document, family, data->baseAddress(), data->byteLength(), descriptors);
 66 }
 67 }
 68 }
 69
 70 if (!object) {
 71 throwTypeError(state);
 72 return JSC::JSValue::encode(JSC::jsUndefined());
 73 }
 74
 75 return JSC::JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 76}
 77
 78JSC::JSValue JSFontFace::loaded(JSC::ExecState&) const
 79{
 80 return wrapped().promise().jsObject();
 81}
 82
 83JSC::JSValue JSFontFace::load(JSC::ExecState&)
 84{
 85 FontFace& fontFace = wrapped();
 86 fontFace.load();
 87 return fontFace.promise().jsObject();
 88}
 89
 90}

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(FontFace& 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(FontFace& 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 "FontFace.cpp"
 99#include "FontFaceSource.cpp"
96100#include "FontLoader.cpp"
 101#include "InDocumentSVGFontFaceSource.cpp"
97102#include "InspectorCSSOMWrappers.cpp"
98103#include "LengthFunctions.cpp"
 104#include "LocalFontFaceSource.cpp"
99105#include "MediaList.cpp"
100106#include "MediaQuery.cpp"
101107#include "MediaQueryEvaluator.cpp"

105111#include "PageRuleCollector.cpp"
106112#include "PropertySetCSSStyleDeclaration.cpp"
107113#include "RGBColor.cpp"
 114#include "RemoteFontFaceSource.cpp"
108115#include "RuleFeature.cpp"
109116#include "RuleSet.cpp"
110117#include "SVGCSSComputedStyleDeclaration.cpp"

Source/WebCore/css/CSSComputedStyleDeclaration.cpp

5353#include "Document.h"
5454#include "ExceptionCode.h"
5555#include "FontFeatureSettings.h"
 56#include "FontVariantBuilder.h"
5657#include "HTMLFrameOwnerElement.h"
5758#include "Pair.h"
5859#include "PseudoElement.h"

@@bool ComputedStyleExtractor::useFixedFontDefaultSize() const
15931594 return style->fontDescription().useFixedDefaultSize();
15941595}
15951596
1596 
1597 static CSSValueID identifierForFamily(const AtomicString& family)
1598 {
1599  if (family == cursiveFamily)
1600  return CSSValueCursive;
1601  if (family == fantasyFamily)
1602  return CSSValueFantasy;
1603  if (family == monospaceFamily)
1604  return CSSValueMonospace;
1605  if (family == pictographFamily)
1606  return CSSValueWebkitPictograph;
1607  if (family == sansSerifFamily)
1608  return CSSValueSansSerif;
1609  if (family == serifFamily)
1610  return CSSValueSerif;
1611  return CSSValueInvalid;
1612 }
1613 
1614 static Ref<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
1615 {
1616  if (CSSValueID familyIdentifier = identifierForFamily(family))
1617  return CSSValuePool::singleton().createIdentifierValue(familyIdentifier);
1618  return CSSValuePool::singleton().createFontFamilyValue(family);
1619 }
1620 
16211597static Ref<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration)
16221598{
16231599 auto& cssValuePool = CSSValuePool::singleton();

@@static Ref<CSSPrimitiveValue> fontStyleFromStyle(RenderStyle* style)
18231799 return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
18241800}
18251801
1826 static Ref<CSSValue> fontVariantFromStyle(RenderStyle* style)
1827 {
1828  if (style->fontDescription().variantSettings().isAllNormal())
1829  return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
1830 
1831  auto list = CSSValueList::createSpaceSeparated();
1832 
1833  switch (style->fontDescription().variantCommonLigatures()) {
1834  case FontVariantLigatures::Normal:
1835  break;
1836  case FontVariantLigatures::Yes:
1837  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueCommonLigatures));
1838  break;
1839  case FontVariantLigatures::No:
1840  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoCommonLigatures));
1841  break;
1842  }
1843 
1844  switch (style->fontDescription().variantDiscretionaryLigatures()) {
1845  case FontVariantLigatures::Normal:
1846  break;
1847  case FontVariantLigatures::Yes:
1848  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiscretionaryLigatures));
1849  break;
1850  case FontVariantLigatures::No:
1851  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoDiscretionaryLigatures));
1852  break;
1853  }
1854 
1855  switch (style->fontDescription().variantHistoricalLigatures()) {
1856  case FontVariantLigatures::Normal:
1857  break;
1858  case FontVariantLigatures::Yes:
1859  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalLigatures));
1860  break;
1861  case FontVariantLigatures::No:
1862  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoHistoricalLigatures));
1863  break;
1864  }
1865 
1866  switch (style->fontDescription().variantContextualAlternates()) {
1867  case FontVariantLigatures::Normal:
1868  break;
1869  case FontVariantLigatures::Yes:
1870  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueContextual));
1871  break;
1872  case FontVariantLigatures::No:
1873  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoContextual));
1874  break;
1875  }
1876 
1877  switch (style->fontDescription().variantPosition()) {
1878  case FontVariantPosition::Normal:
1879  break;
1880  case FontVariantPosition::Subscript:
1881  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSub));
1882  break;
1883  case FontVariantPosition::Superscript:
1884  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSuper));
1885  break;
1886  }
1887 
1888  switch (style->fontDescription().variantCaps()) {
1889  case FontVariantCaps::Normal:
1890  break;
1891  case FontVariantCaps::Small:
1892  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
1893  break;
1894  case FontVariantCaps::AllSmall:
1895  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllSmallCaps));
1896  break;
1897  case FontVariantCaps::Petite:
1898  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValuePetiteCaps));
1899  break;
1900  case FontVariantCaps::AllPetite:
1901  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllPetiteCaps));
1902  break;
1903  case FontVariantCaps::Unicase:
1904  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueUnicase));
1905  break;
1906  case FontVariantCaps::Titling:
1907  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTitlingCaps));
1908  break;
1909  }
1910 
1911  switch (style->fontDescription().variantNumericFigure()) {
1912  case FontVariantNumericFigure::Normal:
1913  break;
1914  case FontVariantNumericFigure::LiningNumbers:
1915  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueLiningNums));
1916  break;
1917  case FontVariantNumericFigure::OldStyleNumbers:
1918  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOldstyleNums));
1919  break;
1920  }
1921 
1922  switch (style->fontDescription().variantNumericSpacing()) {
1923  case FontVariantNumericSpacing::Normal:
1924  break;
1925  case FontVariantNumericSpacing::ProportionalNumbers:
1926  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalNums));
1927  break;
1928  case FontVariantNumericSpacing::TabularNumbers:
1929  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTabularNums));
1930  break;
1931  }
1932 
1933  switch (style->fontDescription().variantNumericFraction()) {
1934  case FontVariantNumericFraction::Normal:
1935  break;
1936  case FontVariantNumericFraction::DiagonalFractions:
1937  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiagonalFractions));
1938  break;
1939  case FontVariantNumericFraction::StackedFractions:
1940  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueStackedFractions));
1941  break;
1942  }
1943 
1944  switch (style->fontDescription().variantNumericOrdinal()) {
1945  case FontVariantNumericOrdinal::Normal:
1946  break;
1947  case FontVariantNumericOrdinal::Yes:
1948  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOrdinal));
1949  break;
1950  }
1951 
1952  switch (style->fontDescription().variantNumericSlashedZero()) {
1953  case FontVariantNumericSlashedZero::Normal:
1954  break;
1955  case FontVariantNumericSlashedZero::Yes:
1956  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSlashedZero));
1957  break;
1958  }
1959 
1960  switch (style->fontDescription().variantAlternates()) {
1961  case FontVariantAlternates::Normal:
1962  break;
1963  case FontVariantAlternates::HistoricalForms:
1964  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalForms));
1965  break;
1966  }
1967 
1968  switch (style->fontDescription().variantEastAsianVariant()) {
1969  case FontVariantEastAsianVariant::Normal:
1970  break;
1971  case FontVariantEastAsianVariant::Jis78:
1972  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis78));
1973  break;
1974  case FontVariantEastAsianVariant::Jis83:
1975  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis83));
1976  break;
1977  case FontVariantEastAsianVariant::Jis90:
1978  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis90));
1979  break;
1980  case FontVariantEastAsianVariant::Jis04:
1981  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis04));
1982  break;
1983  case FontVariantEastAsianVariant::Simplified:
1984  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSimplified));
1985  break;
1986  case FontVariantEastAsianVariant::Traditional:
1987  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTraditional));
1988  break;
1989  }
1990 
1991  switch (style->fontDescription().variantEastAsianWidth()) {
1992  case FontVariantEastAsianWidth::Normal:
1993  break;
1994  case FontVariantEastAsianWidth::Full:
1995  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueFullWidth));
1996  break;
1997  case FontVariantEastAsianWidth::Proportional:
1998  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalWidth));
1999  break;
2000  }
2001 
2002  switch (style->fontDescription().variantEastAsianRuby()) {
2003  case FontVariantEastAsianRuby::Normal:
2004  break;
2005  case FontVariantEastAsianRuby::Yes:
2006  list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueRuby));
2007  break;
2008  }
2009 
2010  return WTFMove(list);
2011 }
2012 
20131802static Ref<CSSPrimitiveValue> fontWeightFromStyle(RenderStyle* style)
20141803{
20151804 switch (style->fontDescription().weight()) {

@@RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID,
27212510 case CSSPropertyFontStyle:
27222511 return fontStyleFromStyle(style.get());
27232512 case CSSPropertyFontVariant:
2724  return fontVariantFromStyle(style.get());
 2513 return computeFontVariant(style->fontDescription().variantSettings());
27252514 case CSSPropertyFontWeight:
27262515 return fontWeightFromStyle(style.get());
27272516 case CSSPropertyFontSynthesis:

Source/WebCore/css/CSSFontFace.cpp

1 /*
2  * Copyright (C) 2007, 2008, 2011, 2013 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 "CSSFontFace.h"
28 
29 #include "CSSFontFaceSource.h"
30 #include "CSSFontSelector.h"
31 #include "CSSSegmentedFontFace.h"
32 #include "Document.h"
33 #include "Font.h"
34 #include "FontDescription.h"
35 #include "FontLoader.h"
36 #include "RuntimeEnabledFeatures.h"
37 
38 namespace WebCore {
39 
40 bool CSSFontFace::isValid() const
41 {
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;
46  }
47  return false;
48 }
49 
50 void CSSFontFace::addedToSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
51 {
52  m_segmentedFontFaces.add(segmentedFontFace);
53 }
54 
55 void CSSFontFace::removedFromSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
56 {
57  m_segmentedFontFaces.remove(segmentedFontFace);
58 }
59 
60 void CSSFontFace::addSource(std::unique_ptr<CSSFontFaceSource> source)
61 {
62  source->setFontFace(this);
63  m_sources.append(WTFMove(source));
64 }
65 
66 void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
67 {
68  if (source != m_activeSource)
69  return;
70 
71  // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may
72  // require stopping in-progress font loading when the last
73  // CSSSegmentedFontFace is removed.
74  if (m_segmentedFontFaces.isEmpty())
75  return;
76 
77  // Use one of the CSSSegmentedFontFaces' font selector. They all have
78  // the same font selector, so it's wasteful to store it in the CSSFontFace.
79  CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
80  fontSelector->fontLoaded();
81 
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 
91  for (auto* face : m_segmentedFontFaces)
92  face->fontLoaded(this);
93 
94 #if ENABLE(FONT_LOAD_EVENTS)
95  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
96  notifyLoadingDone();
97 #endif
98 }
99 
100 RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic)
101 {
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();
125  }
126  }
127 
128 #if ENABLE(FONT_LOAD_EVENTS)
129  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading) {
130  notifyFontLoader(Error);
131  notifyLoadingDone();
132  }
133 #endif
134  return nullptr;
135 }
136 
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 
181 }

Source/WebCore/css/CSSFontFace.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 CSSFontFace_h
27 #define CSSFontFace_h
28 
29 #include "CSSFontFaceRule.h"
30 #include "CSSFontFaceSource.h"
31 #include "FontFeatureSettings.h"
32 #include "TextFlags.h"
33 #include <memory>
34 #include <wtf/Forward.h>
35 #include <wtf/HashSet.h>
36 #include <wtf/PassRefPtr.h>
37 #include <wtf/RefCounted.h>
38 #include <wtf/Vector.h>
39 
40 namespace WebCore {
41 
42 class CSSSegmentedFontFace;
43 class FontDescription;
44 class Font;
45 
46 class CSSFontFace : public RefCounted<CSSFontFace> {
47 public:
48  static Ref<CSSFontFace> create(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback = false) { return adoptRef(*new CSSFontFace(traitsMask, WTFMove(rule), isLocalFallback)); }
49 
50  FontTraitsMask traitsMask() const { return m_traitsMask; }
51 
52  struct UnicodeRange;
53 
54  void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); }
55  const Vector<UnicodeRange>& ranges() const { return m_ranges; }
56 
57  void insertFeature(FontFeature&& feature) { m_featureSettings.insert(WTFMove(feature)); }
58 
59  void setVariantCommonLigatures(FontVariantLigatures ligatures) { m_variantSettings.commonLigatures = ligatures; }
60  void setVariantDiscretionaryLigatures(FontVariantLigatures ligatures) { m_variantSettings.discretionaryLigatures = ligatures; }
61  void setVariantHistoricalLigatures(FontVariantLigatures ligatures) { m_variantSettings.historicalLigatures = ligatures; }
62  void setVariantContextualAlternates(FontVariantLigatures ligatures) { m_variantSettings.contextualAlternates = ligatures; }
63  void setVariantPosition(FontVariantPosition position) { m_variantSettings.position = position; }
64  void setVariantCaps(FontVariantCaps caps) { m_variantSettings.caps = caps; }
65  void setVariantNumericFigure(FontVariantNumericFigure figure) { m_variantSettings.numericFigure = figure; }
66  void setVariantNumericSpacing(FontVariantNumericSpacing spacing) { m_variantSettings.numericSpacing = spacing; }
67  void setVariantNumericFraction(FontVariantNumericFraction fraction) { m_variantSettings.numericFraction = fraction; }
68  void setVariantNumericOrdinal(FontVariantNumericOrdinal ordinal) { m_variantSettings.numericOrdinal = ordinal; }
69  void setVariantNumericSlashedZero(FontVariantNumericSlashedZero slashedZero) { m_variantSettings.numericSlashedZero = slashedZero; }
70  void setVariantAlternates(FontVariantAlternates alternates) { m_variantSettings.alternates = alternates; }
71  void setVariantEastAsianVariant(FontVariantEastAsianVariant variant) { m_variantSettings.eastAsianVariant = variant; }
72  void setVariantEastAsianWidth(FontVariantEastAsianWidth width) { m_variantSettings.eastAsianWidth = width; }
73  void setVariantEastAsianRuby(FontVariantEastAsianRuby ruby) { m_variantSettings.eastAsianRuby = ruby; }
74 
75  void addedToSegmentedFontFace(CSSSegmentedFontFace*);
76  void removedFromSegmentedFontFace(CSSSegmentedFontFace*);
77 
78  bool isValid() const;
79 
80  bool isLocalFallback() const { return m_isLocalFallback; }
81 
82  void addSource(std::unique_ptr<CSSFontFaceSource>);
83 
84  void fontLoaded(CSSFontFaceSource*);
85 
86  RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic);
87 
88  struct UnicodeRange {
89  UnicodeRange(UChar32 from, UChar32 to)
90  : m_from(from)
91  , m_to(to)
92  {
93  }
94 
95  UChar32 from() const { return m_from; }
96  UChar32 to() const { return m_to; }
97 
98  private:
99  UChar32 m_from;
100  UChar32 m_to;
101  };
102 
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 
112 private:
113  CSSFontFace(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback)
114  : m_traitsMask(traitsMask)
115  , m_activeSource(0)
116  , m_isLocalFallback(isLocalFallback)
117 #if ENABLE(FONT_LOAD_EVENTS)
118  , m_loadState(isLocalFallback ? Loaded : NotLoaded)
119  , m_rule(rule)
120 #endif
121  {
122  UNUSED_PARAM(rule);
123  }
124 
125  FontTraitsMask m_traitsMask;
126  Vector<UnicodeRange> m_ranges;
127  HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces;
128  FontFeatureSettings m_featureSettings;
129  FontVariantSettings m_variantSettings;
130  Vector<std::unique_ptr<CSSFontFaceSource>> m_sources;
131  CSSFontFaceSource* m_activeSource;
132  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
139 };
140 
141 }
142 
143 #endif

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)
 101CachedResourceHandle<CachedFont> CSSFontFaceSrcValue::createCachedFont(Document& document, const String& url, bool isInitiatingElementInUserAgentShadowTree)
102102{
103  if (m_cachedFont)
104  return m_cachedFont.get();
105 
106103 ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
107104 options.setContentSecurityPolicyImposition(isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
108105
109  CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options);
 106 CachedResourceRequest request(ResourceRequest(document.completeURL(url)), options);
110107 request.setInitiator(cachedResourceRequestInitiators().css);
111  m_cachedFont = document->cachedResourceLoader().requestFont(request, isSVG);
 108 return document.cachedResourceLoader().requestFont(request);
 109}
 110
 111CachedFont* CSSFontFaceSrcValue::cachedFont(Document& document, bool isInitiatingElementInUserAgentShadowTree)
 112{
 113 if (!m_cachedFont)
 114 m_cachedFont = createCachedFont(document, m_resource, isInitiatingElementInUserAgentShadowTree);
112115 return m_cachedFont.get();
113116}
114117

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
 77 static CachedResourceHandle<CachedFont> createCachedFont(Document& document, const String& url, bool isInitiatingElementInUserAgentShadowTree = false);
 78
7779private:
7880 CSSFontFaceSrcValue(const String& resource, bool local)
7981 : CSSValue(FontFaceSrcClass)

Source/WebCore/css/CSSFontSelector.cpp

2727#include "config.h"
2828#include "CSSFontSelector.h"
2929
30 #include "CachedFont.h"
31 #include "CSSFontFace.h"
3230#include "CSSFontFaceRule.h"
33 #include "CSSFontFaceSource.h"
3431#include "CSSFontFaceSrcValue.h"
3532#include "CSSFontFamily.h"
3633#include "CSSFontFeatureValue.h"

4138#include "CSSUnicodeRangeValue.h"
4239#include "CSSValueKeywords.h"
4340#include "CSSValueList.h"
 41#include "CachedFont.h"
4442#include "CachedResourceLoader.h"
 43#include "DeprecatedInDocumentSVGFontFaceSource.h"
 44#include "DeprecatedRemoteSVGFontFaceSource.h"
4545#include "Document.h"
4646#include "Font.h"
4747#include "FontCache.h"
 48#include "FontFace.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)
 159void CSSFontSelector::addSourcesToFontFace(FontFace& fontFace, CSSValueList& srcList, bool isInitiatingElementInUserAgentShadowTree)
156160{
157  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
165  Ref<CSSFontFace> fontFace = CSSFontFace::create(traitsMask, WTFMove(rule));
166 
167  int srcLength = srcList.length();
168 
169  bool foundSVGFont = false;
170 
171  for (int i = 0; i < srcLength; i++) {
 161 for (Ref<CSSValue>& value : srcList) {
172162 // An item in the list either specifies a string (local font name) or a URL (remote font to download).
173  CSSFontFaceSrcValue& item = downcast<CSSFontFaceSrcValue>(*srcList.itemWithoutBoundsCheck(i));
174  std::unique_ptr<CSSFontFaceSource> source;
 163 CSSFontFaceSrcValue& item = downcast<CSSFontFaceSrcValue>(value.get());
175164
 165 bool foundSVGFont = false;
176166#if ENABLE(SVG_FONTS)
177167 foundSVGFont = item.isSVGFontFaceSrc() || item.svgFontFaceElement();
178168#endif
179169 if (!item.isLocal()) {
180  Settings* settings = document ? document->settings() : nullptr;
 170 Settings* settings = document()->settings();
181171 bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
182  if (allowDownloading && item.isSupportedFormat() && document) {
183  if (CachedFont* cachedFont = item.cachedFont(document, foundSVGFont, isInitiatingElementInUserAgentShadowTree))
184  source = std::make_unique<CSSFontFaceSource>(item.resource(), cachedFont);
 172 if (allowDownloading && item.isSupportedFormat()) {
 173 if (CachedFont* cachedFont = item.cachedFont(*document(), isInitiatingElementInUserAgentShadowTree)) {
 174#if ENABLE(SVG_FONTS) && !ENABLE(SVG_OTF_CONVERTER)
 175 if (foundSVGFont)
 176 fontFace.addSource(std::make_unique<DeprecatedRemoteSVGFontFaceSource>(fontFace, *this, *cachedFont, item.resource()));
 177 else
 178#endif
 179 fontFace.addSource(std::make_unique<RemoteFontFaceSource>(fontFace, *this, *cachedFont, item.resource()));
 180 }
185181 }
186  } else
187  source = std::make_unique<CSSFontFaceSource>(item.resource());
188 
189  if (source) {
 182 } else {
190183#if ENABLE(SVG_FONTS)
191  source->setSVGFontFaceElement(item.svgFontFaceElement());
 184 if (auto* fontFaceElement = item.svgFontFaceElement())
 185 fontFace.addSource(std::make_unique<InDocumentSVGFontFaceSource>(fontFace, *fontFaceElement, item.resource()));
 186 else
192187#endif
193  fontFace->addSource(WTFMove(source));
 188 fontFace.addSource(std::make_unique<LocalFontFaceSource>(fontFace, item.resource()));
194189 }
195190 }
196 
197  return fontFace;
198191}
199192
200 static String familyNameFromPrimitive(const CSSPrimitiveValue& value)
 193String CSSFontSelector::familyNameFromPrimitive(const CSSPrimitiveValue& value)
201194{
202195 if (value.isFontFamily())
203196 return value.fontFamily().familyName;

@@static String familyNameFromPrimitive(const CSSPrimitiveValue& value)
224217 }
225218}
226219
227 static void registerLocalFontFacesForFamily(const String& familyName, HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash>& locallyInstalledFontFaces)
 220static void registerLocalFontFacesForFamily(Document& document, const String& familyName, HashMap<String, Vector<Ref<FontFace>>, CaseFoldingHash>& locallyInstalledFontFaces)
228221{
229222 ASSERT(!locallyInstalledFontFaces.contains(familyName));
230223

@@static void registerLocalFontFacesForFamily(const String& familyName, HashMap<St
232225 if (traitsMasks.isEmpty())
233226 return;
234227
235  Vector<Ref<CSSFontFace>> faces = { };
 228 Vector<Ref<FontFace>> faces = { };
236229 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());
 230 Ref<FontFace> face = FontFace::create(document, mask, true);
 231 face->addSource(std::make_unique<LocalFontFaceSource>(face, familyName));
 232 ASSERT(!face->allSourcesHaveFailed());
240233 faces.append(WTFMove(face));
241234 }
242235 locallyInstalledFontFaces.add(familyName, WTFMove(faces));
243236}
244237
245 void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, bool isInitiatingElementInUserAgentShadowTree)
 238void CSSFontSelector::addFontFaceRule(const StyleProperties& style, bool isInitiatingElementInUserAgentShadowTree)
246239{
247  const StyleProperties& style = fontFaceRule.properties();
 240 if (!document())
 241 return;
 242
248243 RefPtr<CSSValue> fontFamily = style.getPropertyCSSValue(CSSPropertyFontFamily);
249244 RefPtr<CSSValue> src = style.getPropertyCSSValue(CSSPropertySrc);
250245 RefPtr<CSSValue> unicodeRange = style.getPropertyCSSValue(CSSPropertyUnicodeRange);

@@void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo
273268 return;
274269 auto traitsMask = computedTraitsMask.value();
275270
276  Ref<CSSFontFace> fontFace = createFontFace(srcList, traitsMask, m_document, fontFaceRule, isInitiatingElementInUserAgentShadowTree);
277  if (!fontFace->isValid())
 271 Ref<FontFace> fontFace = FontFace::create(*document(), traitsMask);
 272 addSourcesToFontFace(fontFace.get(), srcList, isInitiatingElementInUserAgentShadowTree);
 273 if (fontFace->allSourcesHaveFailed())
278274 return;
279275
280276 if (rangeList) {
281  unsigned numRanges = rangeList->length();
282  for (unsigned i = 0; i < numRanges; i++) {
283  CSSUnicodeRangeValue& range = downcast<CSSUnicodeRangeValue>(*rangeList->itemWithoutBoundsCheck(i));
 277 for (auto& rangeItem : *rangeList) {
 278 CSSUnicodeRangeValue& range = downcast<CSSUnicodeRangeValue>(rangeItem.get());
284279 fontFace->addRange(range.from(), range.to());
285280 }
286281 }

@@void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo
292287 }
293288 }
294289
295  if (variantLigatures)
296  applyValueFontVariantLigatures(fontFace.get(), *variantLigatures);
 290 if (variantLigatures) {
 291 applyValueFontVariantLigatures(*variantLigatures, [&](FontVariantLigatures common, FontVariantLigatures discretionary, FontVariantLigatures historical, FontVariantLigatures contextualAlternates) {
 292 fontFace->setVariantCommonLigatures(common);
 293 fontFace->setVariantDiscretionaryLigatures(discretionary);
 294 fontFace->setVariantHistoricalLigatures(historical);
 295 fontFace->setVariantContextualAlternates(contextualAlternates);
 296 });
 297 }
297298
298299 if (variantPosition && is<CSSPrimitiveValue>(*variantPosition))
299300 fontFace->setVariantPosition(downcast<CSSPrimitiveValue>(*variantPosition));

@@void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo
301302 if (variantCaps && is<CSSPrimitiveValue>(*variantCaps))
302303 fontFace->setVariantCaps(downcast<CSSPrimitiveValue>(*variantCaps));
303304
304  if (variantNumeric)
305  applyValueFontVariantNumeric(fontFace.get(), *variantNumeric);
 305 if (variantNumeric) {
 306 applyValueFontVariantNumeric(*variantNumeric, [&](FontVariantNumericFigure figure, FontVariantNumericSpacing spacing, FontVariantNumericFraction fraction, FontVariantNumericOrdinal ordinal, FontVariantNumericSlashedZero slashedZero) {
 307 fontFace->setVariantNumericFigure(figure);
 308 fontFace->setVariantNumericSpacing(spacing);
 309 fontFace->setVariantNumericFraction(fraction);
 310 fontFace->setVariantNumericOrdinal(ordinal);
 311 fontFace->setVariantNumericSlashedZero(slashedZero);
 312 });
 313 }
306314
307315 if (variantAlternates && is<CSSPrimitiveValue>(*variantAlternates))
308316 fontFace->setVariantAlternates(downcast<CSSPrimitiveValue>(*variantAlternates));
309317
310  if (variantEastAsian)
311  applyValueFontVariantEastAsian(fontFace.get(), *variantEastAsian);
 318 if (variantEastAsian) {
 319 applyValueFontVariantEastAsian(*variantEastAsian, [&](FontVariantEastAsianVariant variant, FontVariantEastAsianWidth width, FontVariantEastAsianRuby ruby) {
 320 fontFace->setVariantEastAsianVariant(variant);
 321 fontFace->setVariantEastAsianWidth(width);
 322 fontFace->setVariantEastAsianRuby(ruby);
 323 });
 324 }
312325
313326 for (auto& item : familyList) {
314327 String familyName = familyNameFromPrimitive(downcast<CSSPrimitiveValue>(item.get()));
315328 if (familyName.isEmpty())
316329 continue;
317330
318  auto addResult = m_fontFaces.add(familyName, Vector<Ref<CSSFontFace>>());
 331 auto addResult = m_fontFaces.add(familyName, Vector<Ref<FontFace>>());
319332 auto& familyFontFaces = addResult.iterator->value;
320333 if (addResult.isNewEntry) {
321  registerLocalFontFacesForFamily(familyName, m_locallyInstalledFontFaces);
 334 registerLocalFontFacesForFamily(*document(), familyName, m_locallyInstalledFontFaces);
322335 familyFontFaces = { };
323336 }
324337

@@void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo
328341 }
329342}
330343
 344void CSSFontSelector::fontFaceWillChange(FontFace&)
 345{
 346 // FIXME: Implement this.
 347}
 348
331349void CSSFontSelector::registerForInvalidationCallbacks(FontSelectorClient& client)
332350{
333351 m_clients.add(&client);

@@void CSSFontSelector::dispatchInvalidationCallbacks()
348366 clients[i]->fontsNeedUpdate(*this);
349367}
350368
351 void CSSFontSelector::fontLoaded()
 369void CSSFontSelector::fontLoaded(FontFace& fontFace)
352370{
 371 for (const String& family : fontFace.families()) {
 372 auto iterator = m_fonts.find(family);
 373 if (iterator != m_fonts.end()) {
 374 for (auto& segmentedFont : iterator->value)
 375 segmentedFont.value->fontLoaded(fontFace);
 376 }
 377 }
 378
353379 dispatchInvalidationCallbacks();
354380}
355381

@@public:
392418 ASSERT_WITH_SECURITY_IMPLICATION(m_desiredTraitsMaskForComparison & FontWeightMask);
393419 }
394420
395  bool operator()(const CSSFontFace& first, const CSSFontFace& second)
 421 bool operator()(const FontFace& first, const FontFace& second)
396422 {
397423 FontTraitsMask firstTraitsMask = first.traitsMask();
398424 FontTraitsMask secondTraitsMask = second.traitsMask();

@@CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe
478504 return nullptr;
479505 auto& familyFontFaces = iterator->value;
480506
481  auto& segmentedFontFaceCache = m_fonts.add(family, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>()).iterator->value;
 507 auto& segmentedFontFaceCache = m_fonts.add(family, HashMap<unsigned, std::unique_ptr<CSSSegmentedFontFace>>()).iterator->value;
482508
483509 FontTraitsMask traitsMask = fontDescription.traitsMask();
484510
485  RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache.add(traitsMask, nullptr).iterator->value;
486  if (face)
487  return face.get();
488 
489  face = CSSSegmentedFontFace::create(this);
 511 auto addResult = segmentedFontFaceCache.add(traitsMask, std::make_unique<CSSSegmentedFontFace>(*this));
 512 CSSSegmentedFontFace& face = *addResult.iterator->value;
 513 if (!addResult.isNewEntry)
 514 return &face;
490515
491  Vector<std::reference_wrapper<CSSFontFace>, 32> candidateFontFaces;
492  for (int i = familyFontFaces.size() - 1; i >= 0; --i) {
493  CSSFontFace& candidate = familyFontFaces[i];
 516 Vector<std::reference_wrapper<FontFace>, 32> candidateFontFaces;
 517 for (FontFace& candidate : familyFontFaces) {
494518 unsigned candidateTraitsMask = candidate.traitsMask();
495519 if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & FontStyleNormalMask))
496520 continue;

@@CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe
509533
510534 std::stable_sort(candidateFontFaces.begin(), candidateFontFaces.end(), FontFaceComparator(traitsMask));
511535 for (auto& candidate : candidateFontFaces)
512  face->appendFontFace(candidate.get());
 536 face.appendFontFace(candidate.get());
513537
514  return face.get();
 538 return &face;
515539}
516540
517541void CSSFontSelector::clearDocument()

Source/WebCore/css/CSSFontSelector.h

2626#ifndef CSSFontSelector_h
2727#define CSSFontSelector_h
2828
 29#include "CSSSegmentedFontFace.h"
2930#include "CachedResourceHandle.h"
3031#include "Font.h"
3132#include "FontSelector.h"

3940
4041namespace WebCore {
4142
42 class CSSFontFace;
 43class FontFace;
4344class CSSFontFaceRule;
44 class CSSSegmentedFontFace;
 45class CSSPrimitiveValue;
 46class CSSValueList;
4547class CachedFont;
4648class Document;
47 class StyleRuleFontFace;
 49class StyleProperties;
4850
4951class CSSFontSelector final : public FontSelector {
5052public:

@@public:
6466
6567 void clearDocument();
6668
67  void addFontFaceRule(const StyleRuleFontFace&, bool isInitiatingElementInUserAgentShadowTree);
 69 void addFontFaceRule(const StyleProperties&, bool isInitiatingElementInUserAgentShadowTree);
6870
69  void fontLoaded();
 71 void fontLoaded(FontFace&);
7072 virtual void fontCacheInvalidated() override;
7173
7274 bool isEmpty() const;

@@public:
7880
7981 void beginLoadingFontSoon(CachedFont*);
8082
 83 static String familyNameFromPrimitive(const CSSPrimitiveValue&);
 84
 85 void fontFaceWillChange(FontFace&);
 86
 87 void addSourcesToFontFace(FontFace& fontFace, CSSValueList& srcList, bool isInitiatingElementInUserAgentShadowTree = false);
 88
8189private:
8290 explicit CSSFontSelector(Document&);
8391

@@private:
8694 void beginLoadTimerFired();
8795
8896 Document* m_document;
89  HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_fontFaces;
90  HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_locallyInstalledFontFaces;
91  HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, CaseFoldingHash> m_fonts;
 97 HashMap<String, Vector<Ref<FontFace>>, CaseFoldingHash> m_fontFaces;
 98 HashMap<String, Vector<Ref<FontFace>>, CaseFoldingHash> m_locallyInstalledFontFaces;
 99 HashMap<String, HashMap<unsigned, std::unique_ptr<CSSSegmentedFontFace>>, CaseFoldingHash> m_fonts;
92100 HashSet<FontSelectorClient*> m_clients;
93101
94102 Vector<CachedResourceHandle<CachedFont>> m_fontsToBeginLoading;

Source/WebCore/css/CSSSegmentedFontFace.cpp

2626#include "config.h"
2727#include "CSSSegmentedFontFace.h"
2828
29 #include "CSSFontFace.h"
30 #include "CSSFontFaceSource.h"
3129#include "CSSFontSelector.h"
3230#include "Document.h"
3331#include "Font.h"
3432#include "FontCache.h"
3533#include "FontDescription.h"
 34#include "FontFace.h"
3635#include "RuntimeEnabledFeatures.h"
3736
3837namespace WebCore {
3938
40 CSSSegmentedFontFace::CSSSegmentedFontFace(CSSFontSelector* fontSelector)
 39CSSSegmentedFontFace::CSSSegmentedFontFace(CSSFontSelector& fontSelector)
4140 : m_fontSelector(fontSelector)
4241{
4342}
4443
45 CSSSegmentedFontFace::~CSSSegmentedFontFace()
46 {
47  pruneTable();
48  for (auto& face : m_fontFaces)
49  face->removedFromSegmentedFontFace(this);
50 }
51 
5244void CSSSegmentedFontFace::pruneTable()
5345{
5446 m_descriptionToRangesMap.clear();
5547}
5648
57 void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
 49void CSSSegmentedFontFace::fontLoaded(FontFace&)
5850{
5951 pruneTable();
60 
61 #if ENABLE(FONT_LOAD_EVENTS)
62  if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && !isLoading()) {
63  Vector<RefPtr<LoadFontCallback>> callbacks;
64  m_callbacks.swap(callbacks);
65  for (size_t index = 0; index < callbacks.size(); ++index) {
66  if (checkFont())
67  callbacks[index]->notifyLoaded();
68  else
69  callbacks[index]->notifyError();
70  }
71  }
72 #endif
7352}
7453
75 void CSSSegmentedFontFace::appendFontFace(Ref<CSSFontFace>&& fontFace)
 54void CSSSegmentedFontFace::appendFontFace(Ref<FontFace>&& fontFace)
7655{
7756 pruneTable();
78  fontFace->addedToSegmentedFontFace(this);
7957 m_fontFaces.append(WTFMove(fontFace));
8058}
8159
82 static void appendFontWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<Font>&& font, const Vector<CSSFontFace::UnicodeRange>& unicodeRanges)
 60static void appendFontWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<Font>&& font, const Vector<FontFace::UnicodeRange>& unicodeRanges)
8361{
8462 if (font->isLoading()) {
8563 ranges.appendRange(FontRanges::Range(0, 0, WTFMove(font)));

@@static void appendFontWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<F
9876
9977FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription)
10078{
101  FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
102 
10379 auto addResult = m_descriptionToRangesMap.add(FontDescriptionKey(fontDescription), FontRanges());
10480 auto& fontRanges = addResult.iterator->value;
10581
10682 if (addResult.isNewEntry) {
 83 FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
10784 for (auto& face : m_fontFaces) {
108  if (!face->isValid())
 85 if (face->allSourcesHaveFailed())
10986 continue;
11087
11188 FontTraitsMask traitsMask = face->traitsMask();

@@FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescripti
11996 return fontRanges;
12097}
12198
122 #if ENABLE(FONT_LOAD_EVENTS)
123 bool CSSSegmentedFontFace::isLoading() const
124 {
125  for (auto& face : m_fontFaces) {
126  if (face->loadState() == CSSFontFace::Loading)
127  return true;
128  }
129  return false;
130 }
131 
132 bool CSSSegmentedFontFace::checkFont() const
133 {
134  for (auto& face : m_fontFaces) {
135  if (face->loadState() != CSSFontFace::Loaded)
136  return false;
137  }
138  return true;
139 }
140 
141 void CSSSegmentedFontFace::loadFont(const FontDescription& fontDescription, PassRefPtr<LoadFontCallback> callback)
142 {
143  fontRanges(fontDescription); // Kick off the load.
144 
145  if (callback) {
146  if (isLoading())
147  m_callbacks.append(callback);
148  else if (checkFont())
149  callback->notifyLoaded();
150  else
151  callback->notifyError();
152  }
153 }
154 #endif
155 
15699}

Source/WebCore/css/CSSSegmentedFontFace.h

3535
3636namespace WebCore {
3737
38 class CSSFontFace;
 38class FontFace;
3939class CSSFontSelector;
4040class FontDescription;
4141
42 class CSSSegmentedFontFace : public RefCounted<CSSSegmentedFontFace> {
 42class CSSSegmentedFontFace {
4343public:
44  static Ref<CSSSegmentedFontFace> create(CSSFontSelector* selector) { return adoptRef(*new CSSSegmentedFontFace(selector)); }
45  ~CSSSegmentedFontFace();
 44 CSSSegmentedFontFace(CSSFontSelector&);
4645
47  CSSFontSelector* fontSelector() const { return m_fontSelector; }
 46 CSSFontSelector& fontSelector() const { return m_fontSelector; }
4847
49  void fontLoaded(CSSFontFace*);
 48 void fontLoaded(FontFace&);
5049
51  void appendFontFace(Ref<CSSFontFace>&&);
 50 void appendFontFace(Ref<FontFace>&&);
5251
5352 FontRanges fontRanges(const FontDescription&);
5453
55 #if ENABLE(FONT_LOAD_EVENTS)
56  class LoadFontCallback : public RefCounted<LoadFontCallback> {
57  public:
58  virtual ~LoadFontCallback() { }
59  virtual void notifyLoaded() = 0;
60  virtual void notifyError() = 0;
61  };
62 
63  bool checkFont() const;
64  void loadFont(const FontDescription&, PassRefPtr<LoadFontCallback> loadCallback);
65 #endif
66 
6754private:
68  CSSSegmentedFontFace(CSSFontSelector*);
69 
7055 void pruneTable();
71 #if ENABLE(FONT_LOAD_EVENTS)
72  bool isLoading() const;
73 #endif
7456
75  CSSFontSelector* m_fontSelector;
 57 CSSFontSelector& m_fontSelector;
7658 HashMap<FontDescriptionKey, FontRanges, FontDescriptionKeyHash, WTF::SimpleClassHashTraits<FontDescriptionKey>> m_descriptionToRangesMap;
77  Vector<Ref<CSSFontFace>, 1> m_fontFaces;
78 #if ENABLE(FONT_LOAD_EVENTS)
79  Vector<RefPtr<LoadFontCallback>> m_callbacks;
80 #endif
 59 Vector<Ref<FontFace>, 1> m_fontFaces;
8160};
8261
8362} // namespace WebCore

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(FontFace& 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/FontFace.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 "FontFace.h"
 28
 29#include "CachedFont.h"
 30#include "CSSFontFaceSrcValue.h"
 31#include "CSSFontFeatureValue.h"
 32#include "CSSFontSelector.h"
 33#include "CSSPrimitiveValueMappings.h"
 34#include "CSSUnicodeRangeValue.h"
 35#include "CSSValuePool.h"
 36#include "Document.h"
 37#include "FontDescription.h"
 38#include "FontFaceSource.h"
 39#include "FontVariantBuilder.h"
 40#include "ImmediateFontFaceSource.h"
 41#include "JSFontFace.h"
 42#include "SharedBuffer.h"
 43#include "StyleProperties.h"
 44#include "RemoteFontFaceSource.h"
 45
 46namespace WebCore {
 47
 48enum class FontFace::Status {
 49 Unloaded,
 50 Loading,
 51 Loaded,
 52 Error
 53};
 54
 55static inline String valueFromDictionary(const Dictionary& dictionary, const char* key)
 56{
 57 String result;
 58 dictionary.get(key, result);
 59 return result;
 60}
 61
 62static inline String stringOr(String value, ASCIILiteral defaultValue)
 63{
 64 if (value.isNull())
 65 return String(defaultValue);
 66 return value;
 67}
 68
 69static FontFace::Promise createPromise(Document& document)
 70{
 71 DOMWrapperWorld& normalWorld = mainThreadNormalWorld();
 72 JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(&document, normalWorld);
 73 JSC::ExecState* exec = globalObject->globalExec();
 74 return FontFace::Promise(DeferredWrapper(exec, globalObject, JSC::JSPromiseDeferred::create(exec, globalObject)));
 75}
 76
 77FontFace::FontFace(Document& document, const String& family, const Dictionary& descriptors)
 78 : ActiveDOMObject(&document)
 79 , m_status(Status::Unloaded)
 80 , m_promise(createPromise(document))
 81{
 82 setFamily(family);
 83 setStyle(stringOr(valueFromDictionary(descriptors, "style"), ASCIILiteral("normal")));
 84 setWeight(stringOr(valueFromDictionary(descriptors, "weight"), ASCIILiteral("normal")));
 85 setStretch(stringOr(valueFromDictionary(descriptors, "stretch"), ASCIILiteral("normal")));
 86 setUnicodeRange(stringOr(valueFromDictionary(descriptors, "unicodeRange"), ASCIILiteral("U+0-10FFFF")));
 87 setVariant(stringOr(valueFromDictionary(descriptors, "variant"), ASCIILiteral("normal")));
 88 setFeatureSettings(stringOr(valueFromDictionary(descriptors, "featureSettings"), ASCIILiteral("normal")));
 89}
 90
 91FontFace::FontFace(Document& document, FontTraitsMask traitsMask, bool isLocalFallback)
 92 : ActiveDOMObject(&document)
 93 , m_traitsMask(traitsMask)
 94 , m_isLocalFallback(isLocalFallback)
 95 , m_promise(createPromise(document))
 96{
 97}
 98
 99FontFace::FontFace(Document& document, const String& family, const String& srcString, const Dictionary& dictionary)
 100 : FontFace(document, family, dictionary)
 101{
 102 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 103 if (CSSParser::parseValue(style.ptr(), CSSPropertySrc, srcString, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 104 return;
 105
 106 RefPtr<CSSValue> src = style->getPropertyCSSValue(CSSPropertySrc);
 107 if (!is<CSSValueList>(src.get()))
 108 return;
 109
 110 m_remoteResources = downcast<CSSValueList>(src.get());
 111 if (!m_remoteResources->length())
 112 return;
 113
 114 document.fontSelector().addSourcesToFontFace(*this, *m_remoteResources);
 115}
 116
 117FontFace::FontFace(Document& document, const String& family, const void* data, size_t size, const Dictionary& dictionary)
 118 : FontFace(document, family, dictionary)
 119{
 120 // Because ArrayBuffers and ArrayBufferViews are mutable, we need to take a snapshot of the data at the time of construction.
 121 // Otherwise, because the API for this object is asynchronous, script may change the data out from under us.
 122 m_immediateData = SharedBuffer::create(static_cast<const char*>(data), size);
 123 addSource(std::make_unique<ImmediateFontFaceSource>(*this, *m_immediateData));
 124}
 125
 126FontFace::~FontFace()
 127{
 128}
 129
 130bool FontFace::canSuspendForDocumentSuspension() const
 131{
 132 return m_status == Status::Loading;
 133}
 134
 135void FontFace::addSource(std::unique_ptr<FontFaceSource>&& source)
 136{
 137 m_sources.append(WTFMove(source));
 138}
 139
 140bool FontFace::allSourcesHaveFailed() const
 141{
 142 for (auto& source : m_sources) {
 143 if (source->state() != FontFaceSource::State::Failed)
 144 return false;
 145 }
 146 return true;
 147}
 148
 149String FontFace::status() const
 150{
 151 switch (m_status) {
 152 case Status::Unloaded:
 153 return String("unloaded", String::ConstructFromLiteral);
 154 case Status::Loading:
 155 return String("loading", String::ConstructFromLiteral);
 156 case Status::Loaded:
 157 return String("loaded", String::ConstructFromLiteral);
 158 case Status::Error:
 159 return String("error", String::ConstructFromLiteral);
 160 }
 161 ASSERT_NOT_REACHED();
 162 return String("error", String::ConstructFromLiteral);
 163}
 164
 165String FontFace::family() const
 166{
 167 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
 168 for (auto& family : families())
 169 list->append(valueForFamily(family));
 170 return list->cssText();
 171}
 172
 173void FontFace::setFamily(const String& family)
 174{
 175 if (m_status != Status::Unloaded)
 176 return;
 177
 178 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 179 if (CSSParser::parseValue(style.ptr(), CSSPropertyFontFamily, family, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 180 return;
 181
 182 RefPtr<CSSValue> value = style->getPropertyCSSValue(CSSPropertyFontFamily);
 183 if (!value || !is<CSSValueList>(value.get()))
 184 return;
 185
 186 CSSValueList& familyList = downcast<CSSValueList>(*value);
 187 if (!familyList.length())
 188 return;
 189
 190 if (m_fontSelector)
 191 m_fontSelector->fontFaceWillChange(*this);
 192
 193 Vector<String> result;
 194 for (auto& item : familyList) {
 195 String familyName = CSSFontSelector::familyNameFromPrimitive(downcast<CSSPrimitiveValue>(item.get()));
 196 if (familyName.isEmpty())
 197 return;
 198 result.append(WTFMove(familyName));
 199 }
 200 m_families.swap(result);
 201}
 202
 203String FontFace::style() const
 204{
 205 switch (m_traitsMask & FontStyleMask) {
 206 case FontStyleNormalMask:
 207 return String("normal", String::ConstructFromLiteral);
 208 case FontStyleItalicMask:
 209 return String("italic", String::ConstructFromLiteral);
 210 }
 211 ASSERT_NOT_REACHED();
 212 return String("normal", String::ConstructFromLiteral);
 213}
 214
 215void FontFace::setStyle(const String& newStyle)
 216{
 217 if (m_status != Status::Unloaded)
 218 return;
 219
 220 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 221 if (CSSParser::parseValue(style.ptr(), CSSPropertyFontStyle, newStyle, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 222 return;
 223
 224 RefPtr<CSSValue> fontStyle = style->getPropertyCSSValue(CSSPropertyFontStyle);
 225 if (!fontStyle || !is<CSSPrimitiveValue>(*fontStyle))
 226 return;
 227
 228 if (m_fontSelector)
 229 m_fontSelector->fontFaceWillChange(*this);
 230
 231 unsigned newTraitsMask = m_traitsMask & ~FontStyleMask;
 232 switch (downcast<CSSPrimitiveValue>(*fontStyle).getValueID()) {
 233 case CSSValueNormal:
 234 newTraitsMask |= FontStyleNormalMask;
 235 break;
 236 case CSSValueItalic:
 237 case CSSValueOblique:
 238 newTraitsMask |= FontStyleItalicMask;
 239 break;
 240 default:
 241 return;
 242 }
 243 m_traitsMask = static_cast<FontTraitsMask>(newTraitsMask);
 244}
 245
 246String FontFace::weight() const
 247{
 248 switch (m_traitsMask & FontWeightMask) {
 249 case FontWeight100Mask:
 250 return String("100", String::ConstructFromLiteral);
 251 case FontWeight200Mask:
 252 return String("200", String::ConstructFromLiteral);
 253 case FontWeight300Mask:
 254 return String("300", String::ConstructFromLiteral);
 255 case FontWeight400Mask:
 256 return String("normal", String::ConstructFromLiteral);
 257 case FontWeight500Mask:
 258 return String("500", String::ConstructFromLiteral);
 259 case FontWeight600Mask:
 260 return String("600", String::ConstructFromLiteral);
 261 case FontWeight700Mask:
 262 return String("bold", String::ConstructFromLiteral);
 263 case FontWeight800Mask:
 264 return String("800", String::ConstructFromLiteral);
 265 case FontWeight900Mask:
 266 return String("900", String::ConstructFromLiteral);
 267 }
 268 ASSERT_NOT_REACHED();
 269 return String("normal", String::ConstructFromLiteral);
 270}
 271
 272void FontFace::setWeight(const String& weight)
 273{
 274 if (m_status != Status::Unloaded)
 275 return;
 276
 277 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 278 if (CSSParser::parseValue(style.ptr(), CSSPropertyFontWeight, weight, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 279 return;
 280
 281 RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight);
 282 if (!fontWeight)
 283 return;
 284
 285 if (!is<CSSPrimitiveValue>(*fontWeight))
 286 return;
 287
 288 if (m_fontSelector)
 289 m_fontSelector->fontFaceWillChange(*this);
 290
 291 unsigned newTraitsMask = m_traitsMask & ~FontWeightMask;
 292 switch (downcast<CSSPrimitiveValue>(*fontWeight).getValueID()) {
 293 case CSSValueBold:
 294 case CSSValue700:
 295 newTraitsMask |= FontWeight700Mask;
 296 break;
 297 case CSSValueNormal:
 298 case CSSValue400:
 299 newTraitsMask |= FontWeight400Mask;
 300 break;
 301 case CSSValue900:
 302 newTraitsMask |= FontWeight900Mask;
 303 break;
 304 case CSSValue800:
 305 newTraitsMask |= FontWeight800Mask;
 306 break;
 307 case CSSValue600:
 308 newTraitsMask |= FontWeight600Mask;
 309 break;
 310 case CSSValue500:
 311 newTraitsMask |= FontWeight500Mask;
 312 break;
 313 case CSSValue300:
 314 newTraitsMask |= FontWeight300Mask;
 315 break;
 316 case CSSValue200:
 317 newTraitsMask |= FontWeight200Mask;
 318 break;
 319 case CSSValue100:
 320 newTraitsMask |= FontWeight100Mask;
 321 break;
 322 default:
 323 return;
 324 }
 325 m_traitsMask = static_cast<FontTraitsMask>(newTraitsMask);
 326}
 327
 328String FontFace::stretch() const
 329{
 330 return m_stretch;
 331}
 332
 333void FontFace::setStretch(const String& stretch)
 334{
 335 m_stretch = stretch;
 336}
 337
 338String FontFace::unicodeRange() const
 339{
 340 StringBuilder builder;
 341 for (size_t i = 0; i < m_ranges.size(); ++i) {
 342 if (i)
 343 builder.append(", ");
 344 builder.append(String::format("U+%x-%x", m_ranges[i].from(), m_ranges[i].to()));
 345 }
 346 return builder.toString();
 347}
 348
 349void FontFace::setUnicodeRange(const String& newUnicodeRange)
 350{
 351 if (m_status != Status::Unloaded)
 352 return;
 353
 354 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 355 if (CSSParser::parseValue(style.ptr(), CSSPropertyUnicodeRange, newUnicodeRange, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 356 return;
 357
 358 RefPtr<CSSValue> unicodeRange = style->getPropertyCSSValue(CSSPropertyUnicodeRange);
 359 if (!unicodeRange || !is<CSSValueList>(*unicodeRange))
 360 return;
 361
 362 CSSValueList* rangeList = downcast<CSSValueList>(unicodeRange.get());
 363 if (!rangeList->length())
 364 return;
 365
 366 if (m_fontSelector)
 367 m_fontSelector->fontFaceWillChange(*this);
 368
 369 m_ranges.clear();
 370 for (auto& rangeItem : *rangeList) {
 371 CSSUnicodeRangeValue& range = downcast<CSSUnicodeRangeValue>(rangeItem.get());
 372 addRange(range.from(), range.to());
 373 }
 374}
 375
 376String FontFace::variant() const
 377{
 378 return computeFontVariant(m_variantSettings)->cssText();
 379}
 380
 381void FontFace::setVariant(const String& variant)
 382{
 383 if (m_status != Status::Unloaded)
 384 return;
 385
 386 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 387 if (CSSParser::parseValue(style.ptr(), CSSPropertyFontVariant, variant, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 388 return;
 389
 390 RefPtr<CSSValue> variantLigatures = style->getPropertyCSSValue(CSSPropertyFontVariantLigatures);
 391 RefPtr<CSSValue> variantPosition = style->getPropertyCSSValue(CSSPropertyFontVariantPosition);
 392 RefPtr<CSSValue> variantCaps = style->getPropertyCSSValue(CSSPropertyFontVariantCaps);
 393 RefPtr<CSSValue> variantNumeric = style->getPropertyCSSValue(CSSPropertyFontVariantNumeric);
 394 RefPtr<CSSValue> variantAlternates = style->getPropertyCSSValue(CSSPropertyFontVariantAlternates);
 395 RefPtr<CSSValue> variantEastAsian = style->getPropertyCSSValue(CSSPropertyFontVariantEastAsian);
 396
 397 if (!variantLigatures && !variantPosition && !variantCaps && !variantNumeric && !variantAlternates && !variantEastAsian)
 398 return;
 399
 400 m_variantSettings = FontVariantSettings();
 401 if (variantLigatures) {
 402 applyValueFontVariantLigatures(*variantLigatures, [&](FontVariantLigatures common, FontVariantLigatures discretionary, FontVariantLigatures historical, FontVariantLigatures contextualAlternates) {
 403 setVariantCommonLigatures(common);
 404 setVariantDiscretionaryLigatures(discretionary);
 405 setVariantHistoricalLigatures(historical);
 406 setVariantContextualAlternates(contextualAlternates);
 407 });
 408 }
 409
 410 if (variantPosition && is<CSSPrimitiveValue>(*variantPosition))
 411 setVariantPosition(downcast<CSSPrimitiveValue>(*variantPosition));
 412
 413 if (variantCaps && is<CSSPrimitiveValue>(*variantCaps))
 414 setVariantCaps(downcast<CSSPrimitiveValue>(*variantCaps));
 415
 416 if (variantNumeric) {
 417 applyValueFontVariantNumeric(*variantNumeric, [&](FontVariantNumericFigure figure, FontVariantNumericSpacing spacing, FontVariantNumericFraction fraction, FontVariantNumericOrdinal ordinal, FontVariantNumericSlashedZero slashedZero) {
 418 setVariantNumericFigure(figure);
 419 setVariantNumericSpacing(spacing);
 420 setVariantNumericFraction(fraction);
 421 setVariantNumericOrdinal(ordinal);
 422 setVariantNumericSlashedZero(slashedZero);
 423 });
 424 }
 425
 426 if (variantAlternates && is<CSSPrimitiveValue>(*variantAlternates))
 427 setVariantAlternates(downcast<CSSPrimitiveValue>(*variantAlternates));
 428
 429 if (variantEastAsian) {
 430 applyValueFontVariantEastAsian(*variantEastAsian, [&](FontVariantEastAsianVariant variant, FontVariantEastAsianWidth width, FontVariantEastAsianRuby ruby) {
 431 setVariantEastAsianVariant(variant);
 432 setVariantEastAsianWidth(width);
 433 setVariantEastAsianRuby(ruby);
 434 });
 435 }
 436}
 437
 438String FontFace::featureSettings()
 439{
 440 if (!m_featureSettings.size())
 441 return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal)->cssText();
 442 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
 443 for (auto& feature : m_featureSettings)
 444 list->append(CSSFontFeatureValue::create(FontFeatureTag(feature.tag()), feature.value()));
 445 return list->cssText();
 446}
 447
 448void FontFace::setFeatureSettings(const String& newFeatureSettings)
 449{
 450 if (m_status != Status::Unloaded)
 451 return;
 452
 453 Ref<MutableStyleProperties> style = MutableStyleProperties::create();
 454 if (CSSParser::parseValue(style.ptr(), CSSPropertyFontFeatureSettings, newFeatureSettings, true, CSSStrictMode, nullptr) == CSSParser::ParseResult::Error)
 455 return;
 456
 457 RefPtr<CSSValue> featureSettings = style->getPropertyCSSValue(CSSPropertyFontFeatureSettings);
 458 if (!featureSettings)
 459 return;
 460
 461 m_featureSettings = FontFeatureSettings();
 462 if (is<CSSPrimitiveValue>(featureSettings.get())) {
 463 ASSERT(downcast<CSSPrimitiveValue>(featureSettings.get())->getValueID() == CSSValueNormal);
 464 return;
 465 }
 466
 467 for (auto& item : downcast<CSSValueList>(*featureSettings)) {
 468 auto& feature = downcast<CSSFontFeatureValue>(item.get());
 469 insertFeature(FontFeature(feature.tag(), feature.value()));
 470 }
 471}
 472
 473void FontFace::pump()
 474{
 475 ASSERT(m_status == Status::Loading);
 476
 477 for (size_t index = 0; index < m_sources.size(); ) {
 478 switch (m_sources[index]->state()) {
 479 case FontFaceSource::State::Pending:
 480 m_sources[index]->load();
 481 break;
 482 case FontFaceSource::State::Loading:
 483 return;
 484 case FontFaceSource::State::Failed:
 485 ++index;
 486 break;
 487 case FontFaceSource::State::Succeeded:
 488 resolvePromise();
 489 return;
 490 }
 491 }
 492
 493 rejectPromise();
 494}
 495
 496void FontFace::load()
 497{
 498 if (m_status != Status::Unloaded)
 499 return;
 500
 501 m_status = Status::Loading;
 502
 503 pump();
 504}
 505
 506void FontFace::kick(FontFaceSource&)
 507{
 508 if (m_fontSelector)
 509 m_fontSelector->fontLoaded(*this);
 510
 511 if (m_status == Status::Loading)
 512 pump();
 513}
 514
 515RefPtr<Font> FontFace::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic)
 516{
 517 if (allSourcesHaveFailed())
 518 return nullptr;
 519
 520 load();
 521
 522 for (size_t index = 0; index < m_sources.size(); ) {
 523 switch (m_sources[index]->state()) {
 524 case FontFaceSource::State::Pending:
 525 ASSERT_NOT_REACHED();
 526 ++index;
 527 break;
 528 case FontFaceSource::State::Loading:
 529 return Font::create(FontCache::singleton().lastResortFallbackFont(fontDescription)->platformData(), true, true);
 530 case FontFaceSource::State::Failed:
 531 ++index;
 532 break;
 533 case FontFaceSource::State::Succeeded:
 534 if (auto result = m_sources[index]->font(fontDescription, syntheticBold, syntheticItalic, m_featureSettings, m_variantSettings))
 535 return result;
 536 ++index;
 537 break;
 538 }
 539 }
 540
 541 return nullptr;
 542}
 543
 544void FontFace::resolvePromise()
 545{
 546 ASSERT(m_status == Status::Loading);
 547 m_status = Status::Loaded;
 548
 549 // Normally, DeferredWrapper::callFunction resets the reference to the promise.
 550 // However, API semantics require our promise to live for the entire lifetime of the FontFace.
 551 // Let's make sure it stays alive.
 552
 553 Promise guard(m_promise);
 554 m_promise.resolve(*this);
 555 m_promise = guard;
 556}
 557
 558void FontFace::rejectPromise()
 559{
 560 ASSERT(m_status == Status::Loading);
 561 m_status = Status::Error;
 562
 563 // Normally, DeferredWrapper::callFunction resets the reference to the promise.
 564 // However, API semantics require our promise to live for the entire lifetime of the FontFace.
 565 // Let's make sure it stays alive.
 566
 567 Promise guard(m_promise);
 568 m_promise.reject(-1); // FIXME: Reject with the correct thing
 569 m_promise = guard;
 570}
 571
 572}

Source/WebCore/css/FontFace.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 FontFace_h
 27#define FontFace_h
 28
 29#include "Dictionary.h"
 30#include "JSDOMPromise.h"
 31
 32#include "ActiveDOMObject.h"
 33#include "CachedResourceHandle.h"
 34#include "FontFeatureSettings.h"
 35#include "SharedBuffer.h"
 36#include "StyleProperties.h"
 37#include "TextFlags.h"
 38#include "WebKitFontFamilyNames.h"
 39
 40#include <bindings/ScriptValue.h>
 41#include <wtf/Ref.h>
 42#include <wtf/RefCounted.h>
 43#include <wtf/StdLibExtras.h>
 44#include <wtf/Vector.h>
 45#include <wtf/text/WTFString.h>
 46#include <wtf/WeakPtr.h>
 47
 48namespace WebCore {
 49
 50class CachedFont;
 51class CSSFontSelector;
 52class Document;
 53class Font;
 54class FontDescription;
 55class FontFaceSource;
 56
 57class FontFace final : public RefCounted<FontFace>, public ActiveDOMObject {
 58public:
 59 typedef DOMPromise<FontFace&, ExceptionCode> Promise;
 60
 61 static Ref<FontFace> create(Document& document, FontTraitsMask traitsMask, bool isLocalFallback = false)
 62 {
 63 return adoptRef(*new FontFace(document, traitsMask, isLocalFallback));
 64 }
 65 static Ref<FontFace> create(Document& document, const String& family, const String& source, const Dictionary& descriptors)
 66 {
 67 return adoptRef<FontFace>(*new FontFace(document, family, source, descriptors));
 68 }
 69 static Ref<FontFace> create(Document& document, const String& family, const void* data, size_t dataLength, const Dictionary& descriptors)
 70 {
 71 return adoptRef<FontFace>(*new FontFace(document, family, data, dataLength, descriptors));
 72 }
 73 virtual ~FontFace();
 74
 75 void addSource(std::unique_ptr<FontFaceSource>&&);
 76
 77 struct UnicodeRange;
 78 const Vector<String>& families() const { return m_families; }
 79 bool isLocalFallback() const { return m_isLocalFallback; }
 80 FontTraitsMask traitsMask() const { return m_traitsMask; }
 81 void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); }
 82 const Vector<UnicodeRange>& ranges() const { return m_ranges; }
 83 void insertFeature(FontFeature&& feature) { m_featureSettings.insert(WTFMove(feature)); }
 84 void setVariantCommonLigatures(FontVariantLigatures ligatures) { m_variantSettings.commonLigatures = ligatures; }
 85 void setVariantDiscretionaryLigatures(FontVariantLigatures ligatures) { m_variantSettings.discretionaryLigatures = ligatures; }
 86 void setVariantHistoricalLigatures(FontVariantLigatures ligatures) { m_variantSettings.historicalLigatures = ligatures; }
 87 void setVariantContextualAlternates(FontVariantLigatures ligatures) { m_variantSettings.contextualAlternates = ligatures; }
 88 void setVariantPosition(FontVariantPosition position) { m_variantSettings.position = position; }
 89 void setVariantCaps(FontVariantCaps caps) { m_variantSettings.caps = caps; }
 90 void setVariantNumericFigure(FontVariantNumericFigure figure) { m_variantSettings.numericFigure = figure; }
 91 void setVariantNumericSpacing(FontVariantNumericSpacing spacing) { m_variantSettings.numericSpacing = spacing; }
 92 void setVariantNumericFraction(FontVariantNumericFraction fraction) { m_variantSettings.numericFraction = fraction; }
 93 void setVariantNumericOrdinal(FontVariantNumericOrdinal ordinal) { m_variantSettings.numericOrdinal = ordinal; }
 94 void setVariantNumericSlashedZero(FontVariantNumericSlashedZero slashedZero) { m_variantSettings.numericSlashedZero = slashedZero; }
 95 void setVariantAlternates(FontVariantAlternates alternates) { m_variantSettings.alternates = alternates; }
 96 void setVariantEastAsianVariant(FontVariantEastAsianVariant variant) { m_variantSettings.eastAsianVariant = variant; }
 97 void setVariantEastAsianWidth(FontVariantEastAsianWidth width) { m_variantSettings.eastAsianWidth = width; }
 98 void setVariantEastAsianRuby(FontVariantEastAsianRuby ruby) { m_variantSettings.eastAsianRuby = ruby; }
 99
 100 // Invoked from script
 101 String family() const;
 102 void setFamily(const String& family);
 103 String style() const;
 104 void setStyle(const String& style);
 105 String weight() const;
 106 void setWeight(const String& weight);
 107 String stretch() const;
 108 void setStretch(const String& stretch);
 109 String unicodeRange() const;
 110 void setUnicodeRange(const String& unicodeRange);
 111 String variant() const;
 112 void setVariant(const String& variant);
 113 String featureSettings();
 114 void setFeatureSettings(const String& featureSettings);
 115 String status() const;
 116
 117 bool allSourcesHaveFailed() const;
 118
 119 RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic);
 120
 121 // Something asynchronous happened (but nothing in particular; if you want to know, you have to figure it out yourself).
 122 void kick(FontFaceSource&);
 123
 124 const Promise& promise() const { return m_promise; }
 125
 126 void load();
 127
 128 struct UnicodeRange {
 129 UnicodeRange(UChar32 from, UChar32 to)
 130 : m_from(from)
 131 , m_to(to)
 132 {
 133 }
 134
 135 UChar32 from() const { return m_from; }
 136 UChar32 to() const { return m_to; }
 137
 138 private:
 139 UChar32 m_from;
 140 UChar32 m_to;
 141 };
 142
 143private:
 144 enum class Status;
 145
 146 FontFace(Document&, FontTraitsMask traitsMask, bool isLocalFallback);
 147 FontFace(Document&, const String& family, const Dictionary& descriptors);
 148 FontFace(Document&, const String& family, const String& source, const Dictionary& descriptors);
 149 FontFace(Document&, const String& family, const void* data, size_t dataLength, const Dictionary& descriptors);
 150
 151 // ActiveDOMObject
 152 virtual const char* activeDOMObjectName() const override { return "FontFace"; }
 153 virtual bool canSuspendForDocumentSuspension() const override;
 154
 155 void pump();
 156 void resolvePromise();
 157 void rejectPromise();
 158
 159 RefPtr<SharedBuffer> m_immediateData;
 160 RefPtr<CSSValueList> m_remoteResources;
 161
 162 Vector<String> m_families { WebKitFontFamilyNames::standardFamily } ;
 163 String m_stretch { String("normal", String::ConstructFromLiteral) };
 164
 165 FontTraitsMask m_traitsMask { static_cast<FontTraitsMask>(FontStyleNormalMask | FontWeight400Mask) };
 166 FontFeatureSettings m_featureSettings;
 167 FontVariantSettings m_variantSettings;
 168 Vector<UnicodeRange> m_ranges;
 169 bool m_isLocalFallback { false };
 170 Vector<std::unique_ptr<FontFaceSource>> m_sources;
 171 WeakPtr<CSSFontSelector> m_fontSelector;
 172 Status m_status;
 173 Promise m_promise;
 174};
 175
 176}
 177
 178#endif

Source/WebCore/css/FontFace.idl

 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 enum FontFaceLoadStatus {
 27 "unloaded",
 28 "loading",
 29 "loaded",
 30 "error"
 31};
 32
 33[
 34 CustomConstructor(DOMString family, any source, Dictionary descriptors)
 35] interface FontFace {
 36 attribute DOMString family;
 37 attribute DOMString style;
 38 attribute DOMString weight;
 39 attribute DOMString stretch;
 40 attribute DOMString unicodeRange;
 41 attribute DOMString variant;
 42 attribute DOMString featureSettings;
 43
 44 readonly attribute FontFaceLoadStatus status;
 45
 46 [Custom] Promise load();
 47 [Custom] readonly attribute Promise loaded;
 48};

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(FontFace& 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 FontFace;
 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(FontFace& 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 FontFace& 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 FontFace& 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/FontVariantBuilder.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 "FontVariantBuilder.h"
 28
 29#include "CSSValuePool.h"
 30
 31namespace WebCore {
 32
 33Ref<CSSValue> computeFontVariant(const FontVariantSettings& variantSettings)
 34{
 35 if (variantSettings.isAllNormal())
 36 return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
 37
 38 auto list = CSSValueList::createSpaceSeparated();
 39
 40 switch (variantSettings.commonLigatures) {
 41 case FontVariantLigatures::Normal:
 42 break;
 43 case FontVariantLigatures::Yes:
 44 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueCommonLigatures));
 45 break;
 46 case FontVariantLigatures::No:
 47 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoCommonLigatures));
 48 break;
 49 }
 50
 51 switch (variantSettings.discretionaryLigatures) {
 52 case FontVariantLigatures::Normal:
 53 break;
 54 case FontVariantLigatures::Yes:
 55 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiscretionaryLigatures));
 56 break;
 57 case FontVariantLigatures::No:
 58 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoDiscretionaryLigatures));
 59 break;
 60 }
 61
 62 switch (variantSettings.historicalLigatures) {
 63 case FontVariantLigatures::Normal:
 64 break;
 65 case FontVariantLigatures::Yes:
 66 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalLigatures));
 67 break;
 68 case FontVariantLigatures::No:
 69 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoHistoricalLigatures));
 70 break;
 71 }
 72
 73 switch (variantSettings.contextualAlternates) {
 74 case FontVariantLigatures::Normal:
 75 break;
 76 case FontVariantLigatures::Yes:
 77 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueContextual));
 78 break;
 79 case FontVariantLigatures::No:
 80 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueNoContextual));
 81 break;
 82 }
 83
 84 switch (variantSettings.position) {
 85 case FontVariantPosition::Normal:
 86 break;
 87 case FontVariantPosition::Subscript:
 88 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSub));
 89 break;
 90 case FontVariantPosition::Superscript:
 91 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSuper));
 92 break;
 93 }
 94
 95 switch (variantSettings.caps) {
 96 case FontVariantCaps::Normal:
 97 break;
 98 case FontVariantCaps::Small:
 99 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSmallCaps));
 100 break;
 101 case FontVariantCaps::AllSmall:
 102 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllSmallCaps));
 103 break;
 104 case FontVariantCaps::Petite:
 105 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValuePetiteCaps));
 106 break;
 107 case FontVariantCaps::AllPetite:
 108 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueAllPetiteCaps));
 109 break;
 110 case FontVariantCaps::Unicase:
 111 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueUnicase));
 112 break;
 113 case FontVariantCaps::Titling:
 114 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTitlingCaps));
 115 break;
 116 }
 117
 118 switch (variantSettings.numericFigure) {
 119 case FontVariantNumericFigure::Normal:
 120 break;
 121 case FontVariantNumericFigure::LiningNumbers:
 122 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueLiningNums));
 123 break;
 124 case FontVariantNumericFigure::OldStyleNumbers:
 125 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOldstyleNums));
 126 break;
 127 }
 128
 129 switch (variantSettings.numericSpacing) {
 130 case FontVariantNumericSpacing::Normal:
 131 break;
 132 case FontVariantNumericSpacing::ProportionalNumbers:
 133 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalNums));
 134 break;
 135 case FontVariantNumericSpacing::TabularNumbers:
 136 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTabularNums));
 137 break;
 138 }
 139
 140 switch (variantSettings.numericFraction) {
 141 case FontVariantNumericFraction::Normal:
 142 break;
 143 case FontVariantNumericFraction::DiagonalFractions:
 144 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueDiagonalFractions));
 145 break;
 146 case FontVariantNumericFraction::StackedFractions:
 147 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueStackedFractions));
 148 break;
 149 }
 150
 151 switch (variantSettings.numericOrdinal) {
 152 case FontVariantNumericOrdinal::Normal:
 153 break;
 154 case FontVariantNumericOrdinal::Yes:
 155 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueOrdinal));
 156 break;
 157 }
 158
 159 switch (variantSettings.numericSlashedZero) {
 160 case FontVariantNumericSlashedZero::Normal:
 161 break;
 162 case FontVariantNumericSlashedZero::Yes:
 163 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSlashedZero));
 164 break;
 165 }
 166
 167 switch (variantSettings.alternates) {
 168 case FontVariantAlternates::Normal:
 169 break;
 170 case FontVariantAlternates::HistoricalForms:
 171 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueHistoricalForms));
 172 break;
 173 }
 174
 175 switch (variantSettings.eastAsianVariant) {
 176 case FontVariantEastAsianVariant::Normal:
 177 break;
 178 case FontVariantEastAsianVariant::Jis78:
 179 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis78));
 180 break;
 181 case FontVariantEastAsianVariant::Jis83:
 182 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis83));
 183 break;
 184 case FontVariantEastAsianVariant::Jis90:
 185 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis90));
 186 break;
 187 case FontVariantEastAsianVariant::Jis04:
 188 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueJis04));
 189 break;
 190 case FontVariantEastAsianVariant::Simplified:
 191 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueSimplified));
 192 break;
 193 case FontVariantEastAsianVariant::Traditional:
 194 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueTraditional));
 195 break;
 196 }
 197
 198 switch (variantSettings.eastAsianWidth) {
 199 case FontVariantEastAsianWidth::Normal:
 200 break;
 201 case FontVariantEastAsianWidth::Full:
 202 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueFullWidth));
 203 break;
 204 case FontVariantEastAsianWidth::Proportional:
 205 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueProportionalWidth));
 206 break;
 207 }
 208
 209 switch (variantSettings.eastAsianRuby) {
 210 case FontVariantEastAsianRuby::Normal:
 211 break;
 212 case FontVariantEastAsianRuby::Yes:
 213 list.get().append(CSSValuePool::singleton().createIdentifierValue(CSSValueRuby));
 214 break;
 215 }
 216
 217 return WTFMove(list);
 218}
 219
 220}

Source/WebCore/css/FontVariantBuilder.h

2626#ifndef FontVariantBuilder_h
2727#define FontVariantBuilder_h
2828
 29#include <wtf/Ref.h>
 30#include <CSSValue.h>
 31#include <CSSPrimitiveValue.h>
 32#include <CSSValueList.h>
 33#include <CSSValuePool.h>
 34#include <TextFlags.h>
 35#include <WebKitFontFamilyNames.h>
 36
2937namespace WebCore {
3038
 39Ref<CSSValue> computeFontVariant(const FontVariantSettings&);
 40
3141template <typename T>
32 inline void applyValueFontVariantLigatures(T& receiver, CSSValue& value)
 42inline void applyValueFontVariantLigatures(CSSValue& value, T receiver)
3343{
3444 FontVariantLigatures common = FontVariantLigatures::Normal;
3545 FontVariantLigatures discretionary = FontVariantLigatures::Normal;

@@inline void applyValueFontVariantLigatures(T& receiver, CSSValue& value)
8494 }
8595 }
8696
87  receiver.setVariantCommonLigatures(common);
88  receiver.setVariantDiscretionaryLigatures(discretionary);
89  receiver.setVariantHistoricalLigatures(historical);
90  receiver.setVariantContextualAlternates(contextualAlternates);
 97 receiver(common, discretionary, historical, contextualAlternates);
9198}
9299
93100template <typename T>
94 inline void applyValueFontVariantNumeric(T& receiver, CSSValue& value)
 101inline void applyValueFontVariantNumeric(CSSValue& value, T receiver)
95102{
96103 FontVariantNumericFigure figure = FontVariantNumericFigure::Normal;
97104 FontVariantNumericSpacing spacing = FontVariantNumericSpacing::Normal;

@@inline void applyValueFontVariantNumeric(T& receiver, CSSValue& value)
134141 } else if (is<CSSPrimitiveValue>(value))
135142 ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
136143
137  receiver.setVariantNumericFigure(figure);
138  receiver.setVariantNumericSpacing(spacing);
139  receiver.setVariantNumericFraction(fraction);
140  receiver.setVariantNumericOrdinal(ordinal);
141  receiver.setVariantNumericSlashedZero(slashedZero);
 144 receiver(figure, spacing, fraction, ordinal, slashedZero);
142145}
143146
144147template <typename T>
145 inline void applyValueFontVariantEastAsian(T& receiver, CSSValue& value)
 148inline void applyValueFontVariantEastAsian(CSSValue& value, T receiver)
146149{
147150 FontVariantEastAsianVariant variant = FontVariantEastAsianVariant::Normal;
148151 FontVariantEastAsianWidth width = FontVariantEastAsianWidth::Normal;

@@inline void applyValueFontVariantEastAsian(T& receiver, CSSValue& value)
186189 } else if (is<CSSPrimitiveValue>(value))
187190 ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
188191
189  receiver.setVariantEastAsianVariant(variant);
190  receiver.setVariantEastAsianWidth(width);
191  receiver.setVariantEastAsianRuby(ruby);
 192 receiver(variant, width, ruby);
 193}
 194
 195inline CSSValueID identifierForFamily(const AtomicString& family)
 196{
 197 if (family == WebKitFontFamilyNames::cursiveFamily)
 198 return CSSValueCursive;
 199 if (family == WebKitFontFamilyNames::fantasyFamily)
 200 return CSSValueFantasy;
 201 if (family == WebKitFontFamilyNames::monospaceFamily)
 202 return CSSValueMonospace;
 203 if (family == WebKitFontFamilyNames::pictographFamily)
 204 return CSSValueWebkitPictograph;
 205 if (family == WebKitFontFamilyNames::sansSerifFamily)
 206 return CSSValueSansSerif;
 207 if (family == WebKitFontFamilyNames::serifFamily)
 208 return CSSValueSerif;
 209 return CSSValueInvalid;
 210}
 211
 212inline Ref<CSSPrimitiveValue> valueForFamily(const AtomicString& family)
 213{
 214 if (CSSValueID familyIdentifier = identifierForFamily(family))
 215 return CSSValuePool::singleton().createIdentifierValue(familyIdentifier);
 216 return CSSValuePool::singleton().createFontFamilyValue(family);
192217}
193218
194219}

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(FontFace& owner, SharedBuffer& 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(FontFace& 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(FontFace& 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(FontFace& 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(FontFace& 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 "CSSFontSelector.h"
 30#include "CachedFont.h"
 31#include "FontFace.h"
 32
 33namespace WebCore {
 34
 35RemoteFontFaceSource::RemoteFontFaceSource(FontFace& 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(FontFace& 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/css/RuleSet.cpp

@@void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase>>& rules, const Me
341341 addChildRules(mediaRule.childRules(), medium, resolver, hasDocumentSecurityOrigin, isInitiatingElementInUserAgentShadowTree, addRuleFlags);
342342 } else if (is<StyleRuleFontFace>(*rule) && resolver) {
343343 // Add this font face to our set.
344  resolver->document().fontSelector().addFontFaceRule(downcast<StyleRuleFontFace>(*rule.get()), isInitiatingElementInUserAgentShadowTree);
 344 resolver->document().fontSelector().addFontFaceRule(downcast<StyleRuleFontFace>(*rule.get()).properties(), isInitiatingElementInUserAgentShadowTree);
345345 resolver->invalidateMatchedPropertiesCache();
346346 } else if (is<StyleRuleKeyframes>(*rule) && resolver)
347347 resolver->addKeyframeStyle(downcast<StyleRuleKeyframes>(rule.get()));

Source/WebCore/css/StyleBuilderCustom.h

@@inline void StyleBuilderCustom::applyInitialFontVariantLigatures(StyleResolver&
14071407inline void StyleBuilderCustom::applyValueFontVariantLigatures(StyleResolver& styleResolver, CSSValue& value)
14081408{
14091409 auto fontDescription = styleResolver.fontDescription();
1410  WebCore::applyValueFontVariantLigatures(fontDescription, value);
 1410 WebCore::applyValueFontVariantLigatures(value, [&](FontVariantLigatures common, FontVariantLigatures discretionary, FontVariantLigatures historical, FontVariantLigatures contextualAlternates) {
 1411 fontDescription.setVariantCommonLigatures(common);
 1412 fontDescription.setVariantDiscretionaryLigatures(discretionary);
 1413 fontDescription.setVariantHistoricalLigatures(historical);
 1414 fontDescription.setVariantContextualAlternates(contextualAlternates);
 1415 });
14111416 styleResolver.setFontDescription(fontDescription);
14121417}
14131418

@@inline void StyleBuilderCustom::applyInitialFontVariantNumeric(StyleResolver& st
14361441inline void StyleBuilderCustom::applyValueFontVariantNumeric(StyleResolver& styleResolver, CSSValue& value)
14371442{
14381443 auto fontDescription = styleResolver.fontDescription();
1439  WebCore::applyValueFontVariantNumeric(fontDescription, value);
 1444 WebCore::applyValueFontVariantNumeric(value, [&](FontVariantNumericFigure figure, FontVariantNumericSpacing spacing, FontVariantNumericFraction fraction, FontVariantNumericOrdinal ordinal, FontVariantNumericSlashedZero slashedZero) {
 1445 fontDescription.setVariantNumericFigure(figure);
 1446 fontDescription.setVariantNumericSpacing(spacing);
 1447 fontDescription.setVariantNumericFraction(fraction);
 1448 fontDescription.setVariantNumericOrdinal(ordinal);
 1449 fontDescription.setVariantNumericSlashedZero(slashedZero);
 1450 });
14401451 styleResolver.setFontDescription(fontDescription);
14411452}
14421453

@@inline void StyleBuilderCustom::applyInitialFontVariantEastAsian(StyleResolver&
14611472inline void StyleBuilderCustom::applyValueFontVariantEastAsian(StyleResolver& styleResolver, CSSValue& value)
14621473{
14631474 auto fontDescription = styleResolver.fontDescription();
1464  WebCore::applyValueFontVariantEastAsian(fontDescription, value);
 1475 WebCore::applyValueFontVariantEastAsian(value, [&](FontVariantEastAsianVariant variant, FontVariantEastAsianWidth width, FontVariantEastAsianRuby ruby) {
 1476 fontDescription.setVariantEastAsianVariant(variant);
 1477 fontDescription.setVariantEastAsianWidth(width);
 1478 fontDescription.setVariantEastAsianRuby(ruby);
 1479 });
14651480 styleResolver.setFontDescription(fontDescription);
14661481}
14671482

Source/WebCore/css/StyleResolver.cpp

@@StyleResolver::StyleResolver(Document& document)
277277 if (m_document.svgExtensions()) {
278278 const HashSet<SVGFontFaceElement*>& svgFontFaceElements = m_document.svgExtensions()->svgFontFaceElements();
279279 for (auto* svgFontFaceElement : svgFontFaceElements)
280  m_document.fontSelector().addFontFaceRule(svgFontFaceElement->fontFaceRule(), svgFontFaceElement->isInUserAgentShadowTree());
 280 m_document.fontSelector().addFontFaceRule(svgFontFaceElement->fontFaceRule().properties(), svgFontFaceElement->isInUserAgentShadowTree());
281281 }
282282#endif
283283}

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);

Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp

@@static std::chrono::milliseconds maximumBufferingTime(CachedResource* resource)
9696 switch (resource->type()) {
9797 case CachedResource::CSSStyleSheet:
9898 case CachedResource::Script:
99 #if ENABLE(SVG_FONTS)
100  case CachedResource::SVGFontResource:
101 #endif
10299 case CachedResource::FontResource:
103100 return std::chrono::milliseconds::max();
104101 case CachedResource::ImageResource:

LayoutTests/ChangeLog

 12016-01-27 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Font Loading] Implement FontFace JavaScript object
 4 https://bugs.webkit.org/show_bug.cgi?id=153345
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/text/font-face-javascript-expected.txt: Added.
 9 * fast/text/font-face-javascript.html: Added.
 10 * js/dom/global-constructors-attributes-expected.txt:
 11 * platform/efl/js/dom/global-constructors-attributes-expected.txt:
 12 * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
 13 * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
 14 * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
 15 * platform/mac/js/dom/global-constructors-attributes-expected.txt:
 16 * platform/win/js/dom/global-constructors-attributes-expected.txt:
 17
1182016-01-27 Brady Eidson <beidson@apple.com>
219
320 LayoutTest fast/loader/stateobjects/replacestate-frequency-iframe.html is flaky on El Cap, always times out on Yosemite.

LayoutTests/fast/text/font-face-javascript-expected.txt

 1PASS new FontFace('family_name', 'url', {}).family is "family_name"
 2PASS new FontFace('family_name', 'url', {}).style is "normal"
 3PASS new FontFace('family_name', 'url', {}).weight is "normal"
 4PASS new FontFace('family_name', 'url', {}).stretch is "normal"
 5PASS new FontFace('family_name', 'url', {}).unicodeRange is "U+0-10FFFF"
 6PASS new FontFace('family_name', 'url', {}).variant is "normal"
 7PASS new FontFace('family_name', 'url', {}).featureSettings is "normal"
 8PASS new FontFace('family_name', 'url', {'style': 'style_name'}).style is "style_name"
 9PASS new FontFace('family_name', 'url', {'weight': 'weight_name'}).weight is "weight_name"
 10PASS new FontFace('family_name', 'url', {'stretch': 'stretch_name'}).stretch is "stretch_name"
 11PASS new FontFace('family_name', 'url', {'unicodeRange': 'unicodeRange_name'}).unicodeRange is "unicodeRange_name"
 12PASS new FontFace('family_name', 'url', {'variant': 'variant_name'}).variant is "variant_name"
 13PASS new FontFace('family_name', 'url', {'featureSettings': 'featureSettings_name'}).featureSettings is "featureSettings_name"
 14PASS everything.style is "style_name"
 15PASS everything.weight is "weight_name"
 16PASS everything.stretch is "stretch_name"
 17PASS everything.unicodeRange is "unicodeRange_name"
 18PASS everything.variant is "variant_name"
 19PASS everything.featureSettings is "featureSettings_name"
 20PASS everything.family is "other_family_name"
 21PASS everything.style is "other_style_name"
 22PASS everything.weight is "other_weight_name"
 23PASS everything.stretch is "other_stretch_name"
 24PASS everything.unicodeRange is "other_unicodeRange_name"
 25PASS everything.variant is "other_variant_name"
 26PASS everything.featureSettings is "other_featureSettings_name"
 27PASS new FontFace('family_name', 'url', {}) did not throw exception.
 28PASS new FontFace('family_name', newArrayBuffer, {}) did not throw exception.
 29PASS new FontFace('family_name', new DataView(newArrayBuffer), {}) did not throw exception.
 30PASS new FontFace('family_name', new Uint8Array(newArrayBuffer), {}) did not throw exception.
 31PASS new FontFace('family_name', 5, {}) threw exception TypeError: Type error.
 32PASS new FontFace('family_name', {}, {}) threw exception TypeError: Type error.
 33PASS new FontFace('family_name', new Array(), {}) threw exception TypeError: Type error.
 34PASS new FontFace('family_name', 'url', {}).status is "unloaded"
 35PASS promise1 is promise2
 36PASS promise1 is promise3
 37PASS promise1 is promise4
 38PASS promise1 is promise5
 39PASS promiseEqualityCheck.status is not "unloaded"
 40PASS successfullyParsed is true
 41
 42TEST COMPLETE
 43

LayoutTests/fast/text/font-face-javascript.html

 1<!DOCTYPE html>
 2<head>
 3<script src="../../resources/js-test-pre.js"></script>
 4</head>
 5<body>
 6<script>
 7shouldBeEqualToString("new FontFace('family_name', 'url', {}).family", "family_name");
 8shouldBeEqualToString("new FontFace('family_name', 'url', {}).style", "normal");
 9shouldBeEqualToString("new FontFace('family_name', 'url', {}).weight", "normal");
 10shouldBeEqualToString("new FontFace('family_name', 'url', {}).stretch", "normal");
 11shouldBeEqualToString("new FontFace('family_name', 'url', {}).unicodeRange", "U+0-10FFFF");
 12shouldBeEqualToString("new FontFace('family_name', 'url', {}).variant", "normal");
 13shouldBeEqualToString("new FontFace('family_name', 'url', {}).featureSettings", "normal");
 14
 15shouldBeEqualToString("new FontFace('family_name', 'url', {'style': 'style_name'}).style", "style_name");
 16shouldBeEqualToString("new FontFace('family_name', 'url', {'weight': 'weight_name'}).weight", "weight_name");
 17shouldBeEqualToString("new FontFace('family_name', 'url', {'stretch': 'stretch_name'}).stretch", "stretch_name");
 18shouldBeEqualToString("new FontFace('family_name', 'url', {'unicodeRange': 'unicodeRange_name'}).unicodeRange", "unicodeRange_name");
 19shouldBeEqualToString("new FontFace('family_name', 'url', {'variant': 'variant_name'}).variant", "variant_name");
 20shouldBeEqualToString("new FontFace('family_name', 'url', {'featureSettings': 'featureSettings_name'}).featureSettings", "featureSettings_name");
 21
 22var everything = new FontFace('family_name', 'url', {'style': 'style_name', 'weight': 'weight_name', 'stretch': 'stretch_name', 'unicodeRange': 'unicodeRange_name', 'variant': 'variant_name', 'featureSettings': 'featureSettings_name'});
 23shouldBeEqualToString("everything.style", "style_name");
 24shouldBeEqualToString("everything.weight", "weight_name");
 25shouldBeEqualToString("everything.stretch", "stretch_name");
 26shouldBeEqualToString("everything.unicodeRange", "unicodeRange_name");
 27shouldBeEqualToString("everything.variant", "variant_name");
 28shouldBeEqualToString("everything.featureSettings", "featureSettings_name");
 29
 30everything.family = "other_family_name";
 31shouldBeEqualToString("everything.family", "other_family_name");
 32everything.style = "other_style_name";
 33shouldBeEqualToString("everything.style", "other_style_name");
 34everything.weight = "other_weight_name";
 35shouldBeEqualToString("everything.weight", "other_weight_name");
 36everything.stretch = "other_stretch_name";
 37shouldBeEqualToString("everything.stretch", "other_stretch_name");
 38everything.unicodeRange = "other_unicodeRange_name";
 39shouldBeEqualToString("everything.unicodeRange", "other_unicodeRange_name");
 40everything.variant = "other_variant_name";
 41shouldBeEqualToString("everything.variant", "other_variant_name");
 42everything.featureSettings = "other_featureSettings_name";
 43shouldBeEqualToString("everything.featureSettings", "other_featureSettings_name");
 44
 45shouldNotThrow("new FontFace('family_name', 'url', {})");
 46var newArrayBuffer = new ArrayBuffer(100);
 47shouldNotThrow("new FontFace('family_name', newArrayBuffer, {})");
 48shouldNotThrow("new FontFace('family_name', new DataView(newArrayBuffer), {})");
 49shouldNotThrow("new FontFace('family_name', new Uint8Array(newArrayBuffer), {})");
 50shouldThrow("new FontFace('family_name', 5, {})");
 51shouldThrow("new FontFace('family_name', {}, {})");
 52shouldThrow("new FontFace('family_name', new Array(), {})");
 53
 54shouldBeEqualToString("new FontFace('family_name', 'url', {}).status", "unloaded");
 55
 56var promiseEqualityCheck = new FontFace('family_name', 'url', {});
 57var promise1 = promiseEqualityCheck.loaded;
 58var promise2 = promiseEqualityCheck.loaded;
 59var promise3 = promiseEqualityCheck.load();
 60var promise4 = promiseEqualityCheck.loaded;
 61var promise5 = promiseEqualityCheck.load();
 62shouldBe("promise1", "promise2");
 63shouldBe("promise1", "promise3");
 64shouldBe("promise1", "promise4");
 65shouldBe("promise1", "promise5");
 66shouldNotBeEqualToString("promiseEqualityCheck.status", "unloaded");
 67
 68</script>
 69<script src="../../resources/js-test-post.js"></script>
 70</body>
 71</html>

LayoutTests/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
358358PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
359359PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
360360PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 361PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 362PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 363PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 364PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 365PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
361366PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
362367PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
363368PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
363363PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
364364PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
365365PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 366PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 367PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 368PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 369PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 370PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
366371PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
367372PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
368373PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
368368PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
369369PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
370370PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 371PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 372PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 373PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 374PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 375PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
371376PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
372377PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
373378PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
358358PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
359359PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
360360PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 361PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 362PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 363PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 364PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 365PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
361366PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
362367PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
363368PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
358358PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
359359PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
360360PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 361PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 362PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 363PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 364PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 365PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
361366PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
362367PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
363368PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
358358PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
359359PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
360360PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 361PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 362PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 363PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 364PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 365PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
361366PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
362367PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
363368PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false

LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('get')
288288PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').hasOwnProperty('set') is false
289289PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').enumerable is false
290290PASS Object.getOwnPropertyDescriptor(global, 'FocusEvent').configurable is true
 291PASS Object.getOwnPropertyDescriptor(global, 'FontFace').value is FontFace
 292PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('get') is false
 293PASS Object.getOwnPropertyDescriptor(global, 'FontFace').hasOwnProperty('set') is false
 294PASS Object.getOwnPropertyDescriptor(global, 'FontFace').enumerable is false
 295PASS Object.getOwnPropertyDescriptor(global, 'FontFace').configurable is true
291296PASS Object.getOwnPropertyDescriptor(global, 'FormData').value is FormData
292297PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('get') is false
293298PASS Object.getOwnPropertyDescriptor(global, 'FormData').hasOwnProperty('set') is false