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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 1919813002: Implementation of CSS3 nav-up/down/left/right properties from CSS3 UI Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/resolver/StyleBuilderConverter.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index 0597e24793a61ef3e690f80333d49b759555ce0d..1bfffb6022a6c256dcd3b75700c283895d5e0027 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -974,4 +974,27 @@ PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
return nullptr;
}
+StyleNavigationValue StyleBuilderConverter::convertStyleNavigationValue(StyleResolverState&, const CSSValue& value)
+{
+ if (!value.isValueList())
+ return ComputedStyle::initialStyleNavigation();
+
+ const CSSValueList& list = toCSSValueList(value);
+ ASSERT(list->length() == 1 || list->length() == 2);
fs 2016/05/18 15:55:05 list.length()
+
+ ASSERT(value.isStringValue());
fs 2016/05/18 15:55:05 |value| will be a CSSValueList here, so you probab
+ String idSelector = toCSSStringValue(list.item(0))->value();
+ if (idSelector.startsWith('#'))
fs 2016/05/18 15:55:05 The CSS parser should be providing a canonical eno
+ idSelector.remove(0);
+
+ if (list.length() == 1)
+ return StyleNavigationValue(idSelector);
+
+ if (value.isStringValue())
fs 2016/05/18 15:55:05 Like above, presumably this should be list.item(1)
+ return StyleNavigationValue(idSelector, toCSSStringValue(list.item(1))->value());
+
+ ASSERT(value.isPrimitiveValue() && (toCSSPrimitiveValue(value).getValueID() == CSSValueRoot || toCSSPrimitiveValue(value).getValueID() == CSSValueCurrent));
fs 2016/05/18 15:55:05 Again, |value| is still the parameter (the list).
+ return StyleNavigationValue(idSelector, toCSSPrimitiveValue(list.item(1))->getValueID() == CSSValueRoot ? Root : Current);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698