| Differences between
and this patch
- a/Source/WebCore/ChangeLog +163 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-09-28  Myles C. Maxfield  <mmaxfield@apple.com>
2
3
        [Cocoa] Implement font-variation-settings
4
        https://bugs.webkit.org/show_bug.cgi?id=162490
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        CSS Fonts level 4 [1] details the font-variation-settings property which allows variations
9
        to be applied to fonts which accept it. The property accepts a list of key/value
10
        pairs where the keys are four-character Ascii codes and the values are floating
11
        point values. The implementation uses font-feature-settings as a model, but with one
12
        big difference: font-variation-settings can be animated. The set of variation points
13
        are animated individually.
14
15
        Now that FontDescription is growing, I'd like to do an investigation into the possibility of
16
        moving some of the rare pieces of it into their own class to reduce memory. However, upon
17
        advice, this investigation will be fairly involved and should be done in its own bug.
18
19
        [1] https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-the-font-variation-settings-property
20
21
        Tests: animations/font-variation-settings.html
22
               animations/font-variation-settings-order.html
23
               animations/font-variation-settings-unlike.html
24
               fast/text/variations/duplicate.html
25
               fast/text/variations/exist.html
26
               fast/text/variations/getComputedStyle.html
27
               fast/text/variations/inheritance.html
28
               fast/text/variations/order.html
29
               fast/text/variations/outofbounds.html
30
31
        * CMakeLists.txt: Rename FontFeatureSettings.{cpp,h} to FontTaggedSettings.{cpp,h}
32
        so that it can be used for variations too.
33
        * WebCore.xcodeproj/project.pbxproj: Ditto. Also add CSSFontVariationValue.{cpp,h}
34
        * css/CSSComputedStyleDeclaration.cpp:
35
        (WebCore::ComputedStyleExtractor::propertyValue): Implement getComputedStyle() for
36
        font-variation-settings
37
        * css/CSSFontFace.h: Rename FontFeatureSettings.h to FontVariationSettings.h
38
        * css/CSSFontFaceSource.h: Ditto.
39
        * css/CSSFontFeatureValue.cpp: Rename FontFeatureTag to FontTag
40
        (WebCore::CSSFontFeatureValue::CSSFontFeatureValue): Ditto
41
        * css/CSSFontFeatureValue.h:
42
        * css/CSSFontVariationValue.cpp: Copied from Source/WebCore/css/CSSFontFeatureValue.cpp.
43
        (WebCore::CSSFontVariationValue::CSSFontVariationValue):
44
        (WebCore::CSSFontVariationValue::customCSSText):
45
        (WebCore::CSSFontVariationValue::equals):
46
        * css/CSSFontVariationValue.h: Copied from Source/WebCore/css/CSSFontFeatureValue.h.
47
        * css/CSSPropertyNames.in: New property!
48
        * css/CSSValue.cpp: CSSValues can now be a CSSFontVariationValue.
49
        (WebCore::CSSValue::equals):
50
        (WebCore::CSSValue::cssText):
51
        (WebCore::CSSValue::destroy):
52
        * css/CSSValue.h: Ditto.
53
        (WebCore::CSSValue::isFontVariationValue):
54
        (WebCore::CSSValue::isFontFeatureValue): Deleted.
55
        * css/FontFace.cpp: Rename FontFeatureTag to FontTag.
56
        (WebCore::FontFace::featureSettings):
57
        * css/StyleBuilderConverter.h: Build a FontVariationSettings from a CSSFontVariationValue
58
        list.
59
        (WebCore::StyleBuilderConverter::convertFontVariationSettings):
60
        * css/StyleBuilderCustom.h:
61
        (WebCore::StyleBuilderCustom::applyInitialFontVariationSettings):
62
        (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings):
63
        (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
64
        * css/StyleResolver.cpp: Remove unused #include
65
        * css/parser/CSSParser.cpp: Parse font-variation-settings.
66
        (WebCore::CSSParser::parseValue):
67
        (WebCore::CSSParser::parseFontFeatureTag):
68
        (WebCore::CSSParser::parseFontFeatureSettings):
69
        (WebCore::CSSParser::parseFontVariationTag):
70
        (WebCore::CSSParser::parseFontVariationSettings):
71
        * css/parser/CSSParser.h:
72
        * loader/cache/CachedFont.h: FontFeatureSettings is now not longer a class
73
        but is instead a template specialization.
74
        * page/animation/CSSPropertyAnimation.cpp: Implement animation of variations.
75
        (WebCore::blendFunc):
76
        (WebCore::PropertyWrapperFontVariationSettings::PropertyWrapperFontVariationSettings):
77
        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
78
        * platform/graphics/FontCache.h: Caches should be sensitive to font-variation-settings.
79
        (WebCore::FontDescriptionKey::FontDescriptionKey):
80
        (WebCore::FontDescriptionKey::operator==):
81
        (WebCore::FontDescriptionKey::computeHash):
82
        * platform/graphics/FontDescription.cpp: FontDescription grew.
83
        * platform/graphics/FontDescription.h: Add the FontVariationSettings member.
84
        (WebCore::FontDescription::variationSettings):
85
        (WebCore::FontDescription::setVariationSettings):
86
        (WebCore::FontDescription::operator==):
87
        (WebCore::FontDescription::featureSettings): Deleted.
88
        (WebCore::FontDescription::setFeatureSettings): Deleted.
89
        * platform/graphics/FontFeatureSettings.cpp: Moved to FontTaggedSettings.cpp
90
        (WebCore::FontFeature::FontFeature): Deleted.
91
        (WebCore::FontFeature::operator==): Deleted.
92
        (WebCore::FontFeature::operator<): Deleted.
93
        (WebCore::FontFeatureSettings::insert): Deleted.
94
        (WebCore::FontFeatureSettings::hash): Deleted.
95
        * platform/graphics/FontFeatureSettings.h: Removed. Moved to FontTaggedSettings.h
96
        (WebCore::fontFeatureTag): Deleted.
97
        (WebCore::FontFeatureTagHash::hash): Deleted.
98
        (WebCore::FontFeatureTagHash::equal): Deleted.
99
        (WebCore::FontFeatureTagHashTraits::constructDeletedValue): Deleted.
100
        (WebCore::FontFeatureTagHashTraits::isDeletedValue): Deleted.
101
        (WebCore::FontFeature::operator!=): Deleted.
102
        (WebCore::FontFeature::tag): Deleted.
103
        (WebCore::FontFeature::value): Deleted.
104
        (WebCore::FontFeature::enabled): Deleted.
105
        (WebCore::FontFeatureSettings::operator==): Deleted.
106
        (WebCore::FontFeatureSettings::operator!=): Deleted.
107
        (WebCore::FontFeatureSettings::size): Deleted.
108
        (WebCore::FontFeatureSettings::operator[]): Deleted.
109
        (WebCore::FontFeatureSettings::at): Deleted.
110
        (WebCore::FontFeatureSettings::begin): Deleted.
111
        (WebCore::FontFeatureSettings::end): Deleted.
112
        * platform/graphics/FontTaggedSettings.cpp: Renamed from Source/WebCore/platform/graphics/FontFeatureSettings.cpp.
113
        (WebCore::FontFeatureSettings::hash):
114
        (WebCore::FontVariationSettings::hash):
115
        (WebCore::operator<<):
116
        * platform/graphics/FontTaggedSettings.h: Added. Renamed FontFeatureSettings to
117
        FontTaggedSettings, then templatize it so it can be used for both font features
118
        and font variations. Add typedefs to these specializations.
119
        (WebCore::fontFeatureTag):
120
        (WebCore::FourCharacterTagHash::hash):
121
        (WebCore::FourCharacterTagHash::equal):
122
        (WebCore::FourCharacterTagHashTraits::constructDeletedValue):
123
        (WebCore::FourCharacterTagHashTraits::isDeletedValue):
124
        (WebCore::FontTaggedSetting::operator!=):
125
        (WebCore::FontTaggedSetting::tag):
126
        (WebCore::FontTaggedSetting::value):
127
        (WebCore::FontTaggedSetting::enabled):
128
        (WebCore::FontTaggedSetting<T>::FontTaggedSetting):
129
        (WebCore::=):
130
        (WebCore::FontTaggedSetting<T>::operator<):
131
        (WebCore::FontTaggedSettings::operator==):
132
        (WebCore::FontTaggedSettings::operator!=):
133
        (WebCore::FontTaggedSettings::isEmpty):
134
        (WebCore::FontTaggedSettings::size):
135
        (WebCore::FontTaggedSettings::operator[]):
136
        (WebCore::FontTaggedSettings::at):
137
        (WebCore::FontTaggedSettings::begin):
138
        (WebCore::FontTaggedSettings::end):
139
        (WebCore::FontTaggedSettings<T>::insert):
140
        * platform/graphics/cocoa/FontCacheCoreText.cpp: Implement font-variation-settings.
141
        (WebCore::tagEquals):
142
        (WebCore::appendOpenTypeFeature):
143
        (WebCore::preparePlatformFont):
144
        (WebCore::fontWithFamily):
145
        (WebCore::FontCache::createFontPlatformData):
146
        (WebCore::FontCache::systemFallbackForCharacters):
147
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto. CoreText has a bug where
148
        a variation does not survive the addition of a cascade list. This conditionally
149
        works around that bug.
150
        (WebCore::cascadeToLastResortAttributesDictionary):
151
        (WebCore::cascadeToLastResortAnVariationsFontDescriptor):
152
        (WebCore::FontPlatformData::ctFont):
153
        (WebCore::cascadeToLastResortFontDescriptor): Deleted.
154
        * platform/graphics/mac/FontCustomPlatformData.cpp:
155
        (WebCore::FontCustomPlatformData::fontPlatformData):
156
        * platform/graphics/mac/FontCustomPlatformData.h:
157
        * rendering/RenderThemeIOS.mm:
158
        (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
159
        * rendering/style/RenderStyle.cpp:
160
        (WebCore::RenderStyle::setFontVariationSettings):
161
        * rendering/style/RenderStyle.h:
162
        (WebCore::RenderStyle::fontVariationSettings):
163
1
2016-09-27  Dean Jackson  <dino@apple.com>
164
2016-09-27  Dean Jackson  <dino@apple.com>
2
165
3
        Use Color references where possible
166
        Use Color references where possible
- a/Source/WebCore/CMakeLists.txt -1 / +1 lines
Lines 2204-2213 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
2204
    platform/graphics/FontCascade.cpp
2204
    platform/graphics/FontCascade.cpp
2205
    platform/graphics/FontCascadeFonts.cpp
2205
    platform/graphics/FontCascadeFonts.cpp
2206
    platform/graphics/FontDescription.cpp
2206
    platform/graphics/FontDescription.cpp
2207
    platform/graphics/FontFeatureSettings.cpp
2208
    platform/graphics/FontGenericFamilies.cpp
2207
    platform/graphics/FontGenericFamilies.cpp
2209
    platform/graphics/FontPlatformData.cpp
2208
    platform/graphics/FontPlatformData.cpp
2210
    platform/graphics/FontRanges.cpp
2209
    platform/graphics/FontRanges.cpp
2210
    platform/graphics/FontTaggedSettings.cpp
2211
    platform/graphics/GeneratedImage.cpp
2211
    platform/graphics/GeneratedImage.cpp
2212
    platform/graphics/GeometryUtilities.cpp
2212
    platform/graphics/GeometryUtilities.cpp
2213
    platform/graphics/Gradient.cpp
2213
    platform/graphics/Gradient.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -8 / +16 lines
Lines 1874-1881 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
1874
		4A5A2ADC161E7E00005889DD /* WebSocketExtensionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A5A2ADA161E7E00005889DD /* WebSocketExtensionParser.h */; };
1874
		4A5A2ADC161E7E00005889DD /* WebSocketExtensionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A5A2ADA161E7E00005889DD /* WebSocketExtensionParser.h */; };
1875
		4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC113C17D1D0046A7F8 /* CSSFontFeatureValue.cpp */; };
1875
		4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC113C17D1D0046A7F8 /* CSSFontFeatureValue.cpp */; };
1876
		4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC213C17D1D0046A7F8 /* CSSFontFeatureValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
1876
		4A6E9FC413C17D1D0046A7F8 /* CSSFontFeatureValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC213C17D1D0046A7F8 /* CSSFontFeatureValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
1877
		4A6E9FC713C17D570046A7F8 /* FontFeatureSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC513C17D570046A7F8 /* FontFeatureSettings.cpp */; };
1877
		4A6E9FC713C17D570046A7F8 /* FontTaggedSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6E9FC513C17D570046A7F8 /* FontTaggedSettings.cpp */; };
1878
		4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC613C17D570046A7F8 /* FontFeatureSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
1878
		4A6E9FC813C17D570046A7F8 /* FontTaggedSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A6E9FC613C17D570046A7F8 /* FontTaggedSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
1879
		4A8C96EB0BE69032004EEFF0 /* FrameSelectionMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A8C96EA0BE69032004EEFF0 /* FrameSelectionMac.mm */; };
1879
		4A8C96EB0BE69032004EEFF0 /* FrameSelectionMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A8C96EA0BE69032004EEFF0 /* FrameSelectionMac.mm */; };
1880
		4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */; };
1880
		4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */; };
1881
		4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */; };
1881
		4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */; };
