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

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

Issue 1417463003: Move z-index property handling into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again! Created 5 years, 2 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 7091dc6f1d12df160dd619817674d9ce0530ab45..1db1bfd944ad988e23d226fee050b1887ea57770 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -186,7 +186,7 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeInteger(CSSParserTokenRa
if (token.type() == NumberToken) {
if (token.numericValueType() == NumberValueType || token.numericValue() < minimumValue)
return nullptr;
- return cssValuePool().createValue(range.consumeIncludingWhitespace().numericValue(), token.unitType());
+ return cssValuePool().createValue(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitType::Integer);
}
CalcParser calcParser(range);
if (const CSSCalcValue* calculation = calcParser.value()) {
@@ -1050,7 +1050,7 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLineClamp(CSSParserToken
if (clampValue)
return clampValue;
// When specifying number of lines, don't allow 0 as a valid value.
- return consumeInteger(range, 1);
+ return consumePositiveInteger(range);
}
static PassRefPtrWillBeRawPtr<CSSValue> consumeLocale(CSSParserTokenRange& range)
@@ -1144,6 +1144,13 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationIterationCount(CSSParser
return consumeNumber(range, ValueRangeNonNegative);
}
+static PassRefPtrWillBeRawPtr<CSSValue> consumeZIndex(CSSParserTokenRange& range)
Timothy Loh 2015/10/29 03:53:42 errr... can we put this somewhere other than in th
+{
+ if (range.peek().id() == CSSValueAuto)
+ return consumeIdent(range);
+ return consumeInteger(range);
+}
+
static PassRefPtrWillBeRawPtr<CSSValue> consumeAnimationPlayState(CSSParserTokenRange& range)
{
CSSValueID id = range.peek().id();
@@ -1434,6 +1441,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeColor(m_range, m_context);
case CSSPropertyColor:
return consumeColor(m_range, m_context, inQuirksMode());
+ case CSSPropertyZIndex:
+ return consumeZIndex(m_range);
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698