| Differences between
and this patch
- a/Source/WebCore/ChangeLog +177 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-01-26  Myles C. Maxfield  <mmaxfield@apple.com>
2
3
        Modularize CSSFontFaceSource
4
        https://bugs.webkit.org/show_bug.cgi?id=153414
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        CSSFontFaceSource has a few supported use cases:
9
        - Downloading remote fonts
10
        - Downloading remote SVG fonts and converting them
11
        - Downloading remote SVG fonts without converting them (Only for ports which haven't enabled the SVG -> OTF converter)
12
        - Local fonts
13
        - In-document SVG fonts and converting them
14
        - In-document SVG fonts without converting them (Only for ports which haven't enabled the SVG -> OTF converter)
15
16
        In addition, the CSS Font Loading spec adds another use case:
17
        - A font where the backing bytes are provided by JavaScript (in an ArrayBuffer). I call this "immediate data."
18
19
        All of these use cases have their own needs and requirements:
20
        - Downloading fonts requires a URL and associated loading infrastructure
21
        - Converting fonts requires the SVG -> OTF Converter
22
        - Local fonts require a family name string to look up
23
        - Immediate fonts require an array buffer to hold the bytes
24
        - In-document fonts require a reference to an SVGFontElement
25
26
        Previously, CSSFontFaceSource supported all of these use cases. Given that each use case has its own data requirements,
27
        along with the fact that these requirements are known at object creation time, this is a great opportunity for subclassing.
28
29
        There is an added benefit that, because there is a single base class for FontFaceSource, it has a uniform API, and changes
30
        to the object can be deliberately and specifically tracked as explicit state changes. This makes the mapping to the CSS Font
31
        Loading spec's "status" object much easier to understand.
32
33
        This patch migrates all these use cases to the following heirarchy of classes:
34
        - FontFaceSource
35
          - LocalFontFaceSource
36
          - InDocumentSVGFontFaceSource (when the SVG converter is not enabled; otherwise, this class does not exist)
37
          - ByteBasedFontFaceSource
38
            - ImmediateFontFaceSource
39
            - InDocumentSVGFontFaceSource (when the SVG converter is enabled; otherwise, this class does not exist)
40
            - RemoteFontFaceSource
41
              - DeprecatedRemoteSVGFontFaceSource (Only used when the SVG converter is not enabled; otherwise,
42
                    ByteBasedFontFaceSource handles this case)
43
44
        FontFaceSource is the base class, and is modelled as a state machine. The state diagram looks like this:
45
                            => Succeeded
46
                          //
47
        Pending => Loading
48
                          \\
49
                            => Failed
50
51
        Note that in this model, there is no distinction between a download failure, encoding failure, conversion failure, or any
52
        other kind of failure. This is a feature.
53
54
        FontFaceSource exposes two API functions:
55
        - load() can be called when in the Pending state, and will take you to any of the downstream states.
56
        - font() can be called when in the Succeeded state only. This function will try to create a Font object, but it may
57
          still fail (even though we're in the Succeeded state). This means that, even if you're in the Succeeded state, you
58
          aren't guaranteed to be able to create a Font.
59
60
        FontFaceSources are owned by a FontFace, and FontFaceSources maintain a raw pointer to their owner. Fonts internally handle
61
        the transition from the Loading to Succeeded / Failed state (possibly asynchronously, in the case of RemoteFontFaceSource).
62
        If any state transition occurred asynchronously, the owning FontFace has a kick() method which simply notifies it that something
63
        happened. It is then up to the FontFace to figure out what happened (since the FontFaceSource could be in eiter the Succeeded
64
        or Failed state).
65
66
        A possible future implementation of font downloading timeouts fits this model well, by adding a new state between Loading and
67
        Succeeded / Failed.
68
69
        FontFaceSource (the base class) also handles caching the result of the font() function. This is elegant because the result of
70
        this function should be cached for all the subclasses.
71
72
        No new tests because there is no behavior change.
73
74
        * CMakeLists.txt: Add all the new files.
75
        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
76
        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
77
        * WebCore.xcodeproj/project.pbxproj: Ditto.
78
        * css/ByteBasedFontFaceSource.cpp: Added. This class handles the following things:
79
          a) Calling the SVG -> OTF font converter on bytes that we have received
80
          b) Transcodint WOFF fonts to TTF/OTF (on ports which require this)
81
          b) Interacting with FontCustomPlatformData in order to create the real underlying platform font object which represents
82
                 the downloaded bytes
83
        (WebCore::ByteBasedFontFaceSource::ByteBasedFontFaceSource):
84
        (WebCore::ByteBasedFontFaceSource::getSVGFontById): Used for performing SVG -> OTF font conversion
85
        (WebCore::ByteBasedFontFaceSource::bufferProvided): Subclasses call this function when they have their buffer of bytes. This
86
        function performs as much processing as possible on that buffer (now, as opposed to later, so we can enter the failure state
87
        early).
88
        (WebCore::ByteBasedFontFaceSource::createFont): Use the FontCustomPlatformData.
89
        * css/ByteBasedFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
90
        * css/CSSAllInOne.cpp: Add all the new files.
91
        * css/CSSFontFace.cpp: Update to use the new API of FontFaceSource.
92
        (WebCore::CSSFontFace::allSourcesHaveFailed):
93
        (WebCore::CSSFontFace::addSource):
94
        (WebCore::CSSFontFace::kick):
95
        (WebCore::CSSFontFace::font): Pump the state machines of the underlying FontFaceSources.
96
        (WebCore::CSSFontFace::isValid): Deleted.
97
        (WebCore::CSSFontFace::fontLoaded): Deleted.
98
        (WebCore::CSSFontFace::notifyFontLoader): Deleted.
99
        (WebCore::CSSFontFace::notifyLoadingDone): Deleted.
100
        (WebCore::CSSFontFace::hasSVGFontFaceSource): Deleted.
101
        * css/CSSFontFace.h: Update to use the new API of FontFaceSource.
102
        (WebCore::CSSFontFace::create):
103
        (WebCore::CSSFontFace::CSSFontFace):
104
        (WebCore::CSSFontFace::loadState): Deleted.
105
        * css/CSSFontFaceSource.cpp: Removed. Out with the old, in with the new
106
        * css/CSSFontFaceSource.h: Removed.
107
        * css/CSSFontSelector.cpp: Update to create the new FontFaceSource objects.
108
        (WebCore::createFontFace):
109
        (WebCore::registerLocalFontFacesForFamily):
110
        (WebCore::CSSFontSelector::addFontFaceRule):
111
        * css/CSSSegmentedFontFace.cpp: 
112
        (WebCore::CSSSegmentedFontFace::fontRanges): Update to new API.
113
        * css/DeprecatedInDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Used on platforms
114
        which don't use the SVG -> OTF font converter.
