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

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

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Fixing tests 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: Source/core/css/FontFace.cpp
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index 6e096c0420eedcafa1ca78213b8192fe1aeb8b6c..9c1018781f14e557c7f702c66305dd8829126715 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -40,6 +40,7 @@
#include "core/css/CSSFontFaceSrcValue.h"
#include "core/css/CSSFontSelector.h"
#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSStringValueBase.h"
#include "core/css/CSSUnicodeRangeValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/FontFaceDescriptors.h"
@@ -276,14 +277,14 @@ bool FontFace::setFamilyValue(CSSValueList* familyList)
if (familyList->length() != 1)
return false;
- CSSPrimitiveValue* familyValue = toCSSPrimitiveValue(familyList->item(0));
+ CSSValue* familyValue = familyList->item(0);
AtomicString family;
- if (familyValue->isCustomIdent()) {
- family = AtomicString(familyValue->getStringValue());
- } else if (familyValue->isValueID()) {
+ if (familyValue->isCustomIdentValue()) {
+ family = AtomicString(toCSSCustomIdentValue(familyValue)->value());
+ } else if (toCSSPrimitiveValue(familyValue)->isValueID()) {
// We need to use the raw text for all the generic family types, since @font-face is a way of actually
// defining what font to use for those types.
- switch (familyValue->getValueID()) {
+ switch (toCSSPrimitiveValue(familyValue)->getValueID()) {
case CSSValueSerif:
family = FontFamilyNames::webkit_serif;
break;

Powered by Google App Engine
This is Rietveld 408576698