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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 2613723003: Implements CSSPropertyAPI for the font-variation-settings property. (Closed)
Patch Set: rebase Created 3 years, 11 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/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 1627bc5654c656331c08a6dbfcd386b2eb71dd86..6f146e0c57c1f3bc85a50617ddf71f0dd9962355 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -329,45 +329,6 @@ static CSSValue* consumeFontFeatureSettings(CSSParserTokenRange& range) {
return settings;
}
-static CSSFontVariationValue* consumeFontVariationTag(
- CSSParserTokenRange& range) {
- // Feature tag name consists of 4-letter characters.
- static const unsigned tagNameLength = 4;
-
- const CSSParserToken& token = range.consumeIncludingWhitespace();
- // Feature tag name comes first
- if (token.type() != StringToken)
- return nullptr;
- if (token.value().length() != tagNameLength)
- return nullptr;
- AtomicString tag = token.value().toAtomicString();
- for (unsigned i = 0; i < tagNameLength; ++i) {
- // Limits the range of characters to 0x20-0x7E, following the tag name rules
- // defined in the OpenType specification.
- UChar character = tag[i];
- if (character < 0x20 || character > 0x7E)
- return nullptr;
- }
-
- double tagValue = 0;
- if (!consumeNumberRaw(range, tagValue))
- return nullptr;
- return CSSFontVariationValue::create(tag, clampTo<float>(tagValue));
-}
-
-static CSSValue* consumeFontVariationSettings(CSSParserTokenRange& range) {
- if (range.peek().id() == CSSValueNormal)
- return consumeIdent(range);
- CSSValueList* variationSettings = CSSValueList::createCommaSeparated();
- do {
- CSSFontVariationValue* fontVariationValue = consumeFontVariationTag(range);
- if (!fontVariationValue)
- return nullptr;
- variationSettings->append(*fontVariationValue);
- } while (consumeCommaIncludingWhitespace(range));
- return variationSettings;
-}
-
static CSSValue* consumePage(CSSParserTokenRange& range) {
if (range.peek().id() == CSSValueAuto)
return consumeIdent(range);
@@ -3298,9 +3259,6 @@ const CSSValue* CSSPropertyParser::parseSingleValue(
return consumeFontFeatureSettings(m_range);
case CSSPropertyFontFamily:
return consumeFontFamily(m_range);
- case CSSPropertyFontVariationSettings:
- DCHECK(RuntimeEnabledFeatures::cssVariableFontsEnabled());
- return consumeFontVariationSettings(m_range);
case CSSPropertyFontWeight:
return consumeFontWeight(m_range);
case CSSPropertyLetterSpacing:

Powered by Google App Engine
This is Rietveld 408576698