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

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

Issue 17450016: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compilation error in mac and crash in linux/window that were reported by trybots. Created 6 years, 3 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: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index fa55f0a07bd993a8d0e7d0eafb693a7f55a3cd1b..7a9482802aa4769f3d9a16075344dbe23238f2b7 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1067,6 +1067,40 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
return false;
}
break;
+ case CSSPropertyNavDown: // auto | <id> [ current | root | <target-name> ] | inherit
+ case CSSPropertyNavLeft:
+ case CSSPropertyNavRight:
+ case CSSPropertyNavUp:
+ if (id == CSSValueAuto) {
+ validPrimitive = true;
+ } else if (value) {
Timothy Loh 2014/10/01 13:14:54 value is never null here. I would move this logic
+ if (value->unit != CSSPrimitiveValue::CSS_PARSER_IDSEL && value->unit != CSSPrimitiveValue::CSS_PARSER_HEXCOLOR)
+ return false;
+ String selectorText = "#";
+ selectorText.append(value->string);
+
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> idSel = cssValuePool().createValue(selectorText, CSSPrimitiveValue::CSS_STRING);
+ value = m_valueList->next();
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> target;
+ if (value) {
+ if (value->unit == CSSPrimitiveValue::CSS_IDENT) {
+ target = parseValidPrimitive(value->id, value);
Timothy Loh 2014/10/01 13:14:53 Don't you want to check if the id is CSSValueCurre
+ } else if (value->unit == CSSPrimitiveValue::CSS_STRING) {
+ if (value->string.startsWithIgnoringCase("_"))
+ return false;
+ target = cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_STRING);
+ }
Timothy Loh 2014/10/01 13:14:53 You'll want to call m_valueList->next() here to in
+ } else {
+ target = cssValuePool().createValue(CSSValueCurrent);
+ }
+
+ RefPtrWillBeRawPtr<CSSValueList> propertyValue = CSSValueList::createSpaceSeparated();
+ propertyValue->append(idSel);
+ propertyValue->append(target);
+ addProperty(propId, propertyValue, important);
Timothy Loh 2014/10/01 13:14:54 Don't addProperty, just break after setting parsed
+ return true;
+ }
+ break;
case CSSPropertyFlex: {
ShorthandScope scope(this, propId);
if (id == CSSValueNone) {

Powered by Google App Engine
This is Rietveld 408576698