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

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

Issue 1405793002: Move legacy webkit properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up a bit 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b05888320d1cd3c8d6466e194e666bb5468e660a..673e81a225e0c5be01c48de112455b7eb0c89b7e 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -835,6 +835,24 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeClip(CSSParserTokenRange& range,
return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect);
}
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeLineClamp(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+ if (range.peek().type() != PercentageToken && range.peek().type() != NumberToken)
Timothy Loh 2015/10/15 23:44:36 I wouldn't bother disallowing calcs, but I'll leav
+ return nullptr;
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> clampValue = consumePercent(range, ValueRangeNonNegative);
+ if (clampValue)
+ return clampValue;
+ // When specifying number of lines, don't allow 0 as a valid value.
+ return consumeInteger(range, cssParserMode, 1);
+}
+
+static PassRefPtrWillBeRawPtr<CSSValue> consumeLocale(CSSParserTokenRange& range)
+{
+ if (range.peek().id() == CSSValueAuto)
+ return consumeIdent(range);
+ return consumeString(range);
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID propId)
{
m_range.consumeWhitespace();
@@ -896,6 +914,16 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeWidthOrHeight(m_range, m_context);
case CSSPropertyClip:
return consumeClip(m_range, m_context.mode());
+ // Apple specific properties. These will never be standardized and are purely to
Timothy Loh 2015/10/15 23:44:36 Not sure we need this comment. -webkit-line-clamp
+ // support custom WebKit-based Apple applications.
+ case CSSPropertyWebkitLineClamp:
+ return consumeLineClamp(m_range, m_context.mode());
+ case CSSPropertyWebkitFontSizeDelta:
+ return consumeLength(m_range, m_context.mode(), ValueRangeAll, UnitlessQuirk::Allow);
+ case CSSPropertyWebkitHyphenateCharacter:
+ case CSSPropertyWebkitLocale:
+ return consumeLocale(m_range);
+ // End Apple-specific properties.
default:
return nullptr;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698