Index: Source/core/css/CSSPrimitiveValueMappings.h |
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h |
index eb64b56daa7ab30649d8e7aefd80b26d1a8bfff0..1302d79c0a9fb4919f73a302a0f9756cb5bdc314 100644 |
--- a/Source/core/css/CSSPrimitiveValueMappings.h |
+++ b/Source/core/css/CSSPrimitiveValueMappings.h |
@@ -45,6 +45,7 @@ |
#include "platform/fonts/TextRenderingMode.h" |
#include "platform/graphics/GraphicsTypes.h" |
#include "platform/graphics/Path.h" |
+#include "platform/scroll/ScrollableArea.h" |
#include "platform/text/TextDirection.h" |
#include "platform/text/UnicodeBidi.h" |
#include "platform/text/WritingMode.h" |
@@ -5044,6 +5045,38 @@ template<> inline CSSPrimitiveValue::operator OverflowAlignment() const |
return OverflowAlignmentTrue; |
} |
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollBehavior behavior) |
+ : CSSValue(PrimitiveClass) |
+{ |
+ m_primitiveUnitType = CSS_VALUE_ID; |
+ switch (behavior) { |
+ case ScrollBehaviorInstant: |
+ m_value.valueID = CSSValueInstant; |
+ break; |
+ case ScrollBehaviorSmooth: |
+ m_value.valueID = CSSValueSmooth; |
+ break; |
+ case ScrollBehaviorAuto: |
+ // Behavior 'auto' is only allowed in ScrollOptions arguments passed to |
+ // CSSOM scroll APIs. |
+ ASSERT_NOT_REACHED(); |
+ } |
+} |
+ |
+template<> inline CSSPrimitiveValue::operator ScrollBehavior() const |
+{ |
+ switch (getValueID()) { |
+ case CSSValueInstant: |
+ return ScrollBehaviorInstant; |
+ case CSSValueSmooth: |
+ return ScrollBehaviorSmooth; |
+ default: |
+ break; |
+ } |
+ ASSERT_NOT_REACHED(); |
+ return ScrollBehaviorInstant; |
+} |
+ |
} |
#endif |