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

Unified Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 1148873005: Parsing CSS properties for scroll snap points (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comment Created 5 years, 6 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 | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index f3b1abe27f651c8e2c088811fabf8f97f6435a6a..7d72d61fa55071727bea5515ae2a92bd3a4b75c7 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -4719,6 +4719,39 @@ template<> inline CSSPrimitiveValue::operator ScrollBehavior() const
return ScrollBehaviorAuto;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollSnapType snapType)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_VALUE_ID;
+ switch (snapType) {
+ case ScrollSnapTypeNone:
+ m_value.valueID = CSSValueNone;
+ break;
+ case ScrollSnapTypeMandatory:
+ m_value.valueID = CSSValueMandatory;
+ break;
+ case ScrollSnapTypeProximity:
+ m_value.valueID = CSSValueProximity;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator ScrollSnapType() const
+{
+ switch (getValueID()) {
+ case CSSValueNone:
+ return ScrollSnapTypeNone;
+ case CSSValueMandatory:
+ return ScrollSnapTypeMandatory;
+ case CSSValueProximity:
+ return ScrollSnapTypeProximity;
+ default:
+ break;
+ }
+ ASSERT_NOT_REACHED();
+ return ScrollSnapTypeNone;
+}
+
} // namespace blink
#endif
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698