Changeset 243637 in webkit
- Timestamp:
- Mar 28, 2019, 7:26:47 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/font-face-family-expected.txt (added)
-
LayoutTests/fast/text/font-face-family.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/FontFace.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243635 r243637 1 2019-03-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 FontFace constructor throws an exception when there is a name which starts with a number 4 https://bugs.webkit.org/show_bug.cgi?id=196232 5 <rdar://problem/49293978> 6 7 Reviewed by Ryosuke Niwa. 8 9 * fast/text/font-face-family-expected.txt: Added. 10 * fast/text/font-face-family.html: Added. 11 1 12 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r243636 r243637 1 2019-03-28 Myles C. Maxfield <mmaxfield@apple.com> 2 3 FontFace constructor throws an exception when there is a name which starts with a number 4 https://bugs.webkit.org/show_bug.cgi?id=196232 5 <rdar://problem/49293978> 6 7 Reviewed by Ryosuke Niwa. 8 9 We were technically following the spec, but Chrome and Firefox are both consistent and it was making a website break. 10 This is just a short-term fix until the underlying https://bugs.webkit.org/show_bug.cgi?id=196381 is fixed. 11 12 Test: fast/text/font-face-family.html 13 14 * css/FontFace.cpp: 15 (WebCore::FontFace::setFamily): 16 1 17 2019-03-28 Justin Fan <justin_fan@apple.com> 2 18 -
trunk/Source/WebCore/css/FontFace.cpp
r243163 r243637 154 154 return Exception { SyntaxError }; 155 155 156 bool success = false; 157 if (auto value = parseString(family, CSSPropertyFontFamily)) 158 success = m_backing->setFamilies(*value); 156 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=196381 Don't use a list here. 157 // See consumeFontFamilyDescriptor() in CSSPropertyParser.cpp for why we're using it. 158 auto list = CSSValueList::createCommaSeparated(); 159 list->append(CSSValuePool::singleton().createFontFamilyValue(family)); 160 bool success = m_backing->setFamilies(list); 159 161 if (!success) 160 162 return Exception { SyntaxError }; … … 294 296 { 295 297 m_backing->updateStyleIfNeeded(); 298 299 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=196381 This is only here because CSSFontFace erroneously uses a list of values instead of a single value. 300 // See consumeFontFamilyDescriptor() in CSSPropertyParser.cpp. 301 if (m_backing->families()->length() == 1) { 302 if (m_backing->families()->item(0)) { 303 auto& item = *m_backing->families()->item(0); 304 if (item.isPrimitiveValue()) { 305 auto& primitiveValue = downcast<CSSPrimitiveValue>(item); 306 if (primitiveValue.isFontFamily()) { 307 auto& fontFamily = primitiveValue.fontFamily(); 308 return fontFamily.familyName; 309 } 310 } 311 } 312 } 296 313 return m_backing->families()->cssText(); 297 314 } -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r243318 r243637 1088 1088 static RefPtr<CSSValueList> consumeFontFamilyDescriptor(CSSParserTokenRange& range) 1089 1089 { 1090 // FIXME-NEWPARSER: For compatibility with the old parser, we have to make1090 // FIXME-NEWPARSER: https://bugs.webkit.org/show_bug.cgi?id=196381 For compatibility with the old parser, we have to make 1091 1091 // a list here, even though the list always contains only a single family name. 1092 1092 // Once the old parser is gone, we can delete this function, make the caller
Note:
See TracChangeset
for help on using the changeset viewer.