115
        (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
116
        (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
117
        (WebCore::InDocumentSVGFontFaceSource::createFont):
118
        * css/DeprecatedInDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Used on platforms
119
        which don't use the SVG -> OTF font converter.
120
        * css/DeprecatedRemoteSVGFontFaceSource.cpp: Added.
121
        (WebCore::DeprecatedRemoteSVGFontFaceSource::DeprecatedRemoteSVGFontFaceSource):
122
        (WebCore::DeprecatedRemoteSVGFontFaceSource::bufferProvided):
123
        (WebCore::DeprecatedRemoteSVGFontFaceSource::createFont):
124
        * css/DeprecatedRemoteSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
125
        * css/FontFaceSource.cpp: Added. Base class, explained above. Handles caching.
126
        (WebCore::FontFaceSource::HashKey::HashKey):
127
        (WebCore::FontFaceSource::HashKey::isHashTableDeletedValue):
128
        (WebCore::FontFaceSource::HashKey::operator==):
129
        (WebCore::FontFaceSource::HashKey::operator!=):
130
        (WebCore::FontFaceSource::HashKey::hash):
131
        (WebCore::FontFaceSource::HashKey::equal):
132
        (WebCore::FontFaceSource::FontFaceSource):
133
        (WebCore::FontFaceSource::load):
134
        (WebCore::FontFaceSource::font):
135
        * css/FontFaceSource.h: Added.
136
        (WebCore::FontFaceSource::~FontFaceSource):
137
        (WebCore::FontFaceSource::state):
138
        (WebCore::FontFaceSource::owner):
139
        (WebCore::FontFaceSource::setState):
140
        (WebCore::FontFaceSource::shouldCache):
141
        * css/FontLoader.cpp:
142
        * css/ImmediateFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Supporting the new use case in the
143
        CSS FontLoading spec.
144
        * css/InDocumentSVGFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
145
        (WebCore::InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource):
146
        (WebCore::InDocumentSVGFontFaceSource::initiateLoad):
147
        * css/InDocumentSVGFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
148
        * css/LocalFontFaceSource.cpp: Copied from Source/WebCore/loader/cache/CachedFontClient.h. Represents local(Helvetica) or something
149
        like that.
150
        (WebCore::LocalFontFaceSource::LocalFontFaceSource):
151
        (WebCore::LocalFontFaceSource::initiateLoad):
152
        (WebCore::LocalFontFaceSource::createFont):
153
        * css/LocalFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
154
        * css/RemoteFontFaceSource.cpp: Added. Uses the existing CachedResourceLoader infrastructure, but simply puts the new FontFaceSource
155
        API on top of it. Kicks the owner if something asynchronous happened.
156
        (WebCore::RemoteFontFaceSource::RemoteFontFaceSource):
157
        (WebCore::RemoteFontFaceSource::~RemoteFontFaceSource):
158
        (WebCore::RemoteFontFaceSource::initiateLoad):
159
        (WebCore::RemoteFontFaceSource::fontLoaded):
160
        * css/RemoteFontFaceSource.h: Copied from Source/WebCore/loader/cache/CachedFontClient.h.
161
        * loader/cache/CachedFont.cpp: Update to new API.
162
        (WebCore::CachedFont::didAddClient):
163
        (WebCore::CachedFont::checkNotify):
164
        * loader/cache/CachedFont.h: Ditto.
165
        (WebCore::CachedFont::setHasCreatedFontDataWrappingResource):
166
        * loader/cache/CachedFontClient.h: Ditto.
167
        (WebCore::CachedFontClient::fontLoaded):
168
        * platform/graphics/FontCache.h: Cleanup.
169
        (WebCore::FontDescriptionKey::makeFlagsKey):
170
        * platform/graphics/mac/FontCustomPlatformData.cpp: Helpful comment.
171
        (WebCore::FontCustomPlatformData::fontPlatformData):
172
        * platform/text/TextFlags.h: Cleanup.
173
        (WebCore::FontVariantSettings::operator==):
174
        (WebCore::FontVariantSettings::uniqueValue):
175
        (WebCore::FontVariantSettings::hash):
176
        * svg/SVGFontData.h: Updating comment.
177
1
2016-01-26  Dean Jackson  <dino@apple.com>
178
2016-01-26  Dean Jackson  <dino@apple.com>
2
179
3
        [iOS] Documents without an explicit width should not get fast tapping
180
        [iOS] Documents without an explicit width should not get fast tapping
- a/Source/WebCore/CMakeLists.txt -1 / +7 lines
Lines 1286-1291 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
1286
    contentextensions/URLFilterParser.cpp
1286
    contentextensions/URLFilterParser.cpp
1287
1287
1288
    css/BasicShapeFunctions.cpp
1288
    css/BasicShapeFunctions.cpp
1289
    css/ByteBasedFontFaceSource.cpp
1289
    css/CSSAspectRatioValue.cpp
1290
    css/CSSAspectRatioValue.cpp
1290
    css/CSSBasicShapes.cpp
1291
    css/CSSBasicShapes.cpp
1291
    css/CSSBorderImage.cpp
1292
    css/CSSBorderImage.cpp
Lines 1302-1308 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec2
1302
    css/CSSFontFace.cpp
1303
    css/CSSFontFace.cpp
1303
    css/CSSFontFaceLoadEvent.cpp
1304
    css/CSSFontFaceLoadEvent.cpp
1304
    css/CSSFontFaceRule.cpp
1305
    css/CSSFontFaceRule.cpp
1305
    css/CSSFontFaceSource.cpp
1306
    css/CSSFontFaceSrcValue.cpp
1306
    css/CSSFontFaceSrcValue.cpp
1307
    css/CSSFontFeatureValue.cpp
1307
    css/CSSFontFeatureValue.cpp
1308
    css/CSSFontSelector.cpp
1308
    css/CSSFontSelector.cpp
Lines 1351-1362 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec3
1351
    css/CSSValuePool.cpp
1351
    css/CSSValuePool.cpp
1352
    css/CSSVariableDependentValue.cpp
1352
    css/CSSVariableDependentValue.cpp
1353
    css/CSSVariableValue.cpp
1353
    css/CSSVariableValue.cpp
1354
    css/DeprecatedInDocumentSVGFontFaceSource.cpp
1355
    css/DeprecatedRemoteSVGFontFaceSource.cpp
1354
    css/DOMWindowCSS.cpp
1356
    css/DOMWindowCSS.cpp
1355
    css/DocumentRuleSets.cpp
1357
    css/DocumentRuleSets.cpp
1356
    css/ElementRuleCollector.cpp
1358
    css/ElementRuleCollector.cpp
1359
    css/FontFaceSource.cpp
1357
    css/FontLoader.cpp
1360
    css/FontLoader.cpp
1361
    css/InDocumentSVGFontFaceSource.cpp
1358
    css/InspectorCSSOMWrappers.cpp
1362
    css/InspectorCSSOMWrappers.cpp
1359
    css/LengthFunctions.cpp
1363
    css/LengthFunctions.cpp
1364
    css/LocalFontFaceSource.cpp
1360
    css/MediaFeatureNames.cpp
1365
    css/MediaFeatureNames.cpp
1361
    css/MediaList.cpp
1366
    css/MediaList.cpp
1362
    css/MediaQuery.cpp
1367
    css/MediaQuery.cpp
Lines 1367-1372 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec4
1367
    css/PageRuleCollector.cpp
1372
    css/PageRuleCollector.cpp
1368
    css/PropertySetCSSStyleDeclaration.cpp
1373
    css/PropertySetCSSStyleDeclaration.cpp
1369
    css/RGBColor.cpp
1374
    css/RGBColor.cpp
1375
    css/RemoteFontFaceSource.cpp
1370
    css/RuleFeature.cpp
1376
    css/RuleFeature.cpp
1371
    css/RuleSet.cpp
1377
    css/RuleSet.cpp
1372
    css/SVGCSSComputedStyleDeclaration.cpp
1378
    css/SVGCSSComputedStyleDeclaration.cpp
- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj -2 / +93 lines
Lines 9623-9629 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj_sec1
9623
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9623
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9624
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9624
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9625
    </ClCompile>
9625
    </ClCompile>
9626
    <ClCompile Include="..\css\CSSFontFaceSource.cpp">
9626
    <ClCompile Include="..\css\FontFaceSource.cpp">
9627
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9628
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9629
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9630
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9631
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9632
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9633
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9634
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9635
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9636
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9637
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9638
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9639
    </ClCompile>
9640
    <ClCompile Include="..\css\LocalFontFaceSource.cpp">
9641
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9642
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9643
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9644
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9645
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9646
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9647
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9648
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9649
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9650
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9651
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9652
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9653
    </ClCompile>
9654
    <ClCompile Include="..\css\ByteBasedFontFaceSource.cpp">
9655
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9656
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9657
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9658
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9659
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9660
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9661
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9662
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9663
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9664
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9665
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9666
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9667
    </ClCompile>
9668
    <ClCompile Include="..\css\RemoteFontFaceSource.cpp">
9669
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9670
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9671
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9672
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9673
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9674
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9675
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9676
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9677
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9678
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9679
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9680
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9681
    </ClCompile>
9682
    <ClCompile Include="..\css\InDocumentSVGFontFaceSource.cpp">
9683
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9684
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9685
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9686
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9687
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9688
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9689
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9690
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9691
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9692
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9693
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9694
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9695
    </ClCompile>
9696
    <ClCompile Include="..\css\DeprecatedInDocumentSVGFontFaceSource.cpp">
9697
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9698
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9699
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9700
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
9701
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
9702
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
9703
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
9704
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
9705
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
9706
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
9707
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
9708
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
9709
    </ClCompile>
9710
    <ClCompile Include="..\css\DeprecatedRemoteSVGFontFaceSource.cpp">
9627
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9711
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
9628
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9712
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
9629
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
9713
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
Lines 21614-21620 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj_sec2
21614
    <ClInclude Include="..\css\CSSFontFace.h" />
21698
    <ClInclude Include="..\css\CSSFontFace.h" />
21615
    <ClInclude Include="..\css\CSSFontFaceLoadEvent.h" />
21699
    <ClInclude Include="..\css\CSSFontFaceLoadEvent.h" />
21616
    <ClInclude Include="..\css\CSSFontFaceRule.h" />
21700
    <ClInclude Include="..\css\CSSFontFaceRule.h" />
21617
    <ClInclude Include="..\css\CSSFontFaceSource.h" />
21701
    <ClInclude Include="..\css\FontFaceSource.h" />
21702
    <ClInclude Include="..\css\LocalFontFaceSource.h" />
21703
    <ClInclude Include="..\css\ByteBasedFontFaceSource.h" />
21704
    <ClInclude Include="..\css\RemoteFontFaceSource.h" />
21705
    <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h" />
21706
    <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h" />
21707
    <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h" />
21708
    <ClInclude Include="..\css\ImmediateFontFaceSource.h" />
21618
    <ClInclude Include="..\css\CSSFontFaceSrcValue.h" />
21709
    <ClInclude Include="..\css\CSSFontFaceSrcValue.h" />
21619
    <ClInclude Include="..\css\CSSFontFeatureValue.h" />
21710
    <ClInclude Include="..\css\CSSFontFeatureValue.h" />
21620
    <ClInclude Include="..\css\CSSFontSelector.h" />
21711
    <ClInclude Include="..\css\CSSFontSelector.h" />
- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters -2 / +41 lines
Lines 2087-2093 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters_sec1
2087
    <ClCompile Include="..\css\CSSFontFaceRule.cpp">
2087
    <ClCompile Include="..\css\CSSFontFaceRule.cpp">
2088
      <Filter>css</Filter>
2088
      <Filter>css</Filter>
2089
    </ClCompile>
2089
    </ClCompile>
2090
    <ClCompile Include="..\css\CSSFontFaceSource.cpp">
2090
    <ClCompile Include="..\css\FontFaceSource.cpp">
2091
      <Filter>css</Filter>
2092
    </ClCompile>
2093
    <ClCompile Include="..\css\LocalFontFaceSource.cpp">
2094
      <Filter>css</Filter>
2095
    </ClCompile>
2096
    <ClCompile Include="..\css\ByteBasedFontFaceSource.cpp">
2097
      <Filter>css</Filter>
2098
    </ClCompile>
2099
    <ClCompile Include="..\css\RemoteFontFaceSource.cpp">
2100
      <Filter>css</Filter>
2101
    </ClCompile>
2102
    <ClCompile Include="..\css\InDocumentSVGFontFaceSource.cpp">
2103
      <Filter>css</Filter>
2104
    </ClCompile>
2105
    <ClCompile Include="..\css\DeprecatedInDocumentSVGFontFaceSource.cpp">
2106
      <Filter>css</Filter>
2107
    </ClCompile>
2108
    <ClCompile Include="..\css\DeprecatedRemoteSVGFontFaceSource.cpp">
2091
      <Filter>css</Filter>
2109
      <Filter>css</Filter>
2092
    </ClCompile>
2110
    </ClCompile>
2093
    <ClCompile Include="..\css\CSSFontFaceSrcValue.cpp">
2111
    <ClCompile Include="..\css\CSSFontFaceSrcValue.cpp">
Lines 9049-9055 a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters_sec2
9049
    <ClInclude Include="..\css\CSSFontFaceRule.h">
9067
    <ClInclude Include="..\css\CSSFontFaceRule.h">
9050
      <Filter>css</Filter>
9068
      <Filter>css</Filter>
9051
    </ClInclude>
9069
    </ClInclude>
9052
    <ClInclude Include="..\css\CSSFontFaceSource.h">
9070
    <ClInclude Include="..\css\FontFaceSource.h">
9071
      <Filter>css</Filter>
9072
    </ClInclude>
9073
    <ClInclude Include="..\css\LocalFontFaceSource.h">
9074
      <Filter>css</Filter>
9075
    </ClInclude>
9076
    <ClInclude Include="..\css\ByteBasedFontFaceSource.h">
9077
      <Filter>css</Filter>
9078
    </ClInclude>
9079
    <ClInclude Include="..\css\RemoteFontFaceSource.h">
9080
      <Filter>css</Filter>
9081
    </ClInclude>
9082
    <ClInclude Include="..\css\InDocumentSVGFontFaceSource.h">
9083
      <Filter>css</Filter>
9084
    </ClInclude>
9085
    <ClInclude Include="..\css\DeprecatedInDocumentSVGFontFaceSource.h">
9086
      <Filter>css</Filter>
9087
    </ClInclude>
9088
    <ClInclude Include="..\css\DeprecatedRemoteSVGFontFaceSource.h">
9089
      <Filter>css</Filter>
9090
    </ClInclude>
9091
    <ClInclude Include="..\css\ImmediateFontFaceSource.h">
9053
      <Filter>css</Filter>
9092
      <Filter>css</Filter>
9054
    </ClInclude>
9093
    </ClInclude>
9055
    <ClInclude Include="..\css\CSSFontFaceSrcValue.h">
9094
    <ClInclude Include="..\css\CSSFontFaceSrcValue.h">
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -8 / +60 lines
Lines 5560-5567 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
5560
		BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CA0CB4295D005F2B62 /* CachedFont.h */; };
5560
		BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CA0CB4295D005F2B62 /* CachedFont.h */; };