Lines 5475-5480 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
5475
		C28083401C6DC275001451B6 /* JSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C280833D1C6DC22C001451B6 /* JSFontFace.cpp */; };
5475
		C28083401C6DC275001451B6 /* JSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C280833D1C6DC22C001451B6 /* JSFontFace.cpp */; };
5476
		C28083421C6DC96A001451B6 /* JSFontFaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */; };
5476
		C28083421C6DC96A001451B6 /* JSFontFaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */; };
5477
		C2E1F43F1D6254E10094625C /* BreakLines.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4816097D93020094C9E4 /* BreakLines.h */; settings = {ATTRIBUTES = (Private, ); }; };
5477
		C2E1F43F1D6254E10094625C /* BreakLines.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4816097D93020094C9E4 /* BreakLines.h */; settings = {ATTRIBUTES = (Private, ); }; };
5478
		C2ED72981D9530310048CA3E /* CSSFontVariationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2ED72961D9530310048CA3E /* CSSFontVariationValue.cpp */; };
5479
		C2ED72991D9530310048CA3E /* CSSFontVariationValue.h in Headers */ = {isa = PBXBuildFile; fileRef = C2ED72971D9530310048CA3E /* CSSFontVariationValue.h */; };
5478
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5480
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5479
		C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
5481
		C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
5480
		C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };
5482
		C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };
Lines 8872-8879 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
8872
		4A5A2ADA161E7E00005889DD /* WebSocketExtensionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketExtensionParser.h; sourceTree = "<group>"; };
8874
		4A5A2ADA161E7E00005889DD /* WebSocketExtensionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketExtensionParser.h; sourceTree = "<group>"; };
8873
		4A6E9FC113C17D1D0046A7F8 /* CSSFontFeatureValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFeatureValue.cpp; sourceTree = "<group>"; };
8875
		4A6E9FC113C17D1D0046A7F8 /* CSSFontFeatureValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFeatureValue.cpp; sourceTree = "<group>"; };
8874
		4A6E9FC213C17D1D0046A7F8 /* CSSFontFeatureValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFeatureValue.h; sourceTree = "<group>"; };
8876
		4A6E9FC213C17D1D0046A7F8 /* CSSFontFeatureValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFeatureValue.h; sourceTree = "<group>"; };
8875
		4A6E9FC513C17D570046A7F8 /* FontFeatureSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFeatureSettings.cpp; sourceTree = "<group>"; };
8877
		4A6E9FC513C17D570046A7F8 /* FontTaggedSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontTaggedSettings.cpp; sourceTree = "<group>"; };
8876
		4A6E9FC613C17D570046A7F8 /* FontFeatureSettings.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = FontFeatureSettings.h; sourceTree = "<group>"; };
8878
		4A6E9FC613C17D570046A7F8 /* FontTaggedSettings.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = FontTaggedSettings.h; sourceTree = "<group>"; };
8877
		4A8C96EA0BE69032004EEFF0 /* FrameSelectionMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameSelectionMac.mm; sourceTree = "<group>"; };
8879
		4A8C96EA0BE69032004EEFF0 /* FrameSelectionMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameSelectionMac.mm; sourceTree = "<group>"; };
8878
		4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSDefaultStyleSheets.cpp; sourceTree = "<group>"; };
8880
		4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSDefaultStyleSheets.cpp; sourceTree = "<group>"; };
8879
		4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSDefaultStyleSheets.h; sourceTree = "<group>"; };
8881
		4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSDefaultStyleSheets.h; sourceTree = "<group>"; };
Lines 12978-12983 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
12978
		C280833E1C6DC22C001451B6 /* JSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFontFace.h; sourceTree = "<group>"; };
12980
		C280833E1C6DC22C001451B6 /* JSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFontFace.h; sourceTree = "<group>"; };
12979
		C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceCustom.cpp; sourceTree = "<group>"; };
12981
		C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceCustom.cpp; sourceTree = "<group>"; };
12980
		C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
12982
		C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
12983
		C2ED72961D9530310048CA3E /* CSSFontVariationValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontVariationValue.cpp; sourceTree = "<group>"; };
12984
		C2ED72971D9530310048CA3E /* CSSFontVariationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontVariationValue.h; sourceTree = "<group>"; };
12981
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
12985
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
12982
		C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
12986
		C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseClickableWithKeyInputType.cpp; sourceTree = "<group>"; };
12983
		C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };
12987
		C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseClickableWithKeyInputType.h; sourceTree = "<group>"; };
Lines 20676-20683 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
20676
				B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */,
20680
				B2C3DA570D006CD600EF6F26 /* FontCascadeFonts.h */,
20677
				37ACCE620DA2AA960089E602 /* FontDescription.cpp */,
20681
				37ACCE620DA2AA960089E602 /* FontDescription.cpp */,
20678
				B2C3DA550D006CD600EF6F26 /* FontDescription.h */,
20682
				B2C3DA550D006CD600EF6F26 /* FontDescription.h */,
20679
				4A6E9FC513C17D570046A7F8 /* FontFeatureSettings.cpp */,
20683
				4A6E9FC513C17D570046A7F8 /* FontTaggedSettings.cpp */,
20680
				4A6E9FC613C17D570046A7F8 /* FontFeatureSettings.h */,
20684
				4A6E9FC613C17D570046A7F8 /* FontTaggedSettings.h */,
20681
				E44EE3A617576E5500EEE8CF /* FontGenericFamilies.cpp */,
20685
				E44EE3A617576E5500EEE8CF /* FontGenericFamilies.cpp */,
20682
				E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */,
20686
				E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */,
20683
				0845680712B90DA600960A9F /* FontMetrics.h */,
20687
				0845680712B90DA600960A9F /* FontMetrics.h */,
Lines 22600-22605 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
22600
				3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
22604
				3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
22601
				3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
22605
				3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
22602
				3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
22606
				3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
22607
				C2ED72961D9530310048CA3E /* CSSFontVariationValue.cpp */,
22608
				C2ED72971D9530310048CA3E /* CSSFontVariationValue.h */,
22603
			);
22609
			);
22604
			path = css;
22610
			path = css;
22605
			sourceTree = "<group>";
22611
			sourceTree = "<group>";
Lines 24518-24524 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
24518
				B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */,
24524
				B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */,
24519
				1C6626111C6E7CA600AB527C /* FontFace.h in Headers */,
24525
				1C6626111C6E7CA600AB527C /* FontFace.h in Headers */,
24520
				1C24EEA51C729CE40080F8FC /* FontFaceSet.h in Headers */,
24526
				1C24EEA51C729CE40080F8FC /* FontFaceSet.h in Headers */,
24521
				4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */,
24527
				4A6E9FC813C17D570046A7F8 /* FontTaggedSettings.h in Headers */,
24522
				0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
24528
				0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
24523
				B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
24529
				B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
24524
				371F4FFC0D25E7F300ECE0D5 /* FontRanges.h in Headers */,
24530
				371F4FFC0D25E7F300ECE0D5 /* FontRanges.h in Headers */,
Lines 24710-24715 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
24710
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24716
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24711
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24717
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24712
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24718
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24719
				C2ED72991D9530310048CA3E /* CSSFontVariationValue.h in Headers */,
24713
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24720
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24714
				9B69D3B51B98FFE900E3512B /* HTMLSlotElement.h in Headers */,
24721
				9B69D3B51B98FFE900E3512B /* HTMLSlotElement.h in Headers */,
24715
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
24722
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
Lines 27655-27660 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
27655
				AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */,
27662
				AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */,
27656
				85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */,
27663
				85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */,
27657
				B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */,
27664
				B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */,
27665
				C2ED72981D9530310048CA3E /* CSSFontVariationValue.cpp in Sources */,
27658
				BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
27666
				BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
27659
				FD31608C12B026F700C1A359 /* Biquad.cpp in Sources */,
27667
				FD31608C12B026F700C1A359 /* Biquad.cpp in Sources */,
27660
				FD31602412B0267600C1A359 /* BiquadDSPKernel.cpp in Sources */,
27668
				FD31602412B0267600C1A359 /* BiquadDSPKernel.cpp in Sources */,
Lines 28193-28199 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec10
28193
				37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */,
28201
				37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */,
28194
				1C6626101C6E7CA600AB527C /* FontFace.cpp in Sources */,
28202
				1C6626101C6E7CA600AB527C /* FontFace.cpp in Sources */,
28195
				1C24EEA41C729CE40080F8FC /* FontFaceSet.cpp in Sources */,
28203
				1C24EEA41C729CE40080F8FC /* FontFaceSet.cpp in Sources */,
28196
				4A6E9FC713C17D570046A7F8 /* FontFeatureSettings.cpp in Sources */,
28204
				4A6E9FC713C17D570046A7F8 /* FontTaggedSettings.cpp in Sources */,
28197
				E44EE3A817577EBD00EEE8CF /* FontGenericFamilies.cpp in Sources */,
28205
				E44EE3A817577EBD00EEE8CF /* FontGenericFamilies.cpp in Sources */,
28198
				84B62685133138F90095A489 /* FontPlatformData.cpp in Sources */,
28206
				84B62685133138F90095A489 /* FontPlatformData.cpp in Sources */,
28199
				B5320D6C122A24E9002D1440 /* FontPlatformDataCocoa.mm in Sources */,
28207
				B5320D6C122A24E9002D1440 /* FontPlatformDataCocoa.mm in Sources */,
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp -2 / +12 lines
Lines 36-41 a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
36
#include "CSSCustomPropertyValue.h"
36
#include "CSSCustomPropertyValue.h"
37
#include "CSSFontFeatureValue.h"
37
#include "CSSFontFeatureValue.h"
38
#include "CSSFontValue.h"
38
#include "CSSFontValue.h"
39
#include "CSSFontVariationValue.h"
39
#include "CSSFunctionValue.h"
40
#include "CSSFunctionValue.h"
40
#include "CSSLineBoxContainValue.h"
41
#include "CSSLineBoxContainValue.h"
41
#include "CSSParser.h"
42
#include "CSSParser.h"
Lines 53-59 a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
53
#include "CursorList.h"
54
#include "CursorList.h"
54
#include "Document.h"
55
#include "Document.h"
55
#include "ExceptionCode.h"
56
#include "ExceptionCode.h"
56
#include "FontFeatureSettings.h"
57
#include "FontTaggedSettings.h"
57
#include "HTMLFrameOwnerElement.h"
58
#include "HTMLFrameOwnerElement.h"
58
#include "Pair.h"
59
#include "Pair.h"
59
#include "PseudoElement.h"
60
#include "PseudoElement.h"
Lines 2876-2882 RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec3
2876
                return cssValuePool.createIdentifierValue(CSSValueNormal);
2877
                return cssValuePool.createIdentifierValue(CSSValueNormal);
2877
            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
2878
            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
2878
            for (auto& feature : featureSettings)
2879
            for (auto& feature : featureSettings)
2879
                list->append(CSSFontFeatureValue::create(FontFeatureTag(feature.tag()), feature.value()));
2880
                list->append(CSSFontFeatureValue::create(FontTag(feature.tag()), feature.value()));
2881
            return list;
2882
        }
2883
        case CSSPropertyFontVariationSettings: {
2884
            const FontVariationSettings& variationSettings = style->fontDescription().variationSettings();
2885
            if (variationSettings.isEmpty())
2886
                return cssValuePool.createIdentifierValue(CSSValueNormal);
2887
            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
2888
            for (auto& feature : variationSettings)
2889
                list->append(CSSFontVariationValue::create(FontTag(feature.tag()), feature.value()));
2880
            return list;
2890
            return list;
2881
        }
2891
        }
