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

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

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Update the test Created 3 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
Index: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
index 35b69468ba6d2f5076aeac1fb39f6e41de379a5b..50f96796534925e9b2274aa1e5495d7dfc79552c 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -2684,6 +2684,39 @@ inline ScrollBehavior CSSIdentifierValue::ConvertTo() const {
return kScrollBehaviorAuto;
}
+template <>
+inline CSSIdentifierValue::CSSIdentifierValue(
+ EScrollBoundaryBehavior boundary_behavior)
+ : CSSValue(kIdentifierClass) {
+ switch (boundary_behavior) {
+ case EScrollBoundaryBehavior::kAuto:
+ value_id_ = CSSValueAuto;
+ break;
+ case EScrollBoundaryBehavior::kContain:
+ value_id_ = CSSValueContain;
+ break;
+ case EScrollBoundaryBehavior::kNone:
+ value_id_ = CSSValueNone;
+ break;
+ }
+}
+
+template <>
+inline EScrollBoundaryBehavior CSSIdentifierValue::ConvertTo() const {
+ switch (GetValueID()) {
+ case CSSValueAuto:
+ return EScrollBoundaryBehavior::kAuto;
+ case CSSValueContain:
+ return EScrollBoundaryBehavior::kContain;
+ case CSSValueNone:
+ return EScrollBoundaryBehavior::kNone;
+ default:
+ break;
+ }
+ NOTREACHED();
+ return EScrollBoundaryBehavior::kAuto;
+}
+
template <>
inline CSSIdentifierValue::CSSIdentifierValue(ScrollSnapType snap_type)
: CSSValue(kIdentifierClass) {

Powered by Google App Engine
This is Rietveld 408576698