5561
		BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */; };
5561
		BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */; };
5562
		BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */; };
5562
		BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */; };
5563
		BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */; };
5564
		BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */; };
5565
		BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */; };
5563
		BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */; };
5566
		BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */; };
5564
		BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */; };
5567
		BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */; };
5565
		BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */; };
Lines 5874-5879 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
5874
		C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
5872
		C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
5875
		C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
5873
		C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
5876
		C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */; };
5874
		C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */; };
5875
		C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */; };
5876
		C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */; };
5877
		C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */; };
5878
		C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */; };
5879
		C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */; };
5880
		C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */; };
5881
		C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */; };
5882
		C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */; };
5883
		C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */; };
5884
		C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */; };
5885
		C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */; };
5886
		C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */; };
5887
		C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */; };
5888
		C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */; };
5889
		C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */; };
5877
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5890
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5878
		C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
5891
		C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
5879
		C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };
5892
		C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };
Lines 13370-13377 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
13370
		BC64B4CA0CB4295D005F2B62 /* CachedFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFont.h; sourceTree = "<group>"; };
13383
		BC64B4CA0CB4295D005F2B62 /* CachedFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFont.h; sourceTree = "<group>"; };
13371
		BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFace.cpp; sourceTree = "<group>"; };
13384
		BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFace.cpp; sourceTree = "<group>"; };
13372
		BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFace.h; sourceTree = "<group>"; };
13385
		BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFace.h; sourceTree = "<group>"; };
13373
		BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSource.cpp; sourceTree = "<group>"; };
13374
		BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSource.h; sourceTree = "<group>"; };
13375
		BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSrcValue.cpp; sourceTree = "<group>"; };
13386
		BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSrcValue.cpp; sourceTree = "<group>"; };
13376
		BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSrcValue.h; sourceTree = "<group>"; };
13387
		BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSrcValue.h; sourceTree = "<group>"; };
13377
		BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontSelector.cpp; sourceTree = "<group>"; };
13388
		BC64B4D30CB4298A005F2B62 /* CSSFontSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontSelector.cpp; sourceTree = "<group>"; };
Lines 13719-13725 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
13719
		C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
13730
		C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
13720
		C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontVariantBuilder.h; sourceTree = "<group>"; };
13731
		C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontVariantBuilder.h; sourceTree = "<group>"; };
13721
		C24685131A148E1800811792 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
13732
		C24685131A148E1800811792 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
13733
		C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedInDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
13734
		C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedInDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
13735
		C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeprecatedRemoteSVGFontFaceSource.cpp; sourceTree = "<group>"; };
13736
		C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedRemoteSVGFontFaceSource.h; sourceTree = "<group>"; };
13722
		C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
13737
		C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
13738
		C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFaceSource.cpp; sourceTree = "<group>"; };
13739
		C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFaceSource.h; sourceTree = "<group>"; };
13740
		C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalFontFaceSource.cpp; sourceTree = "<group>"; };
13741
		C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalFontFaceSource.h; sourceTree = "<group>"; };
13742
		C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteBasedFontFaceSource.cpp; sourceTree = "<group>"; };
13743
		C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteBasedFontFaceSource.h; sourceTree = "<group>"; };
13744
		C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteFontFaceSource.cpp; sourceTree = "<group>"; };
13745
		C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteFontFaceSource.h; sourceTree = "<group>"; };
13746
		C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImmediateFontFaceSource.h; sourceTree = "<group>"; };
13747
		C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InDocumentSVGFontFaceSource.cpp; sourceTree = "<group>"; };
13748
		C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InDocumentSVGFontFaceSource.h; sourceTree = "<group>"; };
13723
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
13749
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
13724
		C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
13750
		C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
13725
		C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };
13751
		C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };
Lines 23307-23314 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
23307
				A80E6CBD0A1989CA007FB8C5 /* CSSFontFaceRule.cpp */,
23333
				A80E6CBD0A1989CA007FB8C5 /* CSSFontFaceRule.cpp */,
23308
				A80E6CD30A1989CA007FB8C5 /* CSSFontFaceRule.h */,
23334
				A80E6CD30A1989CA007FB8C5 /* CSSFontFaceRule.h */,
23309
				85C56CA30AA89CA400D95755 /* CSSFontFaceRule.idl */,
23335
				85C56CA30AA89CA400D95755 /* CSSFontFaceRule.idl */,
23310
				BC64B4CF0CB4298A005F2B62 /* CSSFontFaceSource.cpp */,
23311
				BC64B4D00CB4298A005F2B62 /* CSSFontFaceSource.h */,
23312
				BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */,
23336
				BC64B4D10CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp */,
23313
				BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */,
23337
				BC64B4D20CB4298A005F2B62 /* CSSFontFaceSrcValue.h */,
23314
				83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */,
23338
				83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */,
Lines 23550-23555 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
23550
				3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
23574
				3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
23551
				3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
23575
				3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
23552
				3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
23576
				3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
23577
				C2C73BD41C55671E00DF6B6B /* FontFaceSource.cpp */,
23578
				C2C73BD51C55671E00DF6B6B /* FontFaceSource.h */,
23579
				C2C73BD81C5580DC00DF6B6B /* LocalFontFaceSource.cpp */,
23580
				C2C73BD91C5580DC00DF6B6B /* LocalFontFaceSource.h */,
23581
				C2C73BDC1C558A3B00DF6B6B /* ByteBasedFontFaceSource.cpp */,
23582
				C2C73BDD1C558A3B00DF6B6B /* ByteBasedFontFaceSource.h */,
23583
				C2C73BE41C55A11800DF6B6B /* RemoteFontFaceSource.cpp */,
23584
				C2C73BE51C55A11800DF6B6B /* RemoteFontFaceSource.h */,
23585
				C2C73BED1C55B01C00DF6B6B /* ImmediateFontFaceSource.h */,
23586
				C2C73BF01C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp */,
23587
				C2C73BF11C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h */,
23588
				C249A84E1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp */,
23589
				C249A84F1C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h */,
23590
				C249A8521C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp */,
23591
				C249A8531C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h */,
23553
			);
23592
			);
23554
			path = css;
23593
			path = css;
23555
			sourceTree = "<group>";
23594
			sourceTree = "<group>";
Lines 24921-24926 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
24921
				C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
24960
				C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
24922
				F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
24961
				F55B3DB41251F12D003EF269 /* ColorInputType.h in Headers */,
24923
				EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
24962
				EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
24963
				C249A8511C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.h in Headers */,
24924
				9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
24964
				9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
24925
				BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
24965
				BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
24926
				43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,
24966
				43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */,
Lines 25046-25052 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
25046
				BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */,
25086
				BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */,
25047
				409EBDB116B7EE7100CBA3FC /* CSSFontFaceLoadEvent.h in Headers */,
25087
				409EBDB116B7EE7100CBA3FC /* CSSFontFaceLoadEvent.h in Headers */,
25048
				A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */,
25088
				A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */,
25049
				BC64B4D80CB4298A005F2B62 /* CSSFontFaceSource.h in Headers */,
25050
				BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */,
25089
				BC64B4DA0CB4298A005F2B62 /* CSSFontFaceSrcValue.h in Headers */,
25051
				83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
25090
				83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
25052
				4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */,
25091
				4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */,
Lines 25565-25570 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
25565
				858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
25604
				858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
25566
				85E9E0A10AB3A0C700069CD0 /* DOMXPathExpression.h in Headers */,
25605
				85E9E0A10AB3A0C700069CD0 /* DOMXPathExpression.h in Headers */,
25567
				85E711DA0AC5D5350053270F /* DOMXPathExpressionInternal.h in Headers */,
25606
				85E711DA0AC5D5350053270F /* DOMXPathExpressionInternal.h in Headers */,
25607
				C2C73BEF1C55B01D00DF6B6B /* ImmediateFontFaceSource.h in Headers */,
25568
				85E9E0A40AB3A0C700069CD0 /* DOMXPathNSResolver.h in Headers */,
25608
				85E9E0A40AB3A0C700069CD0 /* DOMXPathNSResolver.h in Headers */,
25569
				85E9E0A50AB3A0C700069CD0 /* DOMXPathResult.h in Headers */,
25609
				85E9E0A50AB3A0C700069CD0 /* DOMXPathResult.h in Headers */,
25570
				85E711DB0AC5D5350053270F /* DOMXPathResultInternal.h in Headers */,
25610
				85E711DB0AC5D5350053270F /* DOMXPathResultInternal.h in Headers */,
Lines 25762-25767 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec10
25762
				0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */,
25802
				0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */,
25763
				46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */,
25803
				46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */,
25764
				9746AF2A14F4DDE6003E7A70 /* Geoposition.h in Headers */,
25804
				9746AF2A14F4DDE6003E7A70 /* Geoposition.h in Headers */,
25805
				C249A8551C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.h in Headers */,
25765
				086BBD0F136039C2008B15D8 /* Glyph.h in Headers */,
25806
				086BBD0F136039C2008B15D8 /* Glyph.h in Headers */,
25766
				B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
25807
				B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
25767
				C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,
25808
				C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,
Lines 26409-26414 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec11
26409
				8A9A588811E84F37008ACFD1 /* JSPerformanceTiming.h in Headers */,
26450
				8A9A588811E84F37008ACFD1 /* JSPerformanceTiming.h in Headers */,
26410
				FDEA6247152102FC00479DF0 /* JSPeriodicWave.h in Headers */,
26451
				FDEA6247152102FC00479DF0 /* JSPeriodicWave.h in Headers */,
26411
				93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */,
26452
				93B70D6C09EB0C7C009D8468 /* JSPluginElementFunctions.h in Headers */,
