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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 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 644bfc205f9a99b42578175a64c709ea25c1592e..570bc350de68db0504619b7188f69387fa68739c 100644
--- a/third_party/WebKit/Source/core/css/FontFace.cpp
+++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -39,7 +39,7 @@
#include "core/css/CSSFontFaceSrcValue.h"
#include "core/css/CSSFontFamilyValue.h"
#include "core/css/CSSFontSelector.h"
-#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSIdentifierValue.h"
#include "core/css/CSSUnicodeRangeValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/FontFaceDescriptors.h"
@@ -113,7 +113,7 @@ FontFace* FontFace::create(Document* document, const StyleRuleFontFace* fontFace
// Obtain the font-family property and the src property. Both must be defined.
const CSSValue* family = properties.getPropertyCSSValue(CSSPropertyFontFamily);
- if (!family || (!family->isFontFamilyValue() && !family->isPrimitiveValue()))
+ if (!family || (!family->isFontFamilyValue() && !family->isIdentifierValue()))
return nullptr;
const CSSValue* src = properties.getPropertyCSSValue(CSSPropertySrc);
if (!src || !src->isValueList())
@@ -282,10 +282,10 @@ bool FontFace::setFamilyValue(const CSSValue& familyValue)
AtomicString family;
if (familyValue.isFontFamilyValue()) {
family = AtomicString(toCSSFontFamilyValue(familyValue).value());
- } else if (toCSSPrimitiveValue(familyValue).isValueID()) {
+ } else if (familyValue.isIdentifierValue()) {
// 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 (toCSSPrimitiveValue(familyValue).getValueID()) {
+ switch (toCSSIdentifierValue(familyValue).getValueID()) {
case CSSValueSerif:
family = FontFamilyNames::webkit_serif;
break;
@@ -406,10 +406,10 @@ FontTraits FontFace::traits() const
{
FontStretch stretch = FontStretchNormal;
if (m_stretch) {
- if (!m_stretch->isPrimitiveValue())
+ if (!m_stretch->isIdentifierValue())
return 0;
- switch (toCSSPrimitiveValue(m_stretch.get())->getValueID()) {
+ switch (toCSSIdentifierValue(m_stretch.get())->getValueID()) {
case CSSValueUltraCondensed:
stretch = FontStretchUltraCondensed;
break;
@@ -441,10 +441,10 @@ FontTraits FontFace::traits() const
FontStyle style = FontStyleNormal;
if (m_style) {
- if (!m_style->isPrimitiveValue())
+ if (!m_style->isIdentifierValue())
return 0;
- switch (toCSSPrimitiveValue(m_style.get())->getValueID()) {
+ switch (toCSSIdentifierValue(m_style.get())->getValueID()) {
case CSSValueNormal:
style = FontStyleNormal;
break;
@@ -461,10 +461,10 @@ FontTraits FontFace::traits() const
FontWeight weight = FontWeight400;
if (m_weight) {
- if (!m_weight->isPrimitiveValue())
+ if (!m_weight->isIdentifierValue())
return 0;
- switch (toCSSPrimitiveValue(m_weight.get())->getValueID()) {
+ switch (toCSSIdentifierValue(m_weight.get())->getValueID()) {
case CSSValueBold:
case CSSValue700:
weight = FontWeight700;
@@ -517,8 +517,8 @@ size_t FontFace::approximateBlankCharacterCount() const
static FontDisplay CSSValueToFontDisplay(const CSSValue* value)
{
- if (value && value->isPrimitiveValue()) {
- switch (toCSSPrimitiveValue(value)->getValueID()) {
+ if (value && value->isIdentifierValue()) {
+ switch (toCSSIdentifierValue(value)->getValueID()) {
case CSSValueAuto:
return FontDisplayAuto;
case CSSValueBlock:

Powered by Google App Engine
This is Rietveld 408576698