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 3dc334d768e21a641e0969afb2f8cc8dad524a95..ebd4fb51bae172c0e01ece595665509e86135b59 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -1409,6 +1409,46 @@ static RawPtr<CSSValue> consumeMotionRotation(CSSParserTokenRange& range) |
return list.release(); |
} |
+// auto | <id> [ current | root | <target-name> ] | inherit |
+static RawPtr<CSSValue> consumeNavigation(CSSParserTokenRange& range) |
+{ |
+ CSSValueID id = range.peek().id(); |
+ if (id == CSSValueAuto) |
fs
2016/05/18 15:55:05
range.peek().id() == ...
|
+ return consumeIdent(range); |
+ |
+ String selectorText = ""; |
fs
2016/05/18 15:55:05
Don't need to initialize this, it'll be overwritte
|
+ CSSParserTokenType type = range.peek().type(); |
+ if (type == HashToken) { |
fs
2016/05/18 15:55:04
Should only accept HashToken here or?
|
+ selectorText.append(range.consumeIncludingWhitespace().value()); |
+ } else if (type == StringToken) { |
+ selectorText.append(range.consumeIncludingWhitespace().value()); |
+ } else { |
+ return nullptr; |
+ } |
+ |
+ type = range.peek().type(); |
+ RawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
+ RawPtr<CSSValue> idSel = CSSStringValue::create(selectorText); |
fs
2016/05/18 15:55:05
idSelector
|
+ list->append(idSel.release()); |
+ |
+ RawPtr<CSSValue> target; |
+ if (type == IdentToken) { |
+ target = consumeIdent<CSSValueRoot, CSSValueCurrent>(range); |
+ } else if (type == StringToken) { |
+ String targetText = range.consumeIncludingWhitespace().value(); |
+ if (targetText.startsWith("_")) |
fs
2016/05/18 15:55:05
The way I'm reading the spec, this should not be a
|
+ return nullptr; |
+ target = CSSStringValue::create(targetText); |
+ } else if (type == EOFToken) { |
fs
2016/05/18 15:55:04
Maybe check range.atEnd() instead.
|
+ target = cssValuePool().createIdentifierValue(CSSValueCurrent); |
+ } else { |
+ return nullptr; |
+ } |
+ list->append(target); |
+ |
+ return list.release(); |
+} |
+ |
static RawPtr<CSSValue> consumeTextEmphasisStyle(CSSParserTokenRange& range) |
{ |
CSSValueID id = range.peek().id(); |
@@ -3447,6 +3487,11 @@ RawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedPro |
return consumeLengthOrPercent(m_range, m_context.mode(), ValueRangeAll); |
case CSSPropertyMotionRotation: |
return consumeMotionRotation(m_range); |
+ case CSSPropertyNavDown: |
+ case CSSPropertyNavLeft: |
+ case CSSPropertyNavRight: |
+ case CSSPropertyNavUp: |
+ return consumeNavigation(m_range); |
case CSSPropertyWebkitTextEmphasisStyle: |
return consumeTextEmphasisStyle(m_range); |
case CSSPropertyOutlineColor: |