26453
				C2C73BDF1C558A3C00DF6B6B /* ByteBasedFontFaceSource.h in Headers */,
26412
				5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */,
26454
				5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */,
26413
				598365DD1355F557001B185D /* JSPositionCallback.h in Headers */,
26455
				598365DD1355F557001B185D /* JSPositionCallback.h in Headers */,
26414
				FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */,
26456
				FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */,
Lines 26564-26569 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec12
26564
				B2FA3DBB0AB75A6F000E5AC4 /* JSSVGPathSegArcRel.h in Headers */,
26606
				B2FA3DBB0AB75A6F000E5AC4 /* JSSVGPathSegArcRel.h in Headers */,
26565
				B2FA3DBD0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.h in Headers */,
26607
				B2FA3DBD0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.h in Headers */,
26566
				B2FA3DBF0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.h in Headers */,
26608
				B2FA3DBF0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.h in Headers */,
26609
				C2C73BE71C55A11800DF6B6B /* RemoteFontFaceSource.h in Headers */,
26567
				B2FA3DC10AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.h in Headers */,
26610
				B2FA3DC10AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.h in Headers */,
26568
				B2FA3DC30AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
26611
				B2FA3DC30AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
26569
				B2FA3DC50AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.h in Headers */,
26612
				B2FA3DC50AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.h in Headers */,
Lines 27346-27351 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec13
27346
				934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
27389
				934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
27347
				514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
27390
				514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
27348
				26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
27391
				26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
27392
				C2C73BDB1C5580DC00DF6B6B /* LocalFontFaceSource.h in Headers */,
27349
				26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */,
27393
				26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */,
27350
				514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
27394
				514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
27351
				514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
27395
				514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
Lines 27532-27537 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec14
27532
				E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */,
27576
				E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */,
27533
				582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */,
27577
				582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */,
27534
				C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
27578
				C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
27579
				C2C73BF31C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.h in Headers */,
27535
				31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */,
27580
				31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */,
27536
				FD00D7A514A3F61900734011 /* SincResampler.h in Headers */,
27581
				FD00D7A514A3F61900734011 /* SincResampler.h in Headers */,
27537
				51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */,
27582
				51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */,
Lines 28142-28147 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec15
28142
				E180810F16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.h in Headers */,
28187
				E180810F16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.h in Headers */,
28143
				E152551516FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.h in Headers */,
28188
				E152551516FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.h in Headers */,
28144
				93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
28189
				93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
28190
				C2C73BD71C55671E00DF6B6B /* FontFaceSource.h in Headers */,
28145
				A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */,
28191
				A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */,
28146
				A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */,
28192
				A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */,
28147
				A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */,
28193
				A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */,
Lines 28712-28717 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec16
28712
				29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
28758
				29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
28713
				BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
28759
				BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
28714
				BCA8CA5F11E4E6D100812FB7 /* BackForwardList.cpp in Sources */,
28760
				BCA8CA5F11E4E6D100812FB7 /* BackForwardList.cpp in Sources */,
28761
				C249A8501C574E8B0037FA8F /* DeprecatedInDocumentSVGFontFaceSource.cpp in Sources */,
28715
				BC124EE70C2641CD009E2349 /* BarProp.cpp in Sources */,
28762
				BC124EE70C2641CD009E2349 /* BarProp.cpp in Sources */,
28716
				379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
28763
				379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
28717
				379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,
28764
				379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,
Lines 28750-28755 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec17
28750
				1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */,
28797
				1A569CF70D7E2B82007C3983 /* c_class.cpp in Sources */,
28751
				1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
28798
				1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
28752
				1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
28799
				1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
28800
				C2C73BDA1C5580DC00DF6B6B /* LocalFontFaceSource.cpp in Sources */,
28753
				1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
28801
				1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
28754
				BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
28802
				BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
28755
				BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,
28803
				BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,
Lines 28924-28930 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec18
28924
				BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
28972
				BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
28925
				409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
28973
				409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
28926
				A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
28974
				A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
28927
				BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */,
28928
				BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
28975
				BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
28929
				4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
28976
				4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
28930
				BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,
28977
				BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,
Lines 29240-29245 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec19
29240
				31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
29287
				31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
29241
				3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
29288
				3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
29242
				8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
29289
				8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
29290
				C2C73BE61C55A11800DF6B6B /* RemoteFontFaceSource.cpp in Sources */,
29243
				31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
29291
				31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
29244
				85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
29292
				85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
29245
				1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
29293
				1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
Lines 29394-29399 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec20
29394
				085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */,
29442
				085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */,
29395
				A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
29443
				A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
29396
				7EE6846612D26E3800E79415 /* FormDataStreamCFNet.cpp in Sources */,
29444
				7EE6846612D26E3800E79415 /* FormDataStreamCFNet.cpp in Sources */,
29445
				C2C73BD61C55671E00DF6B6B /* FontFaceSource.cpp in Sources */,
29397
				514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
29446
				514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
29398
				656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
29447
				656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
29399
				41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,
29448
				41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,
Lines 30171-30176 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec21
30171
				1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
30220
				1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
30172
				B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
30221
				B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
30173
				51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
30222
				51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
30223
				C2C73BF21C55C35C00DF6B6B /* InDocumentSVGFontFaceSource.cpp in Sources */,
30174
				51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
30224
				51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
30175
				51E0BAEA0DA55D4A00A9E417 /* JSStorageEvent.cpp in Sources */,
30225
				51E0BAEA0DA55D4A00A9E417 /* JSStorageEvent.cpp in Sources */,
30176
				0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,
30226
				0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */,
Lines 30614-30619 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec22
30614
				F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
30664
				F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
30615
				85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
30665
				85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
30616
				93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
30666
				93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */,
30667
				C2C73BDE1C558A3C00DF6B6B /* ByteBasedFontFaceSource.cpp in Sources */,
30617
				85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
30668
				85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
30618
				93309DFB099E64920056E581 /* MoveSelectionCommand.cpp in Sources */,
30669
				93309DFB099E64920056E581 /* MoveSelectionCommand.cpp in Sources */,
30619
				FDB1700514A2BAB200A2B5D9 /* MultiChannelResampler.cpp in Sources */,
30670
				FDB1700514A2BAB200A2B5D9 /* MultiChannelResampler.cpp in Sources */,
Lines 31538-31543 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec23
31538
				46DB7D571B20FE46005651B2 /* VNodeTrackerCocoa.cpp in Sources */,
31589
				46DB7D571B20FE46005651B2 /* VNodeTrackerCocoa.cpp in Sources */,
31539
				BE20507918A458680080647E /* VTTCue.cpp in Sources */,
31590
				BE20507918A458680080647E /* VTTCue.cpp in Sources */,
31540
				7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
31591
				7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
31592
				C249A8541C57533A0037FA8F /* DeprecatedRemoteSVGFontFaceSource.cpp in Sources */,
31541
				7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
31593
				7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
31542
				7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */,
31594
				7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */,
31543
				A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,
31595
				A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,
- a/Source/WebCore/css/ByteBasedFontFaceSource.cpp +169 lines
Line 0 a/Source/WebCore/css/ByteBasedFontFaceSource.cpp_sec1
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
39
namespace WebCore {
40
41
ByteBasedFontFaceSource::ByteBasedFontFaceSource(CSSFontFace& owner, const AtomicString& remoteURI, bool performConversion)
42
    : FontFaceSource(owner)
43
    , m_remoteURI(remoteURI)
44
    , m_performConversion(performConversion)
45
{
46
}
47
48
auto 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
61
SVGFontElement* 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
80
auto 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
100
void 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
111
bool 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
    // Finally!!
153
    setState(State::Succeeded);
154
155
    return wrapping;
156
}
157
158
RefPtr<Font> ByteBasedFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
159
{
160
#if PLATFORM(COCOA)
161
    return Font::create(m_fontCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
162
#else
163
    UNUSED_PARAM(fontFaceFeatures);
164
    UNUSED_PARAM(fontFaceVariantSettings);
165
    return Font::create(m_fontCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic), true, false);
166
#endif
167
}
168
169
}
- a/Source/WebCore/css/ByteBasedFontFaceSource.h +72 lines
Line 0 a/Source/WebCore/css/ByteBasedFontFaceSource.h_sec1
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
32
namespace JSC {
33
class ArrayBuffer;
34
}
35
36
namespace WebCore {
37
38
class SharedBuffer;
39
class SVGDocument;
40
class SVGFontElement;
41
42
class ByteBasedFontFaceSource : public FontFaceSource {
43
public:
44
    ByteBasedFontFaceSource(CSSFontFace& owner, const AtomicString& remoteURI = AtomicString(), bool performConversion = true);
45
46
protected:
47
    // Return value is whether or not I added a reference to the argument.
48
    virtual bool bufferProvided(SharedBuffer&);
49
    void bufferProvided(JSC::ArrayBuffer&);
50
51
    SVGFontElement* getSVGFontById(SVGDocument&);
52
53
private:
54
    enum ConversionStatus {
55
        Unnecessary,
56
        Success,
57
        Failure
58
    };
59
60
    ConversionStatus convertWOFF(SharedBuffer&, Vector<char>& result);
61
    ConversionStatus convertSVGFont(SharedBuffer&, Vector<char>& result);
62
63
    virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&) override;
64
65
    std::unique_ptr<FontCustomPlatformData> m_fontCustomPlatformData;
66
    AtomicString m_remoteURI;
67
    bool m_performConversion;
68
};
69
70
}
71
72
#endif
- a/Source/WebCore/css/CSSAllInOne.cpp -1 / +7 lines
Lines 26-31 a/Source/WebCore/css/CSSAllInOne.cpp_sec1
26
// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
26
// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
27
 
27
 
