Chromium Code Reviews| 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; |
| } |