2882
#if ENABLE(CSS_GRID_LAYOUT)
2892
#if ENABLE(CSS_GRID_LAYOUT)
- a/Source/WebCore/css/CSSFontFace.h -1 / +1 lines
Lines 26-32 a/Source/WebCore/css/CSSFontFace.h_sec1
26
#pragma once
26
#pragma once
27
27
28
#include "CSSFontFaceRule.h"
28
#include "CSSFontFaceRule.h"
29
#include "FontFeatureSettings.h"
29
#include "FontTaggedSettings.h"
30
#include "TextFlags.h"
30
#include "TextFlags.h"
31
#include "Timer.h"
31
#include "Timer.h"
32
#include <memory>
32
#include <memory>
- a/Source/WebCore/css/CSSFontFaceSource.h -1 / +3 lines
Lines 38-48 class CSSFontSelector; a/Source/WebCore/css/CSSFontFaceSource.h_sec1
38
class Font;
38
class Font;
39
struct FontCustomPlatformData;
39
struct FontCustomPlatformData;
40
class FontDescription;
40
class FontDescription;
41
class FontFeatureSettings;
42
struct FontVariantSettings;
41
struct FontVariantSettings;
43
class SVGFontFaceElement;
42
class SVGFontFaceElement;
44
class SharedBuffer;
43
class SharedBuffer;
45
44
45
template <typename T> class FontTaggedSettings;
46
typedef FontTaggedSettings<int> FontFeatureSettings;
47
46
class CSSFontFaceSource final : public CachedFontClient {
48
class CSSFontFaceSource final : public CachedFontClient {
47
    WTF_MAKE_FAST_ALLOCATED;
49
    WTF_MAKE_FAST_ALLOCATED;
48
public:
50
public:
- a/Source/WebCore/css/CSSFontFeatureValue.cpp -3 / +1 lines
Lines 26-38 a/Source/WebCore/css/CSSFontFeatureValue.cpp_sec1
26
#include "config.h"
26
#include "config.h"
27
#include "CSSFontFeatureValue.h"
27
#include "CSSFontFeatureValue.h"
28
28
29
#include "CSSParser.h"
30
#include "CSSValueKeywords.h"
31
#include <wtf/text/StringBuilder.h>
29
#include <wtf/text/StringBuilder.h>
32
30
33
namespace WebCore {
31
namespace WebCore {
34
32
35
CSSFontFeatureValue::CSSFontFeatureValue(FontFeatureTag&& tag, int value)
33
CSSFontFeatureValue::CSSFontFeatureValue(FontTag&& tag, int value)
36
    : CSSValue(FontFeatureClass)
34
    : CSSValue(FontFeatureClass)
37
    , m_tag(WTFMove(tag))
35
    , m_tag(WTFMove(tag))
38
    , m_value(value)
36
    , m_value(value)
- a/Source/WebCore/css/CSSFontFeatureValue.h -5 / +5 lines
Lines 27-53 a/Source/WebCore/css/CSSFontFeatureValue.h_sec1
27
#define CSSFontFeatureValue_h
27
#define CSSFontFeatureValue_h
28
28
29
#include "CSSValue.h"
29
#include "CSSValue.h"
30
#include "FontFeatureSettings.h"
30
#include "FontTaggedSettings.h"
31
31
32
namespace WebCore {
32
namespace WebCore {
33
33
34
class CSSFontFeatureValue final : public CSSValue {
34
class CSSFontFeatureValue final : public CSSValue {
35
public:
35
public:
36
    static Ref<CSSFontFeatureValue> create(FontFeatureTag&& tag, int value)
36
    static Ref<CSSFontFeatureValue> create(FontTag&& tag, int value)
37
    {
37
    {
38
        return adoptRef(*new CSSFontFeatureValue(WTFMove(tag), value));
38
        return adoptRef(*new CSSFontFeatureValue(WTFMove(tag), value));
39
    }
39
    }
40
40
41
    const FontFeatureTag& tag() const { return m_tag; }
41
    const FontTag& tag() const { return m_tag; }
42
    int value() const { return m_value; }
42
    int value() const { return m_value; }
43
    String customCSSText() const;
43
    String customCSSText() const;
44
44
45
    bool equals(const CSSFontFeatureValue&) const;
45
    bool equals(const CSSFontFeatureValue&) const;
46
46
47
private:
47
private:
48
    CSSFontFeatureValue(FontFeatureTag&&, int);
48
    CSSFontFeatureValue(FontTag&&, int);
49
49
50
    FontFeatureTag m_tag;
50
    FontTag m_tag;
51
    const int m_value;
51
    const int m_value;
52
};
52
};
53
53
- a/Source/WebCore/css/CSSFontVariationValue.cpp +56 lines
Line 0 a/Source/WebCore/css/CSSFontVariationValue.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. ``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 "CSSFontVariationValue.h"
28
29
#include <wtf/text/StringBuilder.h>
30
31
namespace WebCore {
32
33
CSSFontVariationValue::CSSFontVariationValue(FontTag&& tag, float value)
34
    : CSSValue(FontVariationClass)
35
    , m_tag(WTFMove(tag))
36
    , m_value(value)
37
{
38
}
39
40
String CSSFontVariationValue::customCSSText() const
41
{
42
    StringBuilder builder;
43
    builder.append('\'');
44
    for (char c : m_tag)
45
        builder.append(c);
46
    builder.appendLiteral("' ");
47
    builder.appendNumber(m_value);
48
    return builder.toString();
49
}
50
51
bool CSSFontVariationValue::equals(const CSSFontVariationValue& other) const
52
{
53
    return m_tag == other.m_tag && m_value == other.m_value;
54
}
55
56
}
- a/Source/WebCore/css/CSSFontVariationValue.h +55 lines
Line 0 a/Source/WebCore/css/CSSFontVariationValue.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. ``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
#pragma once
27
28
#include "CSSValue.h"
29
#include "FontTaggedSettings.h"
30
31
namespace WebCore {
32
33
class CSSFontVariationValue final : public CSSValue {
34
public:
35
    static Ref<CSSFontVariationValue> create(FontTag&& tag, float value)
36
    {
37
        return adoptRef(*new CSSFontVariationValue(WTFMove(tag), value));
38
    }
39
40
    const FontTag& tag() const { return m_tag; }
41
    float value() const { return m_value; }
42
    String customCSSText() const;
43
44
    bool equals(const CSSFontVariationValue&) const;
45
46
private:
47
    CSSFontVariationValue(FontTag&&, float);
48
49
    FontTag m_tag;
50
    const float m_value;
51
};
52
53
} // namespace WebCore
54
55
SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontVariationValue, isFontVariationValue())
- a/Source/WebCore/css/CSSPropertyNames.in +1 lines
Lines 105-110 font-style [Inherited, FontProperty, NameForMethods=Italic] a/Source/WebCore/css/CSSPropertyNames.in_sec1
105
font-weight [Inherited, Custom=All]
105
font-weight [Inherited, Custom=All]
106
text-rendering [Inherited, FontProperty, NameForMethods=TextRenderingMode]
106
text-rendering [Inherited, FontProperty, NameForMethods=TextRenderingMode]
107
font-feature-settings [Inherited, FontProperty, Custom=Initial|Inherit, Converter=FontFeatureSettings, NameForMethods=FeatureSettings]
107
font-feature-settings [Inherited, FontProperty, Custom=Initial|Inherit, Converter=FontFeatureSettings, NameForMethods=FeatureSettings]
108
font-variation-settings [Inherited, FontProperty, Custom=Initial|Inherit, Converter=FontVariationSettings, NameForMethods=VariationSettings]
108
-webkit-font-kerning [Inherited, FontProperty, NameForMethods=Kerning]
109
-webkit-font-kerning [Inherited, FontProperty, NameForMethods=Kerning]
109
font-kerning = -webkit-font-kerning
110
font-kerning = -webkit-font-kerning
110
-webkit-font-smoothing [Inherited, FontProperty]
111
-webkit-font-smoothing [Inherited, FontProperty]
- a/Source/WebCore/css/CSSValue.cpp +8 lines
Lines 43-48 a/Source/WebCore/css/CSSValue.cpp_sec1
43
#include "CSSFontFaceSrcValue.h"
43
#include "CSSFontFaceSrcValue.h"
44
#include "CSSFontFeatureValue.h"
44
#include "CSSFontFeatureValue.h"
45
#include "CSSFontValue.h"
45
#include "CSSFontValue.h"
46
#include "CSSFontVariationValue.h"
46
#include "CSSFunctionValue.h"
47
#include "CSSFunctionValue.h"
47
#include "CSSGradientValue.h"
48
#include "CSSGradientValue.h"
48
#include "CSSImageSetValue.h"
49
#include "CSSImageSetValue.h"
Lines 191-196 bool CSSValue::equals(const CSSValue& other) const a/Source/WebCore/css/CSSValue.cpp_sec2
191
            return compareCSSValues<CSSFontFaceSrcValue>(*this, other);
192
            return compareCSSValues<CSSFontFaceSrcValue>(*this, other);
192
        case FontFeatureClass:
193
        case FontFeatureClass:
193
            return compareCSSValues<CSSFontFeatureValue>(*this, other);
194
            return compareCSSValues<CSSFontFeatureValue>(*this, other);
195
        case FontVariationClass:
196
            return compareCSSValues<CSSFontVariationValue>(*this, other);
194
        case FunctionClass:
197
        case FunctionClass:
195
            return compareCSSValues<CSSFunctionValue>(*this, other);
198
            return compareCSSValues<CSSFunctionValue>(*this, other);
196
        case LinearGradientClass:
199
        case LinearGradientClass:
Lines 297-302 String CSSValue::cssText() const a/Source/WebCore/css/CSSValue.cpp_sec3
297
        return downcast<CSSFontFaceSrcValue>(*this).customCSSText();
300
        return downcast<CSSFontFaceSrcValue>(*this).customCSSText();
298
    case FontFeatureClass:
301
    case FontFeatureClass:
299
        return downcast<CSSFontFeatureValue>(*this).customCSSText();
302
        return downcast<CSSFontFeatureValue>(*this).customCSSText();
303
    case FontVariationClass:
304
        return downcast<CSSFontVariationValue>(*this).customCSSText();
300
    case FunctionClass:
305
    case FunctionClass:
301
        return downcast<CSSFunctionValue>(*this).customCSSText();
306
        return downcast<CSSFunctionValue>(*this).customCSSText();
302
    case LinearGradientClass:
307
    case LinearGradientClass:
Lines 411-416 void CSSValue::destroy() a/Source/WebCore/css/CSSValue.cpp_sec4
411
    case FontFeatureClass:
416
    case FontFeatureClass:
412
        delete downcast<CSSFontFeatureValue>(this);
417
        delete downcast<CSSFontFeatureValue>(this);
413
        return;
418
        return;
419
    case FontVariationClass:
420
        delete downcast<CSSFontVariationValue>(this);
421
        return;
414
    case FunctionClass:
422
    case FunctionClass:
415
        delete downcast<CSSFunctionValue>(this);
423
        delete downcast<CSSFunctionValue>(this);
416
        return;
424
        return;
- a/Source/WebCore/css/CSSValue.h +2 lines
Lines 83-88 public: a/Source/WebCore/css/CSSValue.h_sec1
83
    bool isVariableValue() const { return m_classType == VariableClass; }
83
    bool isVariableValue() const { return m_classType == VariableClass; }
84
    bool isFunctionValue() const { return m_classType == FunctionClass; }
84
    bool isFunctionValue() const { return m_classType == FunctionClass; }
85
    bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
85
    bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
86
    bool isFontVariationValue() const { return m_classType == FontVariationClass; }
86
    bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; }
87
    bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; }
87
    bool isFontValue() const { return m_classType == FontClass; }
88
    bool isFontValue() const { return m_classType == FontClass; }
88
    bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; }
89
    bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; }
Lines 171-176 protected: a/Source/WebCore/css/CSSValue.h_sec2
171
        AspectRatioClass,
172
        AspectRatioClass,
172
        BorderImageSliceClass,
173
        BorderImageSliceClass,
173
        FontFeatureClass,
174
        FontFeatureClass,
175
        FontVariationClass,
174
        FontClass,
176
        FontClass,
175
        FontFaceSrcClass,
177
        FontFaceSrcClass,
176
        FunctionClass,
178
        FunctionClass,
- a/Source/WebCore/css/FontFace.cpp -1 / +1 lines
Lines 343-349 String FontFace::featureSettings() const a/Source/WebCore/css/FontFace.cpp_sec1
343
        return ASCIILiteral("normal");
343
        return ASCIILiteral("normal");
344
    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
344
    RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
345
    for (auto& feature : m_backing->featureSettings())
345
    for (auto& feature : m_backing->featureSettings())
346
        list->append(CSSFontFeatureValue::create(FontFeatureTag(feature.tag()), feature.value()));
346
        list->append(CSSFontFeatureValue::create(FontTag(feature.tag()), feature.value()));
347
    return list->cssText();
347
    return list->cssText();
348
}
348
}
349
349
- a/Source/WebCore/css/StyleBuilderConverter.h +17 lines
Lines 31-36 a/Source/WebCore/css/StyleBuilderConverter.h_sec1
31
#include "CSSCalculationValue.h"
31
#include "CSSCalculationValue.h"
32
#include "CSSContentDistributionValue.h"
32
#include "CSSContentDistributionValue.h"
33
#include "CSSFontFeatureValue.h"
33
#include "CSSFontFeatureValue.h"
34
#include "CSSFontVariationValue.h"
34
#include "CSSFunctionValue.h"
35
#include "CSSFunctionValue.h"
35
#include "CSSGridAutoRepeatValue.h"
36
#include "CSSGridAutoRepeatValue.h"
36
#include "CSSGridLineNamesValue.h"
37
#include "CSSGridLineNamesValue.h"
Lines 120-125 public: a/Source/WebCore/css/StyleBuilderConverter.h_sec2
120
    static bool convertOverflowScrolling(StyleResolver&, CSSValue&);
121
    static bool convertOverflowScrolling(StyleResolver&, CSSValue&);
121
#endif
122
#endif
122
    static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, CSSValue&);
123
    static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, CSSValue&);
124
    static FontVariationSettings convertFontVariationSettings(StyleResolver&, CSSValue&);
123
    static SVGLength convertSVGLength(StyleResolver&, CSSValue&);
125
    static SVGLength convertSVGLength(StyleResolver&, CSSValue&);
124
    static Vector<SVGLength> convertSVGLengthVector(StyleResolver&, CSSValue&);
126
    static Vector<SVGLength> convertSVGLengthVector(StyleResolver&, CSSValue&);
125
    static Vector<SVGLength> convertStrokeDashArray(StyleResolver&, CSSValue&);
127
    static Vector<SVGLength> convertStrokeDashArray(StyleResolver&, CSSValue&);
