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

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

Issue 2145823002: Implement the overflow-anchor CSS property as an opt-out for ScrollAnchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put opt-out behind RuntimeEnabledFeature and update tests Created 4 years, 5 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 0b50bb5347f1ff2648cbbb8b3383d4e03dcb1452..574b331f21d4fadea21b884ff30d4483c6e140e6 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -2629,6 +2629,41 @@ template<> inline EWordBreak CSSPrimitiveValue::convertTo() const
return NormalWordBreak;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflowAnchor e)
+ : CSSValue(PrimitiveClass)
+{
+ init(UnitType::ValueID);
+ switch (e) {
+ case AnchorVisible:
+ m_value.valueID = CSSValueVisible;
+ break;
+ case AnchorNone:
+ m_value.valueID = CSSValueNone;
+ break;
+ case AnchorAuto:
+ m_value.valueID = CSSValueAuto;
+ break;
+ }
+}
+
+template<> inline EOverflowAnchor CSSPrimitiveValue::convertTo() const
+{
+ DCHECK(isValueID());
+ switch (m_value.valueID) {
+ case CSSValueVisible:
+ return AnchorVisible;
+ case CSSValueNone:
+ return AnchorNone;
+ case CSSValueAuto:
+ return AnchorAuto;
+ default:
+ break;
+ }
+
+ NOTREACHED();
+ return AnchorNone;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflowWrap e)
: CSSValue(PrimitiveClass)
{

Powered by Google App Engine
This is Rietveld 408576698