28
#include "BasicShapeFunctions.cpp"
28
#include "BasicShapeFunctions.cpp"
29
#include "ByteBasedFontFaceSource.cpp"
29
#include "CSSAspectRatioValue.cpp"
30
#include "CSSAspectRatioValue.cpp"
30
#include "CSSBasicShapes.cpp"
31
#include "CSSBasicShapes.cpp"
31
#include "CSSBorderImage.cpp"
32
#include "CSSBorderImage.cpp"
Lines 42-48 a/Source/WebCore/css/CSSAllInOne.cpp_sec2
42
#include "CSSFontFace.cpp"
43
#include "CSSFontFace.cpp"
43
#include "CSSFontFaceLoadEvent.cpp"
44
#include "CSSFontFaceLoadEvent.cpp"
44
#include "CSSFontFaceRule.cpp"
45
#include "CSSFontFaceRule.cpp"
45
#include "CSSFontFaceSource.cpp"
46
#include "CSSFontFaceSrcValue.cpp"
46
#include "CSSFontFaceSrcValue.cpp"
47
#include "CSSFontFeatureValue.cpp"
47
#include "CSSFontFeatureValue.cpp"
48
#include "CSSFontSelector.cpp"
48
#include "CSSFontSelector.cpp"
Lines 91-101 a/Source/WebCore/css/CSSAllInOne.cpp_sec3
91
#include "CSSVariableDependentValue.cpp"
91
#include "CSSVariableDependentValue.cpp"
92
#include "CSSVariableValue.cpp"
92
#include "CSSVariableValue.cpp"
93
#include "DOMWindowCSS.cpp"
93
#include "DOMWindowCSS.cpp"
94
#include "DeprecatedInDocumentSVGFontFaceSource.cpp"
95
#include "DeprecatedRemoteSVGFontFaceSource.cpp"
94
#include "DocumentRuleSets.cpp"
96
#include "DocumentRuleSets.cpp"
95
#include "ElementRuleCollector.cpp"
97
#include "ElementRuleCollector.cpp"
98
#include "FontFaceSource.cpp"
96
#include "FontLoader.cpp"
99
#include "FontLoader.cpp"
100
#include "InDocumentSVGFontFaceSource.cpp"
97
#include "InspectorCSSOMWrappers.cpp"
101
#include "InspectorCSSOMWrappers.cpp"
98
#include "LengthFunctions.cpp"
102
#include "LengthFunctions.cpp"
103
#include "LocalFontFaceSource.cpp"
99
#include "MediaList.cpp"
104
#include "MediaList.cpp"
100
#include "MediaQuery.cpp"
105
#include "MediaQuery.cpp"
101
#include "MediaQueryEvaluator.cpp"
106
#include "MediaQueryEvaluator.cpp"
Lines 105-110 a/Source/WebCore/css/CSSAllInOne.cpp_sec4
105
#include "PageRuleCollector.cpp"
110
#include "PageRuleCollector.cpp"
106
#include "PropertySetCSSStyleDeclaration.cpp"
111
#include "PropertySetCSSStyleDeclaration.cpp"
107
#include "RGBColor.cpp"
112
#include "RGBColor.cpp"
113
#include "RemoteFontFaceSource.cpp"
108
#include "RuleFeature.cpp"
114
#include "RuleFeature.cpp"
109
#include "RuleSet.cpp"
115
#include "RuleSet.cpp"
110
#include "SVGCSSComputedStyleDeclaration.cpp"
116
#include "SVGCSSComputedStyleDeclaration.cpp"
- a/Source/WebCore/css/CSSFontFace.cpp -100 / +25 lines
Lines 26-32 a/Source/WebCore/css/CSSFontFace.cpp_sec1
26
#include "config.h"
26
#include "config.h"
27
#include "CSSFontFace.h"
27
#include "CSSFontFace.h"
28
28
29
#include "CSSFontFaceSource.h"
30
#include "CSSFontSelector.h"
29
#include "CSSFontSelector.h"
31
#include "CSSSegmentedFontFace.h"
30
#include "CSSSegmentedFontFace.h"
32
#include "Document.h"
31
#include "Document.h"
Lines 37-50 a/Source/WebCore/css/CSSFontFace.cpp_sec2
37
36
38
namespace WebCore {
37
namespace WebCore {
39
38
40
bool CSSFontFace::isValid() const
39
bool CSSFontFace::allSourcesHaveFailed() const
41
{
40
{
42
    size_t size = m_sources.size();
41
    for (auto& source : m_sources) {
43
    for (size_t i = 0; i < size; i++) {
42
        if (source->state() != FontFaceSource::State::Failed)
44
        if (m_sources[i]->isValid())
43
            return false;
45
            return true;
46
    }
44
    }
47
    return false;
45
    return true;
48
}
46
}
49
47
50
void CSSFontFace::addedToSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
48
void CSSFontFace::addedToSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
Lines 57-73 void CSSFontFace::removedFromSegmentedFontFace(CSSSegmentedFontFace* segmentedFo a/Source/WebCore/css/CSSFontFace.cpp_sec3
57
    m_segmentedFontFaces.remove(segmentedFontFace);
55
    m_segmentedFontFaces.remove(segmentedFontFace);
58
}
56
}
59
57
60
void CSSFontFace::addSource(std::unique_ptr<CSSFontFaceSource> source)
58
void CSSFontFace::addSource(std::unique_ptr<FontFaceSource>&& source)
61
{
59
{
62
    source->setFontFace(this);
63
    m_sources.append(WTFMove(source));
60
    m_sources.append(WTFMove(source));
64
}
61
}
65
62
66
void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
63
void CSSFontFace::kick(FontFaceSource&)
67
{
64
{
68
    if (source != m_activeSource)
69
        return;
70
71
    // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may
65
    // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may
72
    // require stopping in-progress font loading when the last
66
    // require stopping in-progress font loading when the last
73
    // CSSSegmentedFontFace is removed.
67
    // CSSSegmentedFontFace is removed.
Lines 79-181 void CSSFontFace::fontLoaded(CSSFontFaceSource* source) a/Source/WebCore/css/CSSFontFace.cpp_sec4
79
    CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
73
    CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
80
    fontSelector->fontLoaded();
74
    fontSelector->fontLoaded();
81
75
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)
76
    for (auto* face : m_segmentedFontFaces)
92
        face->fontLoaded(this);
77
        face->fontLoaded(this);
93
94
#if ENABLE(FONT_LOAD_EVENTS)
95
    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled())
96
        notifyLoadingDone();
97
#endif
98
}
78
}
99
79
100
RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic)
80
RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic)
101
{
81
{
102
    m_activeSource = 0;
82
    if (allSourcesHaveFailed())
103
    if (!isValid())
83
        return nullptr;
104
        return 0;
84
105
85
    for (size_t index = 0; index < m_sources.size(); ) {
106
    ASSERT(!m_segmentedFontFaces.isEmpty());
86
        switch (m_sources[index]->state()) {
107
    CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
87
        case FontFaceSource::State::Pending:
108
88
            m_sources[index]->load();
109
#if ENABLE(FONT_LOAD_EVENTS)
89
            break;
110
    if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == NotLoaded)
90
        case FontFaceSource::State::Loading:
111
        notifyFontLoader(Loading);
91
            return Font::create(FontCache::singleton().lastResortFallbackFont(fontDescription)->platformData(), true, true);
112
#endif
92
        case FontFaceSource::State::Failed:
113
93
            ++index;
114
    size_t size = m_sources.size();
94
            break;
115
    for (size_t i = 0; i < size; ++i) {
95
        case FontFaceSource::State::Succeeded:
116
        if (RefPtr<Font> result = m_sources[i]->font(fontDescription, syntheticBold, syntheticItalic, fontSelector, m_featureSettings, m_variantSettings)) {
96
            if (auto result = m_sources[index]->font(fontDescription, syntheticBold, syntheticItalic, m_featureSettings, m_variantSettings))
117
            m_activeSource = m_sources[i].get();
97
                return result;
118
#if ENABLE(FONT_LOAD_EVENTS)
98
            ++index;
119
            if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading && m_sources[i]->isLoaded()) {
99
            break;
120
                notifyFontLoader(Loaded);
121
                notifyLoadingDone();
122
            }
123
#endif
124
            return result.release();
125
        }
100
        }
126
    }
101
    }
127
102
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;
103
    return nullptr;
135
}
104
}
136
105
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
}
106
}
- a/Source/WebCore/css/CSSFontFace.h -30 / +8 lines
Lines 26-33 a/Source/WebCore/css/CSSFontFace.h_sec1
26
#ifndef CSSFontFace_h
26
#ifndef CSSFontFace_h
27
#define CSSFontFace_h
27
#define CSSFontFace_h
28
28
29
#include "CSSFontFaceRule.h"
29
#include "FontFaceSource.h"
30
#include "CSSFontFaceSource.h"
31
#include "FontFeatureSettings.h"
30
#include "FontFeatureSettings.h"
32
#include "TextFlags.h"
31
#include "TextFlags.h"
33
#include <memory>
32
#include <memory>
Lines 45-51 class Font; a/Source/WebCore/css/CSSFontFace.h_sec2
45
44
46
class CSSFontFace : public RefCounted<CSSFontFace> {
45
class CSSFontFace : public RefCounted<CSSFontFace> {
47
public:
46
public:
48
    static Ref<CSSFontFace> create(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback = false) { return adoptRef(*new CSSFontFace(traitsMask, WTFMove(rule), isLocalFallback)); }
47
    static Ref<CSSFontFace> create(FontTraitsMask traitsMask, bool isLocalFallback = false) { return adoptRef(*new CSSFontFace(traitsMask, isLocalFallback)); }
49
48
50
    FontTraitsMask traitsMask() const { return m_traitsMask; }
49
    FontTraitsMask traitsMask() const { return m_traitsMask; }
51
50
Lines 75-87 public: a/Source/WebCore/css/CSSFontFace.h_sec3
75
    void addedToSegmentedFontFace(CSSSegmentedFontFace*);
74
    void addedToSegmentedFontFace(CSSSegmentedFontFace*);
76
    void removedFromSegmentedFontFace(CSSSegmentedFontFace*);
75
    void removedFromSegmentedFontFace(CSSSegmentedFontFace*);
77
76
78
    bool isValid() const;
77
    bool allSourcesHaveFailed() const;
79
78
80
    bool isLocalFallback() const { return m_isLocalFallback; }
79
    bool isLocalFallback() const { return m_isLocalFallback; }
81
80
82
    void addSource(std::unique_ptr<CSSFontFaceSource>);
81
    void addSource(std::unique_ptr<FontFaceSource>&&);
83
82
84
    void fontLoaded(CSSFontFaceSource*);
83
    // Something asynchronous happened (but nothing in particular; if you want to know, you have to figure it out yourself).
84
    void kick(FontFaceSource&);
85
85
86
    RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic);
86
    RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic);
87
87
Lines 100-125 public: a/Source/WebCore/css/CSSFontFace.h_sec4
100
        UChar32 m_to;
100
        UChar32 m_to;
101
    };
101
    };
102
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:
103
private:
113
    CSSFontFace(FontTraitsMask traitsMask, RefPtr<CSSFontFaceRule>&& rule, bool isLocalFallback)
104
    CSSFontFace(FontTraitsMask traitsMask, bool isLocalFallback)
114
        : m_traitsMask(traitsMask)
105
        : m_traitsMask(traitsMask)