Lines 1144-1149 inline FontFeatureSettings StyleBuilderConverter::convertFontFeatureSettings(Sty a/Source/WebCore/css/StyleBuilderConverter.h_sec3
1144
    return settings;
1146
    return settings;
1145
}
1147
}
1146
1148
1149
inline FontVariationSettings StyleBuilderConverter::convertFontVariationSettings(StyleResolver&, CSSValue& value)
1150
{
1151
    if (is<CSSPrimitiveValue>(value)) {
1152
        ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
1153
        return { };
1154
    }
1155
1156
    FontVariationSettings settings;
1157
    for (auto& item : downcast<CSSValueList>(value)) {
1158
        auto& feature = downcast<CSSFontVariationValue>(item.get());
1159
        settings.insert({ feature.tag(), feature.value() });
1160
    }
1161
    return settings;
1162
}
1163
1147
#if PLATFORM(IOS)
1164
#if PLATFORM(IOS)
1148
inline bool StyleBuilderConverter::convertTouchCallout(StyleResolver&, CSSValue& value)
1165
inline bool StyleBuilderConverter::convertTouchCallout(StyleResolver&, CSSValue& value)
1149
{
1166
{
- a/Source/WebCore/css/StyleBuilderCustom.h +2 lines
Lines 112-117 public: a/Source/WebCore/css/StyleBuilderCustom.h_sec1
112
    static void applyInheritWebkitMaskImage(StyleResolver&) { }
112
    static void applyInheritWebkitMaskImage(StyleResolver&) { }
113
    static void applyInitialFontFeatureSettings(StyleResolver&) { }
113
    static void applyInitialFontFeatureSettings(StyleResolver&) { }
114
    static void applyInheritFontFeatureSettings(StyleResolver&) { }
114
    static void applyInheritFontFeatureSettings(StyleResolver&) { }
115
    static void applyInitialFontVariationSettings(StyleResolver&) { }
116
    static void applyInheritFontVariationSettings(StyleResolver&) { }
115
117
116
    // Custom handling of inherit + value setting only.
118
    // Custom handling of inherit + value setting only.
117
    static void applyInheritDisplay(StyleResolver&);
119
    static void applyInheritDisplay(StyleResolver&);
- a/Source/WebCore/css/StyleResolver.cpp -1 lines
Lines 37-43 a/Source/WebCore/css/StyleResolver.cpp_sec1
37
#include "CSSDefaultStyleSheets.h"
37
#include "CSSDefaultStyleSheets.h"
38
#include "CSSFilterImageValue.h"
38
#include "CSSFilterImageValue.h"
39
#include "CSSFontFaceRule.h"
39
#include "CSSFontFaceRule.h"
40
#include "CSSFontFeatureValue.h"
41
#include "CSSFontSelector.h"
40
#include "CSSFontSelector.h"
42
#include "CSSFontValue.h"
41
#include "CSSFontValue.h"
43
#include "CSSFunctionValue.h"
42
#include "CSSFunctionValue.h"
- a/Source/WebCore/css/parser/CSSParser.cpp -1 / +62 lines
Lines 43-48 a/Source/WebCore/css/parser/CSSParser.cpp_sec1
43
#include "CSSFontFaceSrcValue.h"
43
#include "CSSFontFaceSrcValue.h"
44
#include "CSSFontFeatureValue.h"
44
#include "CSSFontFeatureValue.h"
45
#include "CSSFontValue.h"
45
#include "CSSFontValue.h"
46
#include "CSSFontVariationValue.h"
46
#include "CSSFunctionValue.h"
47
#include "CSSFunctionValue.h"
47
#include "CSSGradientValue.h"
48
#include "CSSGradientValue.h"
48
#include "CSSImageSetValue.h"
49
#include "CSSImageSetValue.h"
Lines 2971-2976 bool CSSParser::parseValue(CSSPropertyID propId, bool important) a/Source/WebCore/css/parser/CSSParser.cpp_sec2
2971
        else
2972
        else
2972
            return parseFontFeatureSettings(important);
2973
            return parseFontFeatureSettings(important);
2973
        break;
2974
        break;
2975
    case CSSPropertyFontVariationSettings:
2976
        if (id == CSSValueNormal)
2977
            validPrimitive = true;
2978
        else
2979
            return parseFontVariationSettings(important);
2980
        break;
2974
    case CSSPropertyFontVariantLigatures:
2981
    case CSSPropertyFontVariantLigatures:
2975
        if (id == CSSValueNormal || id == CSSValueNone)
2982
        if (id == CSSValueNormal || id == CSSValueNone)
2976
            validPrimitive = true;
2983
            validPrimitive = true;
Lines 10570-10576 bool CSSParser::parseFontFeatureTag(CSSValueList& settings) a/Source/WebCore/css/parser/CSSParser.cpp_sec3
10570
    // Feature tag name comes first
10577
    // Feature tag name comes first
10571
    if (value->unit != CSSPrimitiveValue::CSS_STRING)
10578
    if (value->unit != CSSPrimitiveValue::CSS_STRING)
10572
        return false;
10579
        return false;
10573
    FontFeatureTag tag;
10580
    FontTag tag;
10574
    if (value->string.length() != tag.size())
10581
    if (value->string.length() != tag.size())
10575
        return false;
10582
        return false;
10576
    for (unsigned i = 0; i < tag.size(); ++i) {
10583
    for (unsigned i = 0; i < tag.size(); ++i) {
Lines 10625-10630 bool CSSParser::parseFontFeatureSettings(bool important) a/Source/WebCore/css/parser/CSSParser.cpp_sec4
10625
    return false;
10632
    return false;
10626
}
10633
}
10627
10634
10635
bool CSSParser::parseFontVariationTag(CSSValueList& settings)
10636
{
10637
    CSSParserValue* value = m_valueList->current();
10638
    // Feature tag name comes first
10639
    if (value->unit != CSSPrimitiveValue::CSS_STRING)
10640
        return false;
10641
    FontTag tag;
10642
    if (value->string.length() != tag.size())
10643
        return false;
10644
    for (unsigned i = 0; i < tag.size(); ++i) {
10645
        // Limits the range of characters to 0x20-0x7E, following the tag name rules defiend in the OpenType specification.
10646
        UChar character = value->string[i];
10647
        if (character < 0x20 || character > 0x7E)
10648
            return false;
10649
        tag[i] = toASCIILower(character);
10650
    }
10651
10652
    value = m_valueList->next();
10653
    if (!value || value->unit != CSSPrimitiveValue::CSS_NUMBER)
10654
        return false;
10655
10656
    float tagValue = value->fValue;
10657
    m_valueList->next();
10658
10659
    settings.append(CSSFontVariationValue::create(WTFMove(tag), tagValue));
10660
    return true;
10661
}
10662
10663
bool CSSParser::parseFontVariationSettings(bool important)
10664
{
10665
    if (m_valueList->size() == 1 && m_valueList->current()->id == CSSValueNormal) {
10666
        auto normalValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
10667
        m_valueList->next();
10668
        addProperty(CSSPropertyFontVariationSettings, WTFMove(normalValue), important);
10669
        return true;
10670
    }
10671
10672
    auto settings = CSSValueList::createCommaSeparated();
10673
    for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
10674
        if (!parseFontVariationTag(settings))
10675
            return false;
10676
10677
        // If the list isn't parsed fully, the current value should be comma.
10678
        value = m_valueList->current();
10679
        if (value && !isComma(value))
10680
            return false;
10681
    }
10682
    if (settings->length()) {
10683
        addProperty(CSSPropertyFontVariationSettings, WTFMove(settings), important);
10684
        return true;
10685
    }
10686
    return false;
10687
}
10688
10628
bool CSSParser::parseFontVariantLigatures(bool important, bool unknownIsFailure, bool implicit)
10689
bool CSSParser::parseFontVariantLigatures(bool important, bool unknownIsFailure, bool implicit)
10629
{
10690
{
10630
    auto values = CSSValueList::createSpaceSeparated();
10691
    auto values = CSSValueList::createSpaceSeparated();
- a/Source/WebCore/css/parser/CSSParser.h +3 lines
Lines 364-369 public: a/Source/WebCore/css/parser/CSSParser.h_sec1
364
    bool parseFontFeatureTag(CSSValueList&);
364
    bool parseFontFeatureTag(CSSValueList&);
365
    bool parseFontFeatureSettings(bool important);
365
    bool parseFontFeatureSettings(bool important);
366
366
367
    bool parseFontVariationTag(CSSValueList&);
368
    bool parseFontVariationSettings(bool important);
369
367
    bool parseFlowThread(CSSPropertyID, bool important);
370
    bool parseFlowThread(CSSPropertyID, bool important);
368
    bool parseRegionThread(CSSPropertyID, bool important);
371
    bool parseRegionThread(CSSPropertyID, bool important);
369
372
- a/Source/WebCore/loader/cache/CachedFont.h -1 / +3 lines
Lines 35-46 namespace WebCore { a/Source/WebCore/loader/cache/CachedFont.h_sec1
35
35
36
class CachedResourceLoader;
36
class CachedResourceLoader;
37
class FontDescription;
37
class FontDescription;
38
class FontFeatureSettings;
39
class FontPlatformData;
38
class FontPlatformData;
40
class SVGDocument;
39
class SVGDocument;
41
class SVGFontElement;
40
class SVGFontElement;
42
struct FontCustomPlatformData;
41
struct FontCustomPlatformData;
43
42
43
template <typename T> class FontTaggedSettings;
44
typedef FontTaggedSettings<int> FontFeatureSettings;
45
44
class CachedFont : public CachedResource {
46
class CachedFont : public CachedResource {
45
public:
47
public:
46
    CachedFont(CachedResourceRequest&&, SessionID, Type = FontResource);
48
    CachedFont(CachedResourceRequest&&, SessionID, Type = FontResource);
- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp +42 lines
Lines 41-46 a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec1
41
#include "CachedImage.h"
41
#include "CachedImage.h"
42
#include "ClipPathOperation.h"
42
#include "ClipPathOperation.h"
43
#include "FloatConversion.h"
43
#include "FloatConversion.h"
44
#include "FontTaggedSettings.h"
44
#include "IdentityTransformOperation.h"
45
#include "IdentityTransformOperation.h"
45
#include "Logging.h"
46
#include "Logging.h"
46
#include "Matrix3DTransformOperation.h"
47
#include "Matrix3DTransformOperation.h"
Lines 371-376 static inline NinePieceImage blendFunc(const AnimationBase* anim, const NinePiec a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec2
371
    return NinePieceImage(newContentImage, from.imageSlices(), from.fill(), from.borderSlices(), from.outset(), from.horizontalRule(), from.verticalRule());
372
    return NinePieceImage(newContentImage, from.imageSlices(), from.fill(), from.borderSlices(), from.outset(), from.horizontalRule(), from.verticalRule());
372
}
373
}
373
374
375
static inline FontVariationSettings blendFunc(const AnimationBase* anim, const FontVariationSettings& from, const FontVariationSettings& to, double progress)
376
{
377
    if (from.size() != to.size())
378
        return FontVariationSettings();
379
    FontVariationSettings result;
380
    unsigned size = from.size();
381
    for (unsigned i = 0; i < size; ++i) {
382
        auto& fromItem = from.at(i);
383
        auto& toItem = to.at(i);
384
        if (fromItem.tag() != toItem.tag())
385
            return FontVariationSettings();
386
        float interpolated = blendFunc(anim, fromItem.value(), toItem.value(), progress);
387
        result.insert({ fromItem.tag(), interpolated });
388
    }
389
    return result;
390
}
391
374
class AnimationPropertyWrapperBase {
392
class AnimationPropertyWrapperBase {
375
    WTF_MAKE_NONCOPYABLE(AnimationPropertyWrapperBase);
393
    WTF_MAKE_NONCOPYABLE(AnimationPropertyWrapperBase);
376
    WTF_MAKE_FAST_ALLOCATED;
394
    WTF_MAKE_FAST_ALLOCATED;
Lines 517-522 public: a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec3
517
    }
535
    }
518
};
536
};
519
537
538
class PropertyWrapperFontVariationSettings : public PropertyWrapper<FontVariationSettings> {
539
    WTF_MAKE_FAST_ALLOCATED;
540
public:
541
    PropertyWrapperFontVariationSettings(CSSPropertyID prop, FontVariationSettings (RenderStyle::*getter)() const, void (RenderStyle::*setter)(FontVariationSettings))
542
        : PropertyWrapper<FontVariationSettings>(prop, getter, setter)
543
    {
544
    }
545
546
    bool equals(const RenderStyle* a, const RenderStyle* b) const override
547
    {
548
        // If the style pointers are the same, don't bother doing the test.
549
        // If either is null, return false. If both are null, return true.
550
        if (a == b)
551
            return true;
552
        if (!a || !b)
553
            return false;
554
555
        const FontVariationSettings& variationSettingsA = (a->*m_getter)();
556
        const FontVariationSettings& variationSettingsB = (b->*m_getter)();
557
        return variationSettingsA == variationSettingsB;
558
    }
559
};
560
520
#if ENABLE(CSS_SHAPES)
561
#if ENABLE(CSS_SHAPES)
521
class PropertyWrapperShape : public RefCountedPropertyWrapper<ShapeValue> {
562
class PropertyWrapperShape : public RefCountedPropertyWrapper<ShapeValue> {
522
    WTF_MAKE_FAST_ALLOCATED;
563
    WTF_MAKE_FAST_ALLOCATED;
Lines 1438-1443 CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap() a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp_sec4
1438
1479
1439
        new PropertyWrapper<SVGLength>(CSSPropertyBaselineShift, &RenderStyle::baselineShiftValue, &RenderStyle::setBaselineShiftValue),
1480
        new PropertyWrapper<SVGLength>(CSSPropertyBaselineShift, &RenderStyle::baselineShiftValue, &RenderStyle::setBaselineShiftValue),
1440
        new PropertyWrapper<SVGLength>(CSSPropertyKerning, &RenderStyle::kerning, &RenderStyle::setKerning),
1481
        new PropertyWrapper<SVGLength>(CSSPropertyKerning, &RenderStyle::kerning, &RenderStyle::setKerning),
1482
        new PropertyWrapperFontVariationSettings(CSSPropertyFontVariationSettings, &RenderStyle::fontVariationSettings, &RenderStyle::setFontVariationSettings),
1441
    };
1483
    };
1442
    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
1484
    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
1443
1485
- a/Source/WebCore/platform/graphics/FontCache.h -2 / +5 lines
Lines 76-81 struct FontDescriptionKey { a/Source/WebCore/platform/graphics/FontCache.h_sec1
76
        , m_weight(description.weight())
76
        , m_weight(description.weight())
77
        , m_flags(makeFlagsKey(description))
77
        , m_flags(makeFlagsKey(description))
78
        , m_featureSettings(description.featureSettings())
78
        , m_featureSettings(description.featureSettings())
79
        , m_variationSettings(description.variationSettings())
79
    { }
80
    { }
80
81
81
    explicit FontDescriptionKey(WTF::HashTableDeletedValueType)
82
    explicit FontDescriptionKey(WTF::HashTableDeletedValueType)
Lines 85-91 struct FontDescriptionKey { a/Source/WebCore/platform/graphics/FontCache.h_sec2
85
    bool operator==(const FontDescriptionKey& other) const
86
    bool operator==(const FontDescriptionKey& other) const
86
    {
87
    {
87
        return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags
88
        return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags
88
            && m_featureSettings == other.m_featureSettings;
89
            && m_featureSettings == other.m_featureSettings && m_variationSettings == other.m_variationSettings;
89
    }
90
    }
90
91
91
    bool operator!=(const FontDescriptionKey& other) const
92
    bool operator!=(const FontDescriptionKey& other) const
Lines 103-108 struct FontDescriptionKey { a/Source/WebCore/platform/graphics/FontCache.h_sec3
103
        for (unsigned flagItem : m_flags)
104
        for (unsigned flagItem : m_flags)
104
            hasher.add(flagItem);
105
            hasher.add(flagItem);
105
        hasher.add(m_featureSettings.hash());
106
        hasher.add(m_featureSettings.hash());
107
        hasher.add(m_variationSettings.hash());
106
        return hasher.hash();
108
        return hasher.hash();
107
    }
109
    }
108
110
Lines 143-148 private: a/Source/WebCore/platform/graphics/FontCache.h_sec4
143
    unsigned m_weight { 0 };
145
    unsigned m_weight { 0 };
144
    std::array<unsigned, 2> m_flags {{ 0, 0 }};
146
    std::array<unsigned, 2> m_flags {{ 0, 0 }};
145
    FontFeatureSettings m_featureSettings;
147
    FontFeatureSettings m_featureSettings;
148
    FontVariationSettings m_variationSettings;
146
};
149
};
147
150
148
struct FontDescriptionKeyHash {
151
struct FontDescriptionKeyHash {
Lines 256-262 struct SynthesisPair { a/Source/WebCore/platform/graphics/FontCache.h_sec5
256
    bool needsSyntheticOblique;
259
    bool needsSyntheticOblique;
257
};
260
};
258
261
259
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, TextRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings&);
262
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, TextRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings&, const FontVariationSettings&);
260
FontWeight fontWeightFromCoreText(CGFloat weight);
263
FontWeight fontWeightFromCoreText(CGFloat weight);
261
uint16_t toCoreTextFontWeight(FontWeight);
264
uint16_t toCoreTextFontWeight(FontWeight);
262
bool isFontWeightBold(FontWeight);
265
bool isFontWeightBold(FontWeight);
- a/Source/WebCore/platform/graphics/FontDescription.cpp -1 / +1 lines
Lines 35-41 a/Source/WebCore/platform/graphics/FontDescription.cpp_sec1
35
namespace WebCore {
35
namespace WebCore {
36
36
37
struct SameSizeAsFontCascadeDescription {
37
struct SameSizeAsFontCascadeDescription {
38
    Vector<void*> vector;
38
    Vector<void*> vector[2];
39
    AtomicString string;
39
    AtomicString string;
40
    float size;
40
    float size;
41
    unsigned bitfields1;
41
    unsigned bitfields1;
- a/Source/WebCore/platform/graphics/FontDescription.h -1 / +6 lines
Lines 26-32 a/Source/WebCore/platform/graphics/FontDescription.h_sec1
26
#define FontDescription_h
26
#define FontDescription_h
27
27
28
#include "CSSValueKeywords.h"
28
#include "CSSValueKeywords.h"
29
#include "FontFeatureSettings.h"
29
#include "FontTaggedSettings.h"
30
#include "TextFlags.h"
30
#include "TextFlags.h"
31
#include "WebKitFontFamilyNames.h"
31
#include "WebKitFontFamilyNames.h"
32
#include <unicode/uscript.h>
32
#include <unicode/uscript.h>
Lines 59-64 public: a/Source/WebCore/platform/graphics/FontDescription.h_sec2
59
    NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<NonCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
59
    NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<NonCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
60
    FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>(m_widthVariant); }
60
    FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>(m_widthVariant); }
61
    const FontFeatureSettings& featureSettings() const { return m_featureSettings; }
61
    const FontFeatureSettings& featureSettings() const { return m_featureSettings; }
62
    const FontVariationSettings& variationSettings() const { return m_variationSettings; }
62
    FontSynthesis fontSynthesis() const { return static_cast<FontSynthesis>(m_fontSynthesis); }
63
    FontSynthesis fontSynthesis() const { return static_cast<FontSynthesis>(m_fontSynthesis); }
63
    FontVariantLigatures variantCommonLigatures() const { return static_cast<FontVariantLigatures>(m_variantCommonLigatures); }
64
    FontVariantLigatures variantCommonLigatures() const { return static_cast<FontVariantLigatures>(m_variantCommonLigatures); }
64
    FontVariantLigatures variantDiscretionaryLigatures() const { return static_cast<FontVariantLigatures>(m_variantDiscretionaryLigatures); }
65
    FontVariantLigatures variantDiscretionaryLigatures() const { return static_cast<FontVariantLigatures>(m_variantDiscretionaryLigatures); }
Lines 105-110 public: a/Source/WebCore/platform/graphics/FontDescription.h_sec3
105
    void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()!
106
    void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()!
106
    void setLocale(const AtomicString&);
107
    void setLocale(const AtomicString&);
107
    void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTFMove(settings); }
108
    void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTFMove(settings); }
109
    void setVariationSettings(FontVariationSettings&& settings) { m_variationSettings = WTFMove(settings); }
108
    void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
110
    void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
109
    void setVariantCommonLigatures(FontVariantLigatures variant) { m_variantCommonLigatures = static_cast<unsigned>(variant); }
111
    void setVariantCommonLigatures(FontVariantLigatures variant) { m_variantCommonLigatures = static_cast<unsigned>(variant); }
110
    void setVariantDiscretionaryLigatures(FontVariantLigatures variant) { m_variantDiscretionaryLigatures = static_cast<unsigned>(variant); }
112
    void setVariantDiscretionaryLigatures(FontVariantLigatures variant) { m_variantDiscretionaryLigatures = static_cast<unsigned>(variant); }
Lines 125-131 public: a/Source/WebCore/platform/graphics/FontDescription.h_sec4
125
    FontTraitsMask traitsMask() const;
127
    FontTraitsMask traitsMask() const;
126
128
127
private:
129
private:
130
    // FIXME: Investigate moving these into their own object on the heap (to save memory).
128
    FontFeatureSettings m_featureSettings;
131
    FontFeatureSettings m_featureSettings;
132
    FontVariationSettings m_variationSettings;
129
    AtomicString m_locale;
133
    AtomicString m_locale;
130
134
131
    float m_computedSize { 0 }; // Computed size adjusted for the minimum font size and the zoom factor.
135
    float m_computedSize { 0 }; // Computed size adjusted for the minimum font size and the zoom factor.
Lines 167-172 inline bool FontDescription::operator==(const FontDescription& other) const a/Source/WebCore/platform/graphics/FontDescription.h_sec5
167
        && m_widthVariant == other.m_widthVariant
171
        && m_widthVariant == other.m_widthVariant
168
        && m_locale == other.m_locale
172
        && m_locale == other.m_locale
169
        && m_featureSettings == other.m_featureSettings
173
        && m_featureSettings == other.m_featureSettings
174
        && m_variationSettings == other.m_variationSettings
170
        && m_fontSynthesis == other.m_fontSynthesis
175
        && m_fontSynthesis == other.m_fontSynthesis
171
        && m_variantCommonLigatures == other.m_variantCommonLigatures
176
        && m_variantCommonLigatures == other.m_variantCommonLigatures
172
        && m_variantDiscretionaryLigatures == other.m_variantDiscretionaryLigatures
177
        && m_variantDiscretionaryLigatures == other.m_variantDiscretionaryLigatures
- a/Source/WebCore/platform/graphics/FontFeatureSettings.cpp -76 lines
Lines 1-76 a/Source/WebCore/platform/graphics/FontFeatureSettings.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google 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 "FontFeatureSettings.h"
28
29
#include <wtf/text/AtomicStringHash.h>
30
31
namespace WebCore {
32
33
FontFeature::FontFeature(const FontFeatureTag& tag, int value)
34
    : m_tag(tag)
35
    , m_value(value)
36
{
37
}
38
39
FontFeature::FontFeature(FontFeatureTag&& tag, int value)
40
    : m_tag(WTFMove(tag))
41
    , m_value(value)
42
{
43
}
44
45
bool FontFeature::operator==(const FontFeature& other) const
46
{
47
    return m_tag == other.m_tag && m_value == other.m_value;
48
}
49
50
bool FontFeature::operator<(const FontFeature& other) const
51
{
52
    return (m_tag < other.m_tag) || (m_tag == other.m_tag && m_value < other.m_value);
53
}
54
55
void FontFeatureSettings::insert(FontFeature&& feature)
56
{
57
    // This vector will almost always have 0 or 1 items in it. Don't bother with the overhead of a binary search or a hash set.
58
    size_t i;
59
    for (i = 0; i < m_list.size(); ++i) {
60
        if (feature < m_list[i])
61
            break;
62
    }
63
    m_list.insert(i, WTFMove(feature));
64
}
65
66
unsigned FontFeatureSettings::hash() const
67
{
68
    IntegerHasher hasher;
69
    for (auto& feature : m_list) {
70
        hasher.add(FontFeatureTagHash::hash(feature.tag()));
71
        hasher.add(feature.value());
72
    }
73
    return hasher.hash();
74
}
75
76
}
- a/Source/WebCore/platform/graphics/FontFeatureSettings.h -93 lines
Lines 1-93 a/Source/WebCore/platform/graphics/FontFeatureSettings.h_sec1
1
/*
2
 * Copyright (C) 2011 Google 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 FontFeatureSettings_h
27
#define FontFeatureSettings_h
28
29
#include <array>
30
#include <wtf/Vector.h>
31
#include <wtf/text/AtomicString.h>
32
33
namespace WebCore {
34
35
typedef std::array<char, 4> FontFeatureTag;
36
37
inline FontFeatureTag fontFeatureTag(const char arr[4]) { return {{ arr[0], arr[1], arr[2], arr[3] }}; }
38
39
struct FontFeatureTagHash {
40
    static unsigned hash(const FontFeatureTag& characters) { return (characters[0] << 24) | (characters[1] << 16) | (characters[2] << 8) | characters[3]; }
41
    static bool equal(const FontFeatureTag& a, const FontFeatureTag& b) { return a == b; }
42
    static const bool safeToCompareToEmptyOrDeleted = true;
43
};
44
45
#define _0xFF static_cast<char>(0xFF)
46
struct FontFeatureTagHashTraits : WTF::GenericHashTraits<FontFeatureTag> {
47
    static const bool emptyValueIsZero = true;
48
    static void constructDeletedValue(FontFeatureTag& slot) { new (NotNull, std::addressof(slot)) FontFeatureTag({{ _0xFF, _0xFF, _0xFF, _0xFF }}); }
49
    static bool isDeletedValue(const FontFeatureTag& value) { return value == FontFeatureTag({{ _0xFF, _0xFF, _0xFF, _0xFF }}); }
50
};
51
#undef _0xFF
52
53
class FontFeature {
54
public:
55
    FontFeature() = delete;
56
    FontFeature(const FontFeatureTag&, int value);
57
    FontFeature(FontFeatureTag&&, int value);
58
59
    bool operator==(const FontFeature& other) const;
60
    bool operator!=(const FontFeature& other) const { return !(*this == other); }
61
    bool operator<(const FontFeature& other) const;
62
63
    const FontFeatureTag& tag() const { return m_tag; }
64
    int value() const { return m_value; }
65
    bool enabled() const { return value(); }
66
67
private:
68
    FontFeatureTag m_tag;
69
    int m_value;
70
};
71
72
class FontFeatureSettings {
73
public:
74
    void insert(FontFeature&&);
75
    bool operator==(const FontFeatureSettings& other) const { return m_list == other.m_list; }
76
    bool operator!=(const FontFeatureSettings& other) const { return !(*this == other); }
77
78
    size_t size() const { return m_list.size(); }
79
    const FontFeature& operator[](int index) const { return m_list[index]; }
80
    const FontFeature& at(size_t index) const { return m_list.at(index); }
81
82
    Vector<FontFeature>::const_iterator begin() const { return m_list.begin(); }
83
    Vector<FontFeature>::const_iterator end() const { return m_list.end(); }
84
85
    unsigned hash() const;
86
87
private:
88
    Vector<FontFeature> m_list;
89
};
90
91
}
92
93
#endif // FontFeatureSettings_h
- a/Source/WebCore/platform/graphics/FontTaggedSettings.cpp +78 lines
Line 0 a/Source/WebCore/platform/graphics/FontTaggedSettings.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google 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 "FontTaggedSettings.h"
28
29
#include "TextStream.h"
30
31
#include <wtf/text/AtomicStringHash.h>
32
33
namespace WebCore {
34
35
template <>
36
unsigned FontFeatureSettings::hash() const
37
{
38
    IntegerHasher hasher;
39
    for (auto& feature : m_list) {
40
        hasher.add(FourCharacterTagHash<FontTag>::hash(feature.tag()));
41
        hasher.add(feature.value());
42
    }
43
    return hasher.hash();
44
}
45
46
template <>
47
unsigned FontVariationSettings::hash() const
48
{
49
    static_assert(sizeof(float) == sizeof(int), "IntegerHasher needs to accept floats too");
50
    union {
51
        float f;
52
        int i;
53
    } floatToInt;
54
55
    IntegerHasher hasher;
56
    for (auto& variation : m_list) {
57
        hasher.add(FourCharacterTagHash<FontTag>::hash(variation.tag()));
58
        floatToInt.f = variation.value();
59
        hasher.add(floatToInt.i);
60
    }
61
    return hasher.hash();
62
}
63
64
TextStream& operator<<(TextStream& ts, const FontVariationSettings& item)
65
{
66
    for (unsigned i = 0; i < item.size(); ++i) {
67
        auto& variation = item.at(i);
68
        StringBuilder s;
69
        s.append(variation.tag()[0]);
70
        s.append(variation.tag()[1]);
71
        s.append(variation.tag()[2]);
72
        s.append(variation.tag()[3]);
73
        ts.dumpProperty(s.toString(), item.at(i).value());
74
    }
75
    return ts;
76
}
77
78
}
- a/Source/WebCore/platform/graphics/FontTaggedSettings.h +144 lines
Line 0 a/Source/WebCore/platform/graphics/FontTaggedSettings.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 * Copyright (C) 2016 Apple Inc. All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
#pragma once
28
29
#include <array>
30
#include <wtf/Vector.h>
31
#include <wtf/text/AtomicString.h>
32
33
namespace WebCore {
34
35
class TextStream;
36
37
typedef std::array<char, 4> FontTag;
38
39
inline FontTag fontFeatureTag(const char arr[4]) { return {{ arr[0], arr[1], arr[2], arr[3] }}; }
40
41
template <typename T>
42
struct FourCharacterTagHash {
43
    static unsigned hash(const T& characters) { return (characters[0] << 24) | (characters[1] << 16) | (characters[2] << 8) | characters[3]; }
44
    static bool equal(const T& a, const T& b) { return a == b; }
45
    static const bool safeToCompareToEmptyOrDeleted = true;
46
};
47
48
#define _0xFF static_cast<char>(0xFF)
49
template <typename T>
50
struct FourCharacterTagHashTraits : WTF::GenericHashTraits<FontTag> {
51
    static const bool emptyValueIsZero = true;
52
    static void constructDeletedValue(T& slot) { new (NotNull, std::addressof(slot)) T({{ _0xFF, _0xFF, _0xFF, _0xFF }}); }
53
    static bool isDeletedValue(const T& value) { return value == T({{ _0xFF, _0xFF, _0xFF, _0xFF }}); }
54
};
55
#undef _0xFF
56
57
template <typename T>
58
class FontTaggedSetting {
59
public:
60
    FontTaggedSetting() = delete;
61
    FontTaggedSetting(const FontTag&, T value);
62
    FontTaggedSetting(FontTag&&, T value);
63
64
    bool operator==(const FontTaggedSetting<T>& other) const;
65
    bool operator!=(const FontTaggedSetting<T>& other) const { return !(*this == other); }
66
    bool operator<(const FontTaggedSetting<T>& other) const;
67
68
    const FontTag& tag() const { return m_tag; }
69
    T value() const { return m_value; }
70
    bool enabled() const { return value(); }
71
72
private:
73
    FontTag m_tag;
74
    T m_value;
75
};
76
77
template <typename T>
78
FontTaggedSetting<T>::FontTaggedSetting(const FontTag& tag, T value)
79
    : m_tag(tag)
80
    , m_value(value)
81
{
82
}
83
84
template <typename T>
85
FontTaggedSetting<T>::FontTaggedSetting(FontTag&& tag, T value)
86
    : m_tag(WTFMove(tag))
87
    , m_value(value)
88
{
89
}
90
91
template <typename T>
92
bool FontTaggedSetting<T>::operator==(const FontTaggedSetting<T>& other) const
93
{
94
    return m_tag == other.m_tag && m_value == other.m_value;
95
}
96
97
template <typename T>
98
bool FontTaggedSetting<T>::operator<(const FontTaggedSetting<T>& other) const
99
{
100
    return (m_tag < other.m_tag) || (m_tag == other.m_tag && m_value < other.m_value);
101
}
102
103
template <typename T>
104
class FontTaggedSettings {
105
public:
106
    void insert(FontTaggedSetting<T>&&);
107
    bool operator==(const FontTaggedSettings<T>& other) const { return m_list == other.m_list; }
108
    bool operator!=(const FontTaggedSettings<T>& other) const { return !(*this == other); }
109
110
    bool isEmpty() const { return !size(); }
111
    size_t size() const { return m_list.size(); }
112
    const FontTaggedSetting<T>& operator[](int index) const { return m_list[index]; }
113
    const FontTaggedSetting<T>& at(size_t index) const { return m_list.at(index); }
114
115
    typename Vector<FontTaggedSetting<T>>::const_iterator begin() const { return m_list.begin(); }
116
    typename Vector<FontTaggedSetting<T>>::const_iterator end() const { return m_list.end(); }
117
118
    unsigned hash() const;
119
120
private:
121
    Vector<FontTaggedSetting<T>> m_list;
122
};
123
124
template <typename T>
125
void FontTaggedSettings<T>::insert(FontTaggedSetting<T>&& feature)
126
{
127
    // This vector will almost always have 0 or 1 items in it. Don't bother with the overhead of a binary search or a hash set.
128
    size_t i;
129
    for (i = 0; i < m_list.size(); ++i) {
130
        if (!(feature < m_list[i]))
131
            break;
132
    }
133
    if (i < m_list.size() && feature.tag() == m_list[i].tag())
134
        m_list.remove(i);
135
    m_list.insert(i, WTFMove(feature));
136
}
137
138
typedef FontTaggedSetting<int> FontFeature;
139
typedef FontTaggedSettings<int> FontFeatureSettings;
140
typedef FontTaggedSettings<float> FontVariationSettings;
141
142
TextStream& operator<<(TextStream&, const FontVariationSettings&);
143
144
}
- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp -11 / +28 lines
Lines 47-53 static inline void appendRawTrueTypeFeature(CFMutableArrayRef features, int type a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec1
47
    CFArrayAppendValue(features, feature.get());
47
    CFArrayAppendValue(features, feature.get());
48
}
48
}
49
49
50
static inline bool tagEquals(FontFeatureTag tag, const char comparison[4])
50
static inline bool tagEquals(FontTag tag, const char comparison[4])
51
{
51
{
52
    return equalIgnoringASCIICase(tag.data(), comparison, 4);
52
    return equalIgnoringASCIICase(tag.data(), comparison, 4);
53
}
53
}
Lines 133-139 static inline void appendTrueTypeFeature(CFMutableArrayRef features, const FontF a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec2
133
133
134
static inline void appendOpenTypeFeature(CFMutableArrayRef features, const FontFeature& feature)
134
static inline void appendOpenTypeFeature(CFMutableArrayRef features, const FontFeature& feature)
135
{
135
{
136
    RetainPtr<CFStringRef> featureKey = adoptCF(CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(feature.tag().data()), feature.tag().size() * sizeof(FontFeatureTag::value_type), kCFStringEncodingASCII, false));
136
    RetainPtr<CFStringRef> featureKey = adoptCF(CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(feature.tag().data()), feature.tag().size() * sizeof(FontTag::value_type), kCFStringEncodingASCII, false));
137
    int rawFeatureValue = feature.value();
137
    int rawFeatureValue = feature.value();
138
    RetainPtr<CFNumberRef> featureValue = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &rawFeatureValue));
138
    RetainPtr<CFNumberRef> featureValue = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &rawFeatureValue));
139
    CFTypeRef featureDictionaryKeys[] = { kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue };
139
    CFTypeRef featureDictionaryKeys[] = { kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue };
Lines 142-148 static inline void appendOpenTypeFeature(CFMutableArrayRef features, const FontF a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec3
142
    CFArrayAppendValue(features, featureDictionary.get());
142
    CFArrayAppendValue(features, featureDictionary.get());
143
}
143
}
144
144
145
typedef HashMap<FontFeatureTag, int, FontFeatureTagHash, FontFeatureTagHashTraits> FeaturesMap;
145
typedef HashMap<FontTag, int, FourCharacterTagHash<FontTag>, FourCharacterTagHashTraits<FontTag>> FeaturesMap;
146
typedef HashMap<FontTag, float, FourCharacterTagHash<FontTag>, FourCharacterTagHashTraits<FontTag>> VariationsMap;
146
147
147
static FeaturesMap computeFeatureSettingsFromVariants(const FontVariantSettings& variantSettings)
148
static FeaturesMap computeFeatureSettingsFromVariants(const FontVariantSettings& variantSettings)
148
{
149
{
Lines 360-368 static FeaturesMap computeFeatureSettingsFromVariants(const FontVariantSettings& a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec4
360
    return result;
361
    return result;
361
}
362
}
362
363
363
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, TextRenderingMode textRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings& variantSettings)
364
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, TextRenderingMode textRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings& variantSettings, const FontVariationSettings& variations)
364
{
365
{
365
    if (!originalFont || (!features.size() && (textRenderingMode == AutoTextRendering) && variantSettings.isAllNormal()
366
    if (!originalFont || (!features.size() && variations.isEmpty() && (textRenderingMode == AutoTextRendering) && variantSettings.isAllNormal()
366
        && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
367
        && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
367
        return originalFont;
368
        return originalFont;
368
369
Lines 398-405 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, TextRenderingMo a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec5
398
    for (auto& newFeature : features)
399
    for (auto& newFeature : features)
399
        featuresToBeApplied.set(newFeature.tag(), newFeature.value());
400
        featuresToBeApplied.set(newFeature.tag(), newFeature.value());
400
401
402
    VariationsMap variationsToBeApplied;
403
    for (auto& newVariation : variations)
404
        variationsToBeApplied.set(newVariation.tag(), newVariation.value());
405
401
    RetainPtr<CFMutableDictionaryRef> attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
406
    RetainPtr<CFMutableDictionaryRef> attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
402
    if (featuresToBeApplied.size()) {
407
    if (!featuresToBeApplied.isEmpty()) {
403
        RetainPtr<CFMutableArrayRef> featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &kCFTypeArrayCallBacks));
408
        RetainPtr<CFMutableArrayRef> featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &kCFTypeArrayCallBacks));
404
        for (auto& p : featuresToBeApplied) {
409
        for (auto& p : featuresToBeApplied) {
405
            auto feature = FontFeature(p.key, p.value);
410
            auto feature = FontFeature(p.key, p.value);
Lines 408-413 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, TextRenderingMo a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec6
408
        }
413
        }
409
        CFDictionaryAddValue(attributes.get(), kCTFontFeatureSettingsAttribute, featureArray.get());
414
        CFDictionaryAddValue(attributes.get(), kCTFontFeatureSettingsAttribute, featureArray.get());
410
    }
415
    }
416
417
    if (!variationsToBeApplied.isEmpty()) {
418
        auto variationDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
419
        for (auto& p : variationsToBeApplied) {
420
            long long bitwiseTag = p.key[0] << 24 | p.key[1] << 16 | p.key[2] << 8 | p.key[3];
421
            auto tagNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberLongLongType, &bitwiseTag));
422
            auto valueNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &p.value));
423
            CFDictionarySetValue(variationDictionary.get(), tagNumber.get(), valueNumber.get());
424
        }
425
        CFDictionaryAddValue(attributes.get(), kCTFontVariationAttribute, variationDictionary.get());
426
    }
427
411
    if (textRenderingMode == OptimizeLegibility) {
428
    if (textRenderingMode == OptimizeLegibility) {
412
        CGFloat size = CTFontGetSize(originalFont);
429
        CGFloat size = CTFontGetSize(originalFont);
413
        RetainPtr<CFNumberRef> sizeNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCGFloatType, &size));
430
        RetainPtr<CFNumberRef> sizeNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCGFloatType, &size));
Lines 671-677 static RetainPtr<CTFontRef> platformFontLookupWithFamily(const AtomicString& fam a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec7
671
}
688
}
672
#endif
689
#endif
673
690
674
static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size)
691
static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontVariationSettings& variationSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size)
675
{
692
{
676
    if (family.isEmpty())
693
    if (family.isEmpty())
677
        return nullptr;
694
        return nullptr;
Lines 684-690 static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSym a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec8
684
        foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
701
        foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
685
#endif
702
#endif
686
    }
703
    }
687
    return preparePlatformFont(foundFont.get(), textRenderingMode, fontFaceFeatures, fontFaceVariantSettings, featureSettings, variantSettings);
704
    return preparePlatformFont(foundFont.get(), textRenderingMode, fontFaceFeatures, fontFaceVariantSettings, featureSettings, variantSettings, variationSettings);
688
}
705
}
689
706
690
#if PLATFORM(MAC)
707
#if PLATFORM(MAC)
Lines 724-730 std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec9
724
    CTFontSymbolicTraits traits = computeTraits(fontDescription);
741
    CTFontSymbolicTraits traits = computeTraits(fontDescription);
725
    float size = fontDescription.computedPixelSize();
742
    float size = fontDescription.computedPixelSize();
726
743
727
    RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
744
    RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.variationSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
728
745
729
#if PLATFORM(MAC)
746
#if PLATFORM(MAC)
730
    if (!font) {
747
    if (!font) {
Lines 735-741 std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec10
735
        // Ignore the result because we want to use our own algorithm to actually find the font.
752
        // Ignore the result because we want to use our own algorithm to actually find the font.
736
        autoActivateFont(family.string(), size);
753
        autoActivateFont(family.string(), size);
737
754
738
        font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
755
        font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.variationSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
739
    }
756
    }
740
#endif
757
#endif
741
758
Lines 779-785 RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp_sec11
779
796
780
    const FontPlatformData& platformData = originalFontData->platformData();
797
    const FontPlatformData& platformData = originalFontData->platformData();
781
    RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length);
798
    RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length);
782
    result = preparePlatformFont(result.get(), description.textRenderingMode(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
799
    result = preparePlatformFont(result.get(), description.textRenderingMode(), nullptr, nullptr, description.featureSettings(), description.variantSettings(), description.variationSettings());
783
    if (!result)
800
    if (!result)
784
        return lastResortFallbackFont(description);
801
        return lastResortFallbackFont(description);
785
802
- a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm -8 / +34 lines
Lines 99-109 inline int mapFontWidthVariantToCTFeatureSelector(FontWidthVariant variant) a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm_sec1
99
    return TextSpacingProportional;
99
    return TextSpacingProportional;
100
}
100
}
101
101
102
static CTFontDescriptorRef cascadeToLastResortFontDescriptor()
102
static CFDictionaryRef cascadeToLastResortAttributesDictionary()
103
{
103
{
104
    static CTFontDescriptorRef descriptor;
104
    static CFDictionaryRef attributes = nullptr;
105
    if (descriptor)
105
    if (attributes)
106
        return descriptor;
106
        return attributes;
107
107
108
    RetainPtr<CTFontDescriptorRef> lastResort = adoptCF(CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0));
108
    RetainPtr<CTFontDescriptorRef> lastResort = adoptCF(CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0));
109
109
Lines 112-122 static CTFontDescriptorRef cascadeToLastResortFontDescriptor() a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm_sec2
112
112
113
    const void* keys[] = { kCTFontCascadeListAttribute };
113
    const void* keys[] = { kCTFontCascadeListAttribute };
114
    const void* values[] = { array.get() };
114
    const void* values[] = { array.get() };
115
    RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
115
    attributes = CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
116
117
    return attributes;
118
}
119
120
static RetainPtr<CTFontDescriptorRef> cascadeToLastResortAnVariationsFontDescriptor(CTFontRef originalFont)
121
{
122
// FIXME: Remove this when <rdar://problem/28449441> is fixed.
123
#define WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000))
116
124
117
    descriptor = CTFontDescriptorCreateWithAttributes(attributes.get());
125
#if WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
126
    CFDictionaryRef attributes = cascadeToLastResortAttributesDictionary();
127
    auto variations = adoptCF(static_cast<CFDictionaryRef>(CTFontCopyAttribute(originalFont, kCTFontVariationAttribute)));
128
    if (!variations)
129
#endif
130
    {
131
        UNUSED_PARAM(originalFont);
132
133
        static CTFontDescriptorRef descriptor = nullptr;
134
        if (descriptor)
135
            return descriptor;
118
136
119
    return descriptor;
137
        descriptor = CTFontDescriptorCreateWithAttributes(attributes);
138
        return descriptor;
139
    }
140
#if WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
141
    auto mutableAttributes = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, attributes));
142
    CFDictionaryAddValue(mutableAttributes.get(), kCTFontVariationAttribute, variations.get());
143
    return adoptCF(CTFontDescriptorCreateWithAttributes(mutableAttributes.get()));
144
#endif
145
#undef WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
120
}
146
}
121
147
122
CTFontRef FontPlatformData::ctFont() const
148
CTFontRef FontPlatformData::ctFont() const
Lines 128-134 CTFontRef FontPlatformData::ctFont() const a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm_sec3
128
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000)
154
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000)
129
    ASSERT(m_cgFont);
155
    ASSERT(m_cgFont);
130
#endif
156
#endif
131
    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
157
    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, 0, cascadeToLastResortAnVariationsFontDescriptor(m_font.get()).get()));
132
158
133
    if (m_widthVariant != RegularWidth) {
159
    if (m_widthVariant != RegularWidth) {
134
        int featureTypeValue = kTextSpacingType;
160
        int featureTypeValue = kTextSpacingType;
- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp -1 / +1 lines
Lines 40-46 FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp_sec1
40
    FontOrientation orientation = fontDescription.orientation();
40
    FontOrientation orientation = fontDescription.orientation();
41
    FontWidthVariant widthVariant = fontDescription.widthVariant();
41
    FontWidthVariant widthVariant = fontDescription.widthVariant();
42
    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
42
    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
43
    font = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), &fontFaceFeatures, &fontFaceVariantSettings, fontDescription.featureSettings(), fontDescription.variantSettings());
43
    font = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), &fontFaceFeatures, &fontFaceVariantSettings, fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.variationSettings());
44
    ASSERT(font);
44
    ASSERT(font);
45
    return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
45
    return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
46
}
46
}
- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h -1 / +3 lines
Lines 33-42 typedef const struct __CTFontDescriptor* CTFontDescriptorRef; a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h_sec1
33
namespace WebCore {
33
namespace WebCore {
34
34
35
class FontDescription;
35
class FontDescription;
36
class FontFeatureSettings;
37
class FontPlatformData;
36
class FontPlatformData;
38
class SharedBuffer;
37
class SharedBuffer;
39
38
39
template <typename T> class FontTaggedSettings;
40
typedef FontTaggedSettings<int> FontFeatureSettings;
41
40
struct FontCustomPlatformData {
42
struct FontCustomPlatformData {
41
    WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
43
    WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
42
public:
44
public:
- a/Source/WebCore/rendering/RenderThemeIOS.mm -1 / +1 lines
Lines 1278-1284 void RenderThemeIOS::updateCachedSystemFontDescription(CSSValueID valueID, FontC a/Source/WebCore/rendering/RenderThemeIOS.mm_sec1
1278
1278
1279
    ASSERT(fontDescriptor);
1279
    ASSERT(fontDescriptor);
1280
    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
1280
    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
1281
    font = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings());
1281
    font = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.variationSettings());
1282
    fontDescription.setIsAbsoluteSize(true);
1282
    fontDescription.setIsAbsoluteSize(true);
1283
    fontDescription.setOneFamily(textStyle);
1283
    fontDescription.setOneFamily(textStyle);
1284
    fontDescription.setSpecifiedSize(CTFontGetSize(font.get()));
1284
    fontDescription.setSpecifiedSize(CTFontGetSize(font.get()));
- a/Source/WebCore/rendering/style/RenderStyle.cpp +10 lines
Lines 1550-1555 void RenderStyle::setFontSize(float size) a/Source/WebCore/rendering/style/RenderStyle.cpp_sec1
1550
    fontCascade().update(currentFontSelector);
1550
    fontCascade().update(currentFontSelector);
1551
}
1551
}
1552
1552
1553
void RenderStyle::setFontVariationSettings(FontVariationSettings settings)
1554
{
1555
    FontSelector* currentFontSelector = fontCascade().fontSelector();
1556
    auto description = fontDescription();
1557
    description.setVariationSettings(WTFMove(settings));
1558
1559
    setFontDescription(description);
1560
    fontCascade().update(currentFontSelector);
1561
}
1562
1553
void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, LayoutUnit &right, LayoutUnit &bottom, LayoutUnit &left) const
1563
void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit &top, LayoutUnit &right, LayoutUnit &bottom, LayoutUnit &left) const
1554
{
1564
{
1555
    top = 0;
1565
    top = 0;
- a/Source/WebCore/rendering/style/RenderStyle.h +2 lines
Lines 719-724 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
719
    float specifiedFontSize() const;
719
    float specifiedFontSize() const;
720
    float computedFontSize() const;
720
    float computedFontSize() const;
721
    int fontSize() const;
721
    int fontSize() const;
722
    FontVariationSettings fontVariationSettings() const { return fontDescription().variationSettings(); }
722
    std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation();
723
    std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation();
723
724
724
    const Length& textIndent() const { return rareInheritedData->indent; }
725
    const Length& textIndent() const { return rareInheritedData->indent; }
Lines 1367-1372 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
1367
    bool setFontDescription(const FontCascadeDescription&);
1368
    bool setFontDescription(const FontCascadeDescription&);
1368
    // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
1369
    // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
1369
    void setFontSize(float);
1370
    void setFontSize(float);
1371
    void setFontVariationSettings(FontVariationSettings);
1370
1372
1371
    void setColor(const Color&);
1373
    void setColor(const Color&);
1372
    void setTextIndent(Length length) { SET_VAR(rareInheritedData, indent, WTFMove(length)); }
1374
    void setTextIndent(Length length) { SET_VAR(rareInheritedData, indent, WTFMove(length)); }
- a/LayoutTests/ChangeLog +38 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2016-09-28  Myles C. Maxfield  <mmaxfield@apple.com>
2
3
        [Cocoa] Implement font-variation-settings
4
        https://bugs.webkit.org/show_bug.cgi?id=162490
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add tests. These tests use the Skia font which is a variation font preinstalled on macOS.
9
        Eventually I'd like to build a test font for variations, but Skia will suffice until I can
10
        do that.
11
12
        * TestExpectations: Only macOS and iOS support font variations, so mark these new
13
        tests as failing on other platforms.
14
        * animations/font-variation-settings-expected.html: Added.
15
        * animations/font-variation-settings.html: Added.
16
        * animations/font-variation-settings-order-expected.html: Added.
17
        * animations/font-variation-settings-order.html: Added.
18
        * animations/font-variation-settings-unlike-expected.html: Added.
19
        * animations/font-variation-settings-unlike.html: Added.
20
        * animations/resources/animation-test-helpers.js: Update to be able to test animations
21
        with font-variant-settings
22
        (compareFontVariationSettings):
23
        (getPropertyValue):
24
        (comparePropertyValue):
25
        * fast/text/variations/duplicate-expected.html: Added.
26
        * fast/text/variations/duplicate.html: Added.
27
        * fast/text/variations/exist-expected-mismatch.html: Added.
28
        * fast/text/variations/exist.html: Added.
29
        * fast/text/variations/getComputedStyle-expected.txt: Added.
30
        * fast/text/variations/getComputedStyle.html: Added.
31
        * fast/text/variations/inheritance-expected.html: Added.
32
        * fast/text/variations/inheritance.html: Added.
33
        * fast/text/variations/order-expected.html: Added.
34
        * fast/text/variations/order.html: Added.
35
        * fast/text/variations/outofbounds-expected.html: Added.
36
        * fast/text/variations/outofbounds.html: Added.
37
        * platform/mac/TestExpectations:
38
1
2016-09-28  Ryan Haddad  <ryanhaddad@apple.com>
39
2016-09-28  Ryan Haddad  <ryanhaddad@apple.com>
2
40
3
        Update TestExpectations for crashing fast/images tests.
41
        Update TestExpectations for crashing fast/images tests.
- a/LayoutTests/TestExpectations +4 lines
Lines 992-994 webkit.org/b/162696 [ Release ] fast/images/paint-subrect-grid.html [ Crash ] a/LayoutTests/TestExpectations_sec1
992
webkit.org/b/162696 [ Release ] fast/images/pdf-as-image-crop-box.html [ Crash ]
992
webkit.org/b/162696 [ Release ] fast/images/pdf-as-image-crop-box.html [ Crash ]
993
webkit.org/b/162696 [ Release ] fast/images/link-body-content-imageDimensionChanged-crash.html [ Crash ]
993
webkit.org/b/162696 [ Release ] fast/images/link-body-content-imageDimensionChanged-crash.html [ Crash ]
994
webkit.org/b/162696 [ Release ] fast/images/object-data-url-case-insensitivity.html [ Crash ]
994
webkit.org/b/162696 [ Release ] fast/images/object-data-url-case-insensitivity.html [ Crash ]
995
996
# iOS and macOS are the only ports which support font variations.
997
fast/text/variations [ Pass ImageOnlyFailure Failure ]
998
animations/font-variation-settings.html [ Pass ImageOnlyFailure ]
- a/LayoutTests/animations/font-variation-settings-expected.html +11 lines
Line 0 a/LayoutTests/animations/font-variation-settings-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font: 100px 'Skia'; font-variation-settings: 'wght' 2.3">Hello</div>
7
<div>PASS - "font-variation-settings" property for "box" element at 0.5s saw something close to: 'wght' 0.95<br>
8
PASS - "font-variation-settings" property for "box" element at 1s saw something close to: 'wght' 1.4<br>
9
PASS - "font-variation-settings" property for "box" element at 2s saw something close to: 'wght' 2.3</div>
10
</body>
11
</html>
- a/LayoutTests/animations/font-variation-settings-order-expected.html +11 lines
Line 0 a/LayoutTests/animations/font-variation-settings-order-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font: 100px 'Skia'; font-variation-settings: 'wght' 2.3, 'wdth' 1.1">Hello</div>
7
<div>PASS - "font-variation-settings" property for "box" element at 0.5s saw something close to: 'wght' 0.95, 'wdth' 0.95<br>
8
PASS - "font-variation-settings" property for "box" element at 1s saw something close to: 'wght' 1.4, 'wdth' 1<br>
9
PASS - "font-variation-settings" property for "box" element at 2s saw something close to: 'wght' 2.3, 'wdth' 1.1</div>
10
</body>
11
</html>
- a/LayoutTests/animations/font-variation-settings-order.html +36 lines
Line 0 a/LayoutTests/animations/font-variation-settings-order.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="resources/animation-test-helpers.js"></script>
5
<style>
6
@keyframes "weightAnimation" {
7
    from {
8
        font-variation-settings: "wght" 0.5, "wdth" 0.9;
9
    }
10
    to {
11
        font-variation-settings: "wdth" 1.2, "wght" 3.2;
12
    }
13
}
14
15
#box {
16
    font: 100px "Skia";
17
    animation-name: "weightAnimation";
18
    animation-duration: 3s;
19
    animation-timing-function: linear;
20
}
21
</style>
22
</head>
23
<body>
24
<div id="box">Hello</div>
25
<div id="result"></div>
26
<script>
27
var expectedValues = [
28
    // [animation-name, time, element-id, property, expected-value, tolerance]
29
    ["weightAnimation", 0.5, "box", "font-variation-settings", "'wght' 0.95, 'wdth' 0.95", 0.05],
30
    ["weightAnimation", 1.0, "box", "font-variation-settings", "'wght' 1.4, 'wdth' 1", 0.05],
31
    ["weightAnimation", 2.0, "box", "font-variation-settings", "'wght' 2.3, 'wdth' 1.1", 0.05],
32
];
33
runAnimationTest(expectedValues, undefined, undefined, undefined, true, undefined);
34
</script>
35
</body>
36
</html>
- a/LayoutTests/animations/font-variation-settings-unlike-expected.html +11 lines
Line 0 a/LayoutTests/animations/font-variation-settings-unlike-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font: 100px 'Skia';">Hello</div>
7
<div>PASS - "font-variation-settings" property for "box" element at 0.5s saw something close to: normal<br>
8
PASS - "font-variation-settings" property for "box" element at 1s saw something close to: normal<br>
9
PASS - "font-variation-settings" property for "box" element at 2s saw something close to: normal</div>
10
</body>
11
</html>
- a/LayoutTests/animations/font-variation-settings-unlike.html +36 lines
Line 0 a/LayoutTests/animations/font-variation-settings-unlike.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="resources/animation-test-helpers.js"></script>
5
<style>
6
@keyframes "weightAnimation" {
7
    from {
8
        font-variation-settings: "wght" 0.5, "wdth" 0.9;
9
    }
10
    to {
11
        font-variation-settings: "wght" 3.2;
12
    }
13
}
14
15
#box {
16
    font: 100px "Skia";
17
    animation-name: "weightAnimation";
18
    animation-duration: 3s;
19
    animation-timing-function: linear;
20
}
21
</style>
22
</head>
23
<body>
24
<div id="box">Hello</div>
25
<div id="result"></div>
26
<script>
27
var expectedValues = [
28
    // [animation-name, time, element-id, property, expected-value, tolerance]
29
    ["weightAnimation", 0.5, "box", "font-variation-settings", "normal", 0.05],
30
    ["weightAnimation", 1.0, "box", "font-variation-settings", "normal", 0.05],
31
    ["weightAnimation", 2.0, "box", "font-variation-settings", "normal", 0.05],
32
];
33
runAnimationTest(expectedValues, undefined, undefined, undefined, true, undefined);
34
</script>
35
</body>
36
</html>
- a/LayoutTests/animations/font-variation-settings.html +36 lines
Line 0 a/LayoutTests/animations/font-variation-settings.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="resources/animation-test-helpers.js"></script>
5
<style>
6
@keyframes "weightAnimation" {
7
    from {
8
        font-variation-settings: "wght" 0.5;
9
    }
10
    to {
11
        font-variation-settings: "wght" 3.2;
12
    }
13
}
14
15
#box {
16
    font: 100px "Skia";
17
    animation-name: "weightAnimation";
18
    animation-duration: 3s;
19
    animation-timing-function: linear;
20
}
21
</style>
22
</head>
23
<body>
24
<div id="box">Hello</div>
25
<div id="result"></div>
26
<script>
27
var expectedValues = [
28
    // [animation-name, time, element-id, property, expected-value, tolerance]
29
    ["weightAnimation", 0.5, "box", "font-variation-settings", "'wght' 0.95", 0.05],
30
    ["weightAnimation", 1.0, "box", "font-variation-settings", "'wght' 1.4", 0.05],
31
    ["weightAnimation", 2.0, "box", "font-variation-settings", "'wght' 2.3", 0.05],
32
];
33
runAnimationTest(expectedValues, undefined, undefined, undefined, true, undefined);
34
</script>
35
</body>
36
</html>
- a/LayoutTests/animations/resources/animation-test-helpers.js -2 / +27 lines
Lines 258-263 function compareCSSImages(computedValue, expectedValue, tolerance) a/LayoutTests/animations/resources/animation-test-helpers.js_sec1
258
    }
258
    }
259
}
259
}
260
260
261
function compareFontVariationSettings(computedValue, expectedValue, tolerance)
262
{
263
    if (computedValue == "normal" || expectedValue == "normal")
264
        return computedValue == expectedValue;
265
    var computed = computedValue.split(", ");
266
    var expected = expectedValue.split(", ");
267
    if (computed.length != expected.length)
268
        return false;
269
    for (var i = 0; i < computed.length; ++i) {
270
        var computedPieces = computed[i].split(" ");
271
        var expectedPieces = expected[i].split(" ");
272
        if (computedPieces.length != 2 || expectedPieces.length != 2)
273
            return false;
274
        if (computedPieces[0] != expectedPieces[0])
275
            return false;
276
        var computedNumber = Number.parseFloat(computedPieces[1]);
277
        var expectedNumber = Number.parseFloat(expectedPieces[1]);
278
        if (Math.abs(computedNumber - expectedNumber) > tolerance)
279
            return false;
280
    }
281
    return true;
282
}
283
261
// Called by CSS Image function filter() as well as filter property.
284
// Called by CSS Image function filter() as well as filter property.
262
function compareFilterFunctions(computedValue, expectedValue, tolerance)
285
function compareFilterFunctions(computedValue, expectedValue, tolerance)
263
{
286
{
Lines 401-406 function getPropertyValue(property, elementId, iframeId) a/LayoutTests/animations/resources/animation-test-helpers.js_sec2
401
               || property == "webkitClipPath"
424
               || property == "webkitClipPath"
402
               || property == "webkitShapeInside"
425
               || property == "webkitShapeInside"
403
               || property == "webkitShapeOutside"
426
               || property == "webkitShapeOutside"
427
               || property == "font-variation-settings"
404
               || !property.indexOf("webkitTransform")
428
               || !property.indexOf("webkitTransform")
405
               || !property.indexOf("transform")) {
429
               || !property.indexOf("transform")) {
406
        computedValue = window.getComputedStyle(element)[property.split(".")[0]];
430
        computedValue = window.getComputedStyle(element)[property.split(".")[0]];
Lines 446-454 function comparePropertyValue(property, computedValue, expectedValue, tolerance) a/LayoutTests/animations/resources/animation-test-helpers.js_sec3
446
               || property == "webkitMaskImage"
470
               || property == "webkitMaskImage"
447
               || property == "webkitMaskBoxImage")
471
               || property == "webkitMaskBoxImage")
448
        result = compareCSSImages(computedValue, expectedValue, tolerance);
472
        result = compareCSSImages(computedValue, expectedValue, tolerance);
449
    else {
473
    else if (property == "font-variation-settings")
474
        result = compareFontVariationSettings(computedValue, expectedValue, tolerance);
475
    else
450
        result = isCloseEnough(computedValue, expectedValue, tolerance);
476
        result = isCloseEnough(computedValue, expectedValue, tolerance);
451
    }
452
    return result;
477
    return result;
453
}
478
}
454
479
- a/LayoutTests/fast/text/variations/duplicate-expected.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/duplicate-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 3;">Test passes if this text has a weight of 3.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/duplicate.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/duplicate.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 2, 'wght' 3;">Test passes if this text has a weight of 3.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/exist-expected-mismatch.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/exist-expected-mismatch.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia';">Test passes if this text is bold.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/exist.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/exist.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 2;">Test passes if this text is bold.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/getComputedStyle-expected.txt +12 lines
Line 0 a/LayoutTests/fast/text/variations/getComputedStyle-expected.txt_sec1
1
PASS window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings') is "'wght' 2"
2
PASS window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings') is "'wght' 3"
3
PASS window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings') is "'wght' 2, 'wdth' 1.2"
4
PASS window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings') is window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings')
5
PASS window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings') is "normal"
6
PASS window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings') is "normal"
7
PASS window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings') is "normal"
8
PASS window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings') is "'wght' 27"
9
PASS successfullyParsed is true
10
11
TEST COMPLETE
12
- a/LayoutTests/fast/text/variations/getComputedStyle.html +28 lines
Line 0 a/LayoutTests/fast/text/variations/getComputedStyle.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<script src="../../../resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<div id="test0" style="font-family: 'Skia'; font-variation-settings: 'wght' 2;"></div>
9
<div id="test1" style="font-family: 'Skia'; font-variation-settings: 'wght' 2, 'wght' 3;"></div>
10
<div id="test2" style="font-family: 'Skia'; font-variation-settings: 'wght' 2, 'wdth' 1.2;"></div>
11
<div id="test3" style="font-family: 'Skia'; font-variation-settings: 'wdth' 1.2, 'wght' 2;"></div>
12
<div id="test4" style="font-family: 'Skia'; font-variation-settings: normal;"></div>
13
<div id="test5" style="font-family: 'Skia'; font-variation-settings: 'abcde' 3;"></div>
14
<div id="test6" style="font-family: 'Skia'; font-variation-settings: 'abc한국어e' 3;"></div>
15
<div id="test7" style="font-family: 'Skia'; font-variation-settings: 'wght' 27;"></div>
16
<script>
17
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings')", "'wght' 2");
18
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings')", "'wght' 3");
19
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "'wght' 2, 'wdth' 1.2");
20
shouldBe("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings')");
21
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings')", "normal");
22
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings')", "normal");
23
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings')", "normal");
24
shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings')", "'wght' 27");
25
</script>
26
<script src="../../../resources/js-test-post.js"></script>
27
</body>
28
</html>
- a/LayoutTests/fast/text/variations/inheritance-expected.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/inheritance-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 2;">Test passes if this text is bold.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/inheritance.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/inheritance.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 2;"><div>Test passes if this text is bold.</div></div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/order-expected.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/order-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wdth' 1.2, 'wght' 2;">Test passes if this text has a weight of 3.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/order.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/order.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 2, 'wdth' 1.2;">Test passes if this text has a weight of 3.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/outofbounds-expected.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/outofbounds-expected.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia';">Test passes if this text is not bold.</div>
7
</body>
8
</html>
- a/LayoutTests/fast/text/variations/outofbounds.html +8 lines
Line 0 a/LayoutTests/fast/text/variations/outofbounds.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
</head>
5
<body>
6
<div style="font-family: 'Skia'; font-variation-settings: 'wght' 27;">Test passes if this text is not bold.</div>
7
</body>
8
</html>
- a/LayoutTests/platform/mac/TestExpectations +4 lines
Lines 1456-1458 webkit.org/b/162523 [ Sierra+ ] imported/w3c/web-platform-tests/media-source/med a/LayoutTests/platform/mac/TestExpectations_sec1
1456
webkit.org/b/162626 imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html [ Pass Failure ]
1456
webkit.org/b/162626 imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html [ Pass Failure ]
1457
1457
1458
webkit.org/b/162647 [ Sierra+ ] http/tests/xmlhttprequest/onabort-response-getters.html [ Pass Failure ]
1458
webkit.org/b/162647 [ Sierra+ ] http/tests/xmlhttprequest/onabort-response-getters.html [ Pass Failure ]
1459
1460
# iOS and macOS are the only ports which support font variations.
1461
fast/text/variations [ Pass ]
1462
animations/font-variation-settings.html [ Pass ]

Return to Bug 162490