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

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: Fixed the comments Created 3 years, 7 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 7c3523212fdc0b0ffa1f78dc35004d36709334eb..1e64c919c0d3818dec825f3c1e043e443bffd4b1 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -3278,6 +3278,39 @@ inline ScrollBehavior CSSIdentifierValue::ConvertTo() const {
}
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) {
switch (snap_type) {

Powered by Google App Engine
This is Rietveld 408576698