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

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

Issue 1955723004: Implement font-variant-numeric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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/StylePropertySerializer.cpp
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
index a76a1554d9fec5f8919fe1a71449326667e1cc6e..8192c4d02194a8ba8d6b19a852c3a5f3b84ae6b5 100644
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
@@ -545,6 +545,7 @@ void StylePropertySerializer::appendFontLonghandValueIfNotNormal(CSSPropertyID p
case CSSPropertyFontStretch:
case CSSPropertyFontVariantCaps:
case CSSPropertyFontVariantLigatures:
+ case CSSPropertyFontVariantNumeric:
case CSSPropertyFontWeight:
prefix = ' ';
break;
@@ -582,21 +583,28 @@ String StylePropertySerializer::fontValue() const
int fontFamilyPropertyIndex = m_propertySet.findPropertyIndex(CSSPropertyFontFamily);
int fontVariantCapsPropertyIndex = m_propertySet.findPropertyIndex(CSSPropertyFontVariantCaps);
int fontVariantLigaturesPropertyIndex = m_propertySet.findPropertyIndex(CSSPropertyFontVariantLigatures);
+ int fontVariantNumericPropertyIndex = m_propertySet.findPropertyIndex(CSSPropertyFontVariantNumeric);
DCHECK_NE(fontSizePropertyIndex, -1);
DCHECK_NE(fontFamilyPropertyIndex, -1);
DCHECK_NE(fontVariantCapsPropertyIndex, -1);
DCHECK_NE(fontVariantLigaturesPropertyIndex, -1);
+ DCHECK_NE(fontVariantNumericPropertyIndex, -1);
PropertyValueForSerializer fontSizeProperty = m_propertySet.propertyAt(fontSizePropertyIndex);
PropertyValueForSerializer fontFamilyProperty = m_propertySet.propertyAt(fontFamilyPropertyIndex);
PropertyValueForSerializer fontVariantCapsProperty = m_propertySet.propertyAt(fontVariantCapsPropertyIndex);
PropertyValueForSerializer fontVariantLigaturesProperty = m_propertySet.propertyAt(fontVariantLigaturesPropertyIndex);
+ PropertyValueForSerializer fontVariantNumericProperty = m_propertySet.propertyAt(fontVariantNumericPropertyIndex);
// Check that non-initial font-variant subproperties are not conflicting with this serialization.
const CSSValue* ligaturesValue = fontVariantLigaturesProperty.value();
+ const CSSValue* numericValue = fontVariantNumericProperty.value();
if ((ligaturesValue->isPrimitiveValue()
&& toCSSPrimitiveValue(ligaturesValue)->getValueID() != CSSValueNormal)
- || ligaturesValue->isValueList())
+ || ligaturesValue->isValueList()
+ || (numericValue->isPrimitiveValue()
+ && toCSSPrimitiveValue(numericValue)->getValueID() != CSSValueNormal)
+ || numericValue->isValueList())
return emptyString();
String commonValue = fontSizeProperty.value()->cssText();
@@ -640,6 +648,7 @@ String StylePropertySerializer::fontVariantValue() const
String dummyCommonValue;
appendFontLonghandValueIfNotNormal(CSSPropertyFontVariantLigatures, result, dummyCommonValue);
appendFontLonghandValueIfNotNormal(CSSPropertyFontVariantCaps, result, dummyCommonValue);
+ appendFontLonghandValueIfNotNormal(CSSPropertyFontVariantNumeric, result, dummyCommonValue);
if (result.isEmpty()) {
return "normal";

Powered by Google App Engine
This is Rietveld 408576698