Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Unified Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 1103273010: Add parseFontFaceDescriptor for @font-face handling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: V2 Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/BisonCSSParser-in.cpp
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index a8d1d666440dcd57a5faf4e17f3ad3dc193b1808..075f8eac1c9a4c7b4078cc8a11b889a21555a4e8 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -726,19 +726,11 @@ StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector>>
StyleRuleBase* BisonCSSParser::createFontFaceRule()
{
m_allowImportRules = m_allowNamespaceDeclarations = false;
- for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
- CSSProperty& property = m_parsedProperties[i];
- if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) {
- // Unlike font-family property, font-family descriptor in @font-face rule
- // has to be a value list with exactly one family name. It cannot have a
- // have 'initial' value and cannot 'inherit' from parent.
- // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
- clearProperties();
- return 0;
- }
- }
RefPtrWillBeRawPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create();
- rule->setProperties(createStylePropertySet());
+ if (!rule->setProperties(createStylePropertySet())) {
+ clearProperties();
+ return nullptr;
+ }
clearProperties();
StyleRuleFontFace* result = rule.get();
m_parsedRules.append(rule.release());

Powered by Google App Engine
This is Rietveld 408576698