115
        , m_activeSource(0)
116
        , m_isLocalFallback(isLocalFallback)
106
        , m_isLocalFallback(isLocalFallback)
117
#if ENABLE(FONT_LOAD_EVENTS)
118
        , m_loadState(isLocalFallback ? Loaded : NotLoaded)
119
        , m_rule(rule)
120
#endif
121
    {
107
    {
122
        UNUSED_PARAM(rule);
123
    }
108
    }
124
109
125
    FontTraitsMask m_traitsMask;
110
    FontTraitsMask m_traitsMask;
Lines 127-141 private: a/Source/WebCore/css/CSSFontFace.h_sec5
127
    HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces;
112
    HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces;
128
    FontFeatureSettings m_featureSettings;
113
    FontFeatureSettings m_featureSettings;
129
    FontVariantSettings m_variantSettings;
114
    FontVariantSettings m_variantSettings;
130
    Vector<std::unique_ptr<CSSFontFaceSource>> m_sources;
115
    Vector<std::unique_ptr<FontFaceSource>> m_sources;
131
    CSSFontFaceSource* m_activeSource;
132
    bool m_isLocalFallback;
116
    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
};
117
};
140
118
141
}
119
}
- a/Source/WebCore/css/CSSFontFaceSource.cpp -163 lines
Lines 1-163 a/Source/WebCore/css/CSSFontFaceSource.cpp_sec1
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
}
- a/Source/WebCore/css/CSSFontFaceSource.h -95 lines
Lines 1-95 a/Source/WebCore/css/CSSFontFaceSource.h_sec1
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
- a/Source/WebCore/css/CSSFontSelector.cpp -24 / +29 lines
Lines 27-36 a/Source/WebCore/css/CSSFontSelector.cpp_sec1
27
#include "config.h"
27
#include "config.h"
28
#include "CSSFontSelector.h"
28
#include "CSSFontSelector.h"
29
29
30
#include "CachedFont.h"
31
#include "CSSFontFace.h"
30
#include "CSSFontFace.h"
32
#include "CSSFontFaceRule.h"
31
#include "CSSFontFaceRule.h"
33
#include "CSSFontFaceSource.h"
34
#include "CSSFontFaceSrcValue.h"
32
#include "CSSFontFaceSrcValue.h"
35
#include "CSSFontFamily.h"
33
#include "CSSFontFamily.h"
36
#include "CSSFontFeatureValue.h"
34
#include "CSSFontFeatureValue.h"
Lines 41-53 a/Source/WebCore/css/CSSFontSelector.cpp_sec2
41
#include "CSSUnicodeRangeValue.h"
39
#include "CSSUnicodeRangeValue.h"
42
#include "CSSValueKeywords.h"
40
#include "CSSValueKeywords.h"
43
#include "CSSValueList.h"
41
#include "CSSValueList.h"
42
#include "CachedFont.h"
44
#include "CachedResourceLoader.h"
43
#include "CachedResourceLoader.h"
44
#include "DeprecatedInDocumentSVGFontFaceSource.h"
45
#include "DeprecatedRemoteSVGFontFaceSource.h"
45
#include "Document.h"
46
#include "Document.h"
46
#include "Font.h"
47
#include "Font.h"
47
#include "FontCache.h"
48
#include "FontCache.h"
48
#include "FontVariantBuilder.h"
49
#include "FontVariantBuilder.h"
49
#include "Frame.h"
50
#include "Frame.h"
50
#include "FrameLoader.h"
51
#include "FrameLoader.h"
52
#include "InDocumentSVGFontFaceSource.h"
53
#include "LocalFontFaceSource.h"
54
#include "RemoteFontFaceSource.h"
51
#include "SVGFontFaceElement.h"
55
#include "SVGFontFaceElement.h"
52
#include "SVGNames.h"
56
#include "SVGNames.h"
53
#include "Settings.h"
57
#include "Settings.h"
Lines 152-167 static Optional<FontTraitsMask> computeTraitsMask(const StyleProperties& style) a/Source/WebCore/css/CSSFontSelector.cpp_sec3
152
    return static_cast<FontTraitsMask>(traitsMask);
156
    return static_cast<FontTraitsMask>(traitsMask);
153
}
157
}
154
158
155
static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask traitsMask, Document* document, const StyleRuleFontFace& fontFaceRule, bool isInitiatingElementInUserAgentShadowTree)
159
static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask traitsMask, Document* document, CSSFontSelector& fontSelector, bool isInitiatingElementInUserAgentShadowTree)
156
{
160
{
157
    RefPtr<CSSFontFaceRule> rule;
161
    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));
162
    Ref<CSSFontFace> fontFace = CSSFontFace::create(traitsMask, WTFMove(rule));
166
163
167
    int srcLength = srcList.length();
164
    int srcLength = srcList.length();
Lines 171-177 static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask tra a/Source/WebCore/css/CSSFontSelector.cpp_sec4
171
    for (int i = 0; i < srcLength; i++) {
168
    for (int i = 0; i < srcLength; i++) {
172
        // An item in the list either specifies a string (local font name) or a URL (remote font to download).
169
        // 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));
170
        CSSFontFaceSrcValue& item = downcast<CSSFontFaceSrcValue>(*srcList.itemWithoutBoundsCheck(i));
174
        std::unique_ptr<CSSFontFaceSource> source;
171
        std::unique_ptr<FontFaceSource> source;
175
172
176
#if ENABLE(SVG_FONTS)
173
#if ENABLE(SVG_FONTS)
177
        foundSVGFont = item.isSVGFontFaceSrc() || item.svgFontFaceElement();
174
        foundSVGFont = item.isSVGFontFaceSrc() || item.svgFontFaceElement();
Lines 180-197 static Ref<CSSFontFace> createFontFace(CSSValueList& srcList, FontTraitsMask tra a/Source/WebCore/css/CSSFontSelector.cpp_sec5
180
            Settings* settings = document ? document->settings() : nullptr;
177
            Settings* settings = document ? document->settings() : nullptr;
181
            bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
178
            bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
182
            if (allowDownloading && item.isSupportedFormat() && document) {
179
            if (allowDownloading && item.isSupportedFormat() && document) {
183
                if (CachedFont* cachedFont = item.cachedFont(document, foundSVGFont, isInitiatingElementInUserAgentShadowTree))
180
                if (CachedFont* cachedFont = item.cachedFont(document, foundSVGFont, isInitiatingElementInUserAgentShadowTree)) {
184
                    source = std::make_unique<CSSFontFaceSource>(item.resource(), cachedFont);
181
#if ENABLE(SVG_FONTS) && !ENABLE(SVG_OTF_CONVERTER)
182
                    if (foundSVGFont)
183
                        source = std::make_unique<DeprecatedRemoteSVGFontFaceSource>(fontFace, fontSelector, *cachedFont, item.resource());
184
                    else
185
#endif
186
                        source = std::make_unique<RemoteFontFaceSource>(fontFace, fontSelector, *cachedFont, item.resource());
187
                }
185
            }
188
            }
186
        } else
189
        } else {
187
            source = std::make_unique<CSSFontFaceSource>(item.resource());
188
189
        if (source) {
190
#if ENABLE(SVG_FONTS)
190
#if ENABLE(SVG_FONTS)
191
            source->setSVGFontFaceElement(item.svgFontFaceElement());
191
            if (auto* fontFaceElement = item.svgFontFaceElement())
192
                source = std::make_unique<InDocumentSVGFontFaceSource>(fontFace, *fontFaceElement, item.resource());
193
            else
192
#endif
194
#endif
193
            fontFace->addSource(WTFMove(source));
195
                source = std::make_unique<LocalFontFaceSource>(fontFace, item.resource());
194
        }
196
        }
197
198
        if (source)
199
            fontFace->addSource(WTFMove(source));
195
    }
200
    }
196
201
197
    return fontFace;
202
    return fontFace;
Lines 234-242 static void registerLocalFontFacesForFamily(const String& familyName, HashMap<St a/Source/WebCore/css/CSSFontSelector.cpp_sec6
234
239
235
    Vector<Ref<CSSFontFace>> faces = { };
240
    Vector<Ref<CSSFontFace>> faces = { };
236
    for (auto mask : traitsMasks) {
241
    for (auto mask : traitsMasks) {
237
        Ref<CSSFontFace> face = CSSFontFace::create(mask, nullptr, true);
242
        Ref<CSSFontFace> face = CSSFontFace::create(mask, true);
238
        face->addSource(std::make_unique<CSSFontFaceSource>(familyName));
243
        face->addSource(std::make_unique<LocalFontFaceSource>(face, familyName));
239
        ASSERT(face->isValid());
244
        ASSERT(!face->allSourcesHaveFailed());
240
        faces.append(WTFMove(face));
245
        faces.append(WTFMove(face));
241
    }
246
    }
242
    locallyInstalledFontFaces.add(familyName, WTFMove(faces));
247
    locallyInstalledFontFaces.add(familyName, WTFMove(faces));
Lines 273-280 void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace& fontFaceRule, boo a/Source/WebCore/css/CSSFontSelector.cpp_sec7
273
        return;
278
        return;
274
    auto traitsMask = computedTraitsMask.value();
279
    auto traitsMask = computedTraitsMask.value();
275
280
276
    Ref<CSSFontFace> fontFace = createFontFace(srcList, traitsMask, m_document, fontFaceRule, isInitiatingElementInUserAgentShadowTree);
281
    Ref<CSSFontFace> fontFace = createFontFace(srcList, traitsMask, m_document, *this, isInitiatingElementInUserAgentShadowTree);
277
    if (!fontFace->isValid())
282
    if (fontFace->allSourcesHaveFailed())
278
        return;
283
        return;
279
284
280
    if (rangeList) {
285
    if (rangeList) {
- a/Source/WebCore/css/CSSSegmentedFontFace.cpp -4 / +2 lines
Lines 27-33 a/Source/WebCore/css/CSSSegmentedFontFace.cpp_sec1
27
#include "CSSSegmentedFontFace.h"
27
#include "CSSSegmentedFontFace.h"
28
28
29
#include "CSSFontFace.h"
29
#include "CSSFontFace.h"
30
#include "CSSFontFaceSource.h"
31
#include "CSSFontSelector.h"
30
#include "CSSFontSelector.h"
32
#include "Document.h"
31
#include "Document.h"
33
#include "Font.h"
32
#include "Font.h"
Lines 98-111 static void appendFontWithInvalidUnicodeRangeIfLoading(FontRanges& ranges, Ref<F a/Source/WebCore/css/CSSSegmentedFontFace.cpp_sec2
98
97
99
FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription)
98
FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescription)
100
{
99
{
101
    FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
102
103
    auto addResult = m_descriptionToRangesMap.add(FontDescriptionKey(fontDescription), FontRanges());
100
    auto addResult = m_descriptionToRangesMap.add(FontDescriptionKey(fontDescription), FontRanges());
104
    auto& fontRanges = addResult.iterator->value;
101
    auto& fontRanges = addResult.iterator->value;
105
102
106
    if (addResult.isNewEntry) {
103
    if (addResult.isNewEntry) {
104
        FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
107
        for (auto& face : m_fontFaces) {
105
        for (auto& face : m_fontFaces) {
108
            if (!face->isValid())
106
            if (face->allSourcesHaveFailed())
109
                continue;
107
                continue;
110
108
111
            FontTraitsMask traitsMask = face->traitsMask();
109
            FontTraitsMask traitsMask = face->traitsMask();
- a/Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.cpp +55 lines
Line 0 a/Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.cpp_sec1
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
35
namespace WebCore {
36
37
InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement& fontFace, const AtomicString&)
38
    : FontFaceSource(owner)
39
    , m_svgFontFaceElement(fontFace)
40
{
41
}
42
43
void InDocumentSVGFontFaceSource::initiateLoad()
44
{
45
    setState(State::Succeeded);
46
}
47
48
RefPtr<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
- a/Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.h +55 lines
Line 0 a/Source/WebCore/css/DeprecatedInDocumentSVGFontFaceSource.h_sec1
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
33
namespace WebCore {
34
35
class SVGFontFaceElement;
36
37
class InDocumentSVGFontFaceSource final : public FontFaceSource {
38
public:
39
    InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement&, const AtomicString& remoteURI);
40
41
private:
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
- a/Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.cpp +76 lines
Line 0 a/Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.cpp_sec1
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
39
namespace WebCore {
40
41
DeprecatedRemoteSVGFontFaceSource::DeprecatedRemoteSVGFontFaceSource(CSSFontFace& owner, CSSFontSelector& fontSelector, CachedFont& cachedFont, const AtomicString& remoteURI)
42
    : RemoteFontFaceSource(owner, fontSelector, cachedFont, remoteURI)
43
{
44
}
45
46
bool 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
            setState(State::Succeeded);
61
            return false;
62
        }
63
    }
64
65
    setState(State::Failed);
66
    return false;
67
}
68
69
RefPtr<Font> DeprecatedRemoteSVGFontFaceSource::createFont(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&)
70
{
71
    return Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
72
}
73
74
}
75
76
#endif
- a/Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.h +55 lines
Line 0 a/Source/WebCore/css/DeprecatedRemoteSVGFontFaceSource.h_sec1
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
33
namespace WebCore {
34
35
class SVGFontFaceElement;
36
37
class DeprecatedRemoteSVGFontFaceSource final : public RemoteFontFaceSource {
38
public:
39
    DeprecatedRemoteSVGFontFaceSource(CSSFontFace& owner, CSSFontSelector&, CachedFont&, const AtomicString& remoteURI);
40
41
private:
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
- a/Source/WebCore/css/FontFaceSource.cpp +130 lines
Line 0 a/Source/WebCore/css/FontFaceSource.cpp_sec1
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
32
namespace WebCore {
33
34
FontFaceSource::HashKey::HashKey()
35
{
36
}
37
38
FontFaceSource::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
53
FontFaceSource::HashKey::HashKey(WTF::HashTableDeletedValueType)
54
    : m_size(cHashTableDeletedSize)
55
{
56
}
57
58
bool FontFaceSource::HashKey::isHashTableDeletedValue() const
59
{
60
    return m_size == cHashTableDeletedSize;
61
}
62
63
bool 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
77
bool FontFaceSource::HashKey::operator!=(const HashKey& other) const
78
{
79
    return !(*this == other);
80
}
81
82
unsigned 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
98
bool FontFaceSource::HashKey::equal(const HashKey& a, const HashKey& b)
99
{
100
    return a == b;
101
}
102
103
const unsigned FontFaceSource::HashKey::cHashTableDeletedSize = 0xFFFFFFFFU;
104
105
FontFaceSource::FontFaceSource(CSSFontFace& owner)
106
    : m_owner(owner)
107
{
108
}
109
110
void FontFaceSource::load()
111
{
112
    ASSERT(m_state == State::Pending);
113
    setState(State::Loading);
114
    initiateLoad();
115
}
116
117
RefPtr<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
}
- a/Source/WebCore/css/FontFaceSource.h +118 lines
Line 0 a/Source/WebCore/css/FontFaceSource.h_sec1
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
32
namespace WebCore {
33
34
class CSSFontFace;
35
class Font;
36
class FontDescription;
37
class FontFeatureSettings;
38
struct FontVariantSettings;
39
40
// This class represents a single clause of a src: attribute inside an @font-face block.
41
class FontFaceSource {
42
    WTF_MAKE_FAST_ALLOCATED;
43
public:
44
    FontFaceSource(CSSFontFace& owner);
45
    virtual ~FontFaceSource() { }
46
47
    //                      => Succeeded
48
    //                    //
49
    // Pending => Loading
50
    //                    \\
51
    //                      => Failed
52
    enum class State {
53
        Pending,
54
        Loading,
55
        Failed,
56
        Succeeded
57
    };
58
    State state() const { return m_state; }
59
60
    // State transition from Pending to Loading
61
    void load();
62
63
    // Subclasses handle the transition from Loading to Failed/Succeeded.
64
65
    // Only valid when state is Succeeded
66
    RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings);
67
68
protected:
69
    CSSFontFace& owner() const { return m_owner; }
70
    void setState(State state) { m_state = state; }
71
72
private:
73
    // Among the many arguments to font(), this key is only sensitive to the pieces that are actually used when creating a Font.
74
    // Other values are expected (indeed, encouraged) to collide for performance.
75
    class HashKey {
76
    public:
77
        HashKey();
78
        HashKey(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings);
79
80
        explicit HashKey(WTF::HashTableDeletedValueType);
81
82
        bool isHashTableDeletedValue() const;
83
84
        bool operator==(const HashKey& other) const;
85
        bool operator!=(const HashKey& other) const;
86
87
        static unsigned hash(const HashKey&);
88
        static bool equal(const HashKey&, const HashKey&);
89
90
        static const bool safeToCompareToEmptyOrDeleted = true;
91
92
    private:
93
        static const unsigned cHashTableDeletedSize;
94
95
        unsigned m_size { 0 };
96
        FontWidthVariant m_widthVariant { RegularWidth };
97
        FontOrientation m_orientation { Horizontal };
98
        bool m_syntheticBold { false };
99
        bool m_syntheticItalic { false };
100
        TextRenderingMode m_textRenderingMode { AutoTextRendering };
101
        FontFeatureSettings m_descriptionFeatureSettings;
102
        FontFeatureSettings m_fontFaceFeatureSettings;
103
        FontVariantSettings m_descriptionVariantSettings;
104
        FontVariantSettings m_fontFaceVariantSettings;
105
    };
106
107
    virtual bool shouldCache() const { return true; }
108
    virtual void initiateLoad() = 0;
109
    virtual RefPtr<Font> createFont(const FontDescription&, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings& fontFaceFeatureSettings, const FontVariantSettings& fontFaceVariantSettings) = 0;
110
111
    CSSFontFace& m_owner;
112
    HashMap<HashKey, RefPtr<Font>, HashKey, WTF::SimpleClassHashTraits<HashKey>> m_cache;
113
    State m_state { State::Pending };
114
};
115
116
}
117
118
#endif
- a/Source/WebCore/css/FontLoader.cpp -1 lines
Lines 29-35 a/Source/WebCore/css/FontLoader.cpp_sec1
29
#if ENABLE(FONT_LOAD_EVENTS)
29
#if ENABLE(FONT_LOAD_EVENTS)
30
30
31
#include "CSSFontFaceLoadEvent.h"
31
#include "CSSFontFaceLoadEvent.h"
32
#include "CSSFontFaceSource.h"
33
#include "CSSFontSelector.h"
32
#include "CSSFontSelector.h"
34
#include "CSSParser.h"
33
#include "CSSParser.h"
35
#include "CSSSegmentedFontFace.h"
34
#include "CSSSegmentedFontFace.h"
- a/Source/WebCore/css/ImmediateFontFaceSource.h +53 lines
Line 0 a/Source/WebCore/css/ImmediateFontFaceSource.h_sec1
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
31
namespace WebCore {
32
33
class ImmediateFontFaceSource final : public ByteBasedFontFaceSource {
34
public:
35
    ImmediateFontFaceSource(CSSFontFace& owner, JSC::ArrayBuffer& data)
36
        : ByteBasedFontFaceSource(owner)
37
    {
38
        setState(State::Loading);
39
        bufferProvided(data);
40
    }
41
42
private:
43
    virtual void initiateLoad() override
44
    {
45
        ASSERT_NOT_REACHED();
46
    }
47
};
48
49
}
50
51
#endif
52
53
- a/Source/WebCore/css/InDocumentSVGFontFaceSource.cpp +64 lines
Line 0 a/Source/WebCore/css/InDocumentSVGFontFaceSource.cpp_sec1
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
36
namespace WebCore {
37
38
InDocumentSVGFontFaceSource::InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement& fontFace, const AtomicString& remoteURI)
39
    : ByteBasedFontFaceSource(owner, remoteURI, false)
40
    , m_svgFontFaceElement(fontFace)
41
{
42
}
43
44
void 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
- a/Source/WebCore/css/InDocumentSVGFontFaceSource.h +54 lines
Line 0 a/Source/WebCore/css/InDocumentSVGFontFaceSource.h_sec1
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
34
namespace WebCore {
35
36
class SVGFontFaceElement;
37
38
class InDocumentSVGFontFaceSource final : public ByteBasedFontFaceSource {
39
public:
40
    InDocumentSVGFontFaceSource(CSSFontFace& owner, SVGFontFaceElement&, const AtomicString& remoteURI);
41
42
private:
43
    virtual void initiateLoad() override;
44
45
    Ref<SVGFontFaceElement> m_svgFontFaceElement;
46
};
47
48
}
49
50
#endif
51
52
#endif
53
54
- a/Source/WebCore/css/LocalFontFaceSource.cpp +54 lines
Line 0 a/Source/WebCore/css/LocalFontFaceSource.cpp_sec1
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
31
namespace WebCore {
32
33
LocalFontFaceSource::LocalFontFaceSource(CSSFontFace& owner, const String& familyName)
34
    : FontFaceSource(owner)
35
    , m_familyName(familyName)
36
{
37
}
38
39
void LocalFontFaceSource::initiateLoad()
40
{
41
    setState(State::Succeeded);
42
}
43
44
RefPtr<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
}
- a/Source/WebCore/css/LocalFontFaceSource.h +52 lines
Line 0 a/Source/WebCore/css/LocalFontFaceSource.h_sec1
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
31
namespace WebCore {
32
33
// This class represents an entry of "src: local(xyz)" in an @font-face block.
34
class LocalFontFaceSource final : public FontFaceSource {
35
public:
36
    LocalFontFaceSource(CSSFontFace& owner, const String& familyName);
37
38
private:
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
- a/Source/WebCore/css/RemoteFontFaceSource.cpp +75 lines
Line 0 a/Source/WebCore/css/RemoteFontFaceSource.cpp_sec1
1
/*
2
 * Copyright (C) 2016 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "RemoteFontFaceSource.h"
28
29
#include "CSSFontFace.h"
30
#include "CSSFontSelector.h"
31
#include "CachedFont.h"
32
33
namespace WebCore {
34
35
RemoteFontFaceSource::RemoteFontFaceSource(CSSFontFace& owner, CSSFontSelector& fontSelector, CachedFont& cachedFont, const AtomicString& remoteURI)
36
    : ByteBasedFontFaceSource(owner, remoteURI)
37
    , m_fontSelector(fontSelector)
38
    , m_cachedFont(cachedFont)
39
{
40
    m_cachedFont.addClient(this);
41
}
42
43
RemoteFontFaceSource::~RemoteFontFaceSource()
44
{
45
    m_cachedFont.removeClient(this);
46
}
47
48
void 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
55
void RemoteFontFaceSource::fontLoaded(CachedFont& font)
56
{
57
    ASSERT_UNUSED(font, &font == &m_cachedFont);
58
    ASSERT(!m_cachedFont.isLoading());
59
60
    // If the font is in the cache, this function will be called synchronously from CachedFont::addClient().
61
    if (state() == State::Pending)
62
        setState(State::Loading);
63
64
    if (m_cachedFont.errorOccurred() || !m_cachedFont.resourceBuffer()) {
65
        setState(State::Failed);
66
        owner().kick(*this);
67
        return;
68
    }
69
70
    m_cachedFont.setHasCreatedFontDataWrappingResource(bufferProvided(*m_cachedFont.resourceBuffer()));
71
72
    owner().kick(*this);
73
}
74
75
}
- a/Source/WebCore/css/RemoteFontFaceSource.h +54 lines
Line 0 a/Source/WebCore/css/RemoteFontFaceSource.h_sec1
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
32
namespace WebCore {
33
34
class CachedFont;
35
class CSSFontSelector;
36
37
class RemoteFontFaceSource : public ByteBasedFontFaceSource, public CachedFontClient {
38
public:
39
    RemoteFontFaceSource(CSSFontFace& owner, CSSFontSelector&, CachedFont&, const AtomicString& remoteURI);
40
    virtual ~RemoteFontFaceSource();
41
42
private:
43
    virtual void initiateLoad() override;
44
45
    // CachedFontClient
46
    virtual void fontLoaded(CachedFont&) override;
47
48
    CSSFontSelector& m_fontSelector;
49
    CachedFont& m_cachedFont;
50
};
51
52
}
53
54
#endif
- a/Source/WebCore/loader/cache/CachedFont.cpp -2 / +2 lines
Lines 73-79 void CachedFont::didAddClient(CachedResourceClient* c) a/Source/WebCore/loader/cache/CachedFont.cpp_sec1
73
{
73
{
74
    ASSERT(c->resourceClientType() == CachedFontClient::expectedType());
74
    ASSERT(c->resourceClientType() == CachedFontClient::expectedType());
75
    if (!isLoading())
75
    if (!isLoading())
76
        static_cast<CachedFontClient*>(c)->fontLoaded(this);
76
        static_cast<CachedFontClient*>(c)->fontLoaded(*this);
77
}
77
}
78
78
79
void CachedFont::finishLoading(SharedBuffer* data)
79
void CachedFont::finishLoading(SharedBuffer* data)
Lines 150-156 void CachedFont::checkNotify() a/Source/WebCore/loader/cache/CachedFont.cpp_sec2
150
    
150
    
151
    CachedResourceClientWalker<CachedFontClient> w(m_clients);
151
    CachedResourceClientWalker<CachedFontClient> w(m_clients);
152
    while (CachedFontClient* c = w.next())
152
    while (CachedFontClient* c = w.next())
153
         c->fontLoaded(this);
153
        c->fontLoaded(*this);
154
}
154
}
155
155
156
bool CachedFont::mayTryReplaceEncodedData() const
156
bool CachedFont::mayTryReplaceEncodedData() const
- a/Source/WebCore/loader/cache/CachedFont.h +2 lines
Lines 49-54 public: a/Source/WebCore/loader/cache/CachedFont.h_sec1
49
    void beginLoadIfNeeded(CachedResourceLoader&);
49
    void beginLoadIfNeeded(CachedResourceLoader&);
50
    virtual bool stillNeedsLoad() const override { return !m_loadInitiated; }
50
    virtual bool stillNeedsLoad() const override { return !m_loadInitiated; }
51
51
52
    void setHasCreatedFontDataWrappingResource(bool hasCreatedFontDataWrappingResource) { hasCreatedFontDataWrappingResource = m_hasCreatedFontDataWrappingResource; }
53
52
    virtual bool ensureCustomFontData(const AtomicString& remoteURI);
54
    virtual bool ensureCustomFontData(const AtomicString& remoteURI);
53
55
54
    virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&);
56
    virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, const FontFeatureSettings&, const FontVariantSettings&);
- a/Source/WebCore/loader/cache/CachedFontClient.h -1 / +1 lines
Lines 37-43 public: a/Source/WebCore/loader/cache/CachedFontClient.h_sec1
37
    virtual ~CachedFontClient() { }
37
    virtual ~CachedFontClient() { }
38
    static CachedResourceClientType expectedType() { return FontType; }
38
    static CachedResourceClientType expectedType() { return FontType; }
39
    virtual CachedResourceClientType resourceClientType() const override { return expectedType(); }
39
    virtual CachedResourceClientType resourceClientType() const override { return expectedType(); }
40
    virtual void fontLoaded(CachedFont*) { }
40
    virtual void fontLoaded(CachedFont&) { }
41
};
41
};
42
42
43
} // namespace WebCore
43
} // namespace WebCore
- a/Source/WebCore/platform/graphics/FontCache.h -15 / +1 lines
Lines 118-138 private: a/Source/WebCore/platform/graphics/FontCache.h_sec1
118
            | static_cast<unsigned>(description.orientation()) << 2
118
            | static_cast<unsigned>(description.orientation()) << 2
119
            | static_cast<unsigned>(description.italic()) << 1
119
            | static_cast<unsigned>(description.italic()) << 1
120
            | static_cast<unsigned>(description.renderingMode());
120
            | static_cast<unsigned>(description.renderingMode());
121
        unsigned second = static_cast<unsigned>(description.variantEastAsianRuby()) << 27
121
        unsigned second = description.variantSettings().uniqueValue();
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());
136
        return {{ first, second }};
122
        return {{ first, second }};
137
    }
123
    }
138
124
- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp +1 lines
Lines 36-41 FontCustomPlatformData::~FontCustomPlatformData() a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp_sec1
36
36
37
FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
37
FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
38
{
38
{
39
    // This function must be consistent with FontFaceSource::HashKey.
39
    int size = fontDescription.computedPixelSize();
40
    int size = fontDescription.computedPixelSize();
40
    FontOrientation orientation = fontDescription.orientation();
41
    FontOrientation orientation = fontDescription.orientation();
41
    FontWidthVariant widthVariant = fontDescription.widthVariant();
42
    FontWidthVariant widthVariant = fontDescription.widthVariant();
- a/Source/WebCore/platform/text/TextFlags.h -1 / +30 lines
Lines 26-31 a/Source/WebCore/platform/text/TextFlags.h_sec1
26
#ifndef TextFlags_h
26
#ifndef TextFlags_h
27
#define TextFlags_h
27
#define TextFlags_h
28
28
29
#include <wtf/Hasher.h>
30
29
namespace WebCore {
31
namespace WebCore {
30
32
31
enum TextRenderingMode { AutoTextRendering, OptimizeSpeed, OptimizeLegibility, GeometricPrecision };
33
enum TextRenderingMode { AutoTextRendering, OptimizeSpeed, OptimizeLegibility, GeometricPrecision };
Lines 212-218 struct FontVariantSettings { a/Source/WebCore/platform/text/TextFlags.h_sec2
212
            && eastAsianRuby == FontVariantEastAsianRuby::Normal;
214
            && eastAsianRuby == FontVariantEastAsianRuby::Normal;
213
    }
215
    }
214
216
215
    bool operator==(const FontVariantSettings& other)
217
    bool operator==(const FontVariantSettings& other) const
216
    {
218
    {
217
        return commonLigatures == other.commonLigatures
219
        return commonLigatures == other.commonLigatures
218
            && discretionaryLigatures == other.discretionaryLigatures
220
            && discretionaryLigatures == other.discretionaryLigatures
Lines 231-236 struct FontVariantSettings { a/Source/WebCore/platform/text/TextFlags.h_sec3
231
            && eastAsianRuby == other.eastAsianRuby;
233
            && eastAsianRuby == other.eastAsianRuby;
232
    }
234
    }
233
235
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
234
    FontVariantLigatures commonLigatures;
263
    FontVariantLigatures commonLigatures;
235
    FontVariantLigatures discretionaryLigatures;
264
    FontVariantLigatures discretionaryLigatures;
236
    FontVariantLigatures historicalLigatures;
265
    FontVariantLigatures historicalLigatures;
- a/Source/WebCore/svg/SVGFontData.h -1 / +1 lines
Lines 56-62 private: a/Source/WebCore/svg/SVGFontData.h_sec1
56
    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, bool enableKerning, bool requiresShaping) const = delete;
56
    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, bool enableKerning, bool requiresShaping) const = delete;
57
57
58
    // Ths SVGFontFaceElement is kept alive --
58
    // 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
60
    //    containing the element;
60
    //    containing the element;
61
    // 2) in the in-document font case: by virtue of being in the document tree and making sure that when it is removed
61
    // 2) in the in-document font case: by virtue of being in the document tree and making sure that when it is removed
62
    //    from the document, it removes the @font-face rule it owns from the document's mapped element sheet and forces
62
    //    from the document, it removes the @font-face rule it owns from the document's mapped element sheet and forces

Return to Bug 153414