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

Unified Diff: third_party/WebKit/Source/core/css/FontFace.cpp

Issue 1363233002: Restrict font-family in @font-face to <family-name> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: third_party/WebKit/Source/core/css/FontFace.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp
index 6e096c0420eedcafa1ca78213b8192fe1aeb8b6c..91dee225068c2ce5022334c885f717dfd47367c6 100644
--- a/third_party/WebKit/Source/core/css/FontFace.cpp
+++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -112,7 +112,7 @@ PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl
// Obtain the font-family property and the src property. Both must be defined.
RefPtrWillBeRawPtr<CSSValue> family = properties.getPropertyCSSValue(CSSPropertyFontFamily);
- if (!family || !family->isValueList())
+ if (!family || !family->isPrimitiveValue())
return nullptr;
RefPtrWillBeRawPtr<CSSValue> src = properties.getPropertyCSSValue(CSSPropertySrc);
if (!src || !src->isValueList())
@@ -120,7 +120,7 @@ PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl
RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(document));
- if (fontFace->setFamilyValue(toCSSValueList(family.get()))
+ if (fontFace->setFamilyValue(toCSSPrimitiveValue(family.get()))
&& fontFace->setPropertyFromStyle(properties, CSSPropertyFontStyle)
&& fontFace->setPropertyFromStyle(properties, CSSPropertyFontWeight)
&& fontFace->setPropertyFromStyle(properties, CSSPropertyFontStretch)
@@ -270,13 +270,8 @@ bool FontFace::setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue> value, CSSPrope
return true;
}
-bool FontFace::setFamilyValue(CSSValueList* familyList)
+bool FontFace::setFamilyValue(CSSPrimitiveValue* familyValue)
{
- // The font-family descriptor has to have exactly one family name.
- if (familyList->length() != 1)
- return false;
-
- CSSPrimitiveValue* familyValue = toCSSPrimitiveValue(familyList->item(0));
AtomicString family;
if (familyValue->isCustomIdent()) {
family = AtomicString(familyValue->getStringValue());
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.h ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698