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

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

Issue 1485973005: Add CSS support for Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test expectation Created 5 years 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 a10c3c29e479359f648040647827af748be17099..5f261fc80740b54cdd2faa18e06f8f50cd1bf9e4 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -4595,6 +4595,49 @@ template<> inline ScrollSnapType CSSPrimitiveValue::convertTo() const
return ScrollSnapTypeNone;
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Containment snapType)
+ : CSSValue(PrimitiveClass)
+{
+ init(UnitType::ValueID);
+ switch (snapType) {
+ case ContainsNone:
+ m_value.valueID = CSSValueNone;
+ break;
+ case ContainsStrict:
+ m_value.valueID = CSSValueStrict;
+ break;
+ case ContainsPaint:
+ m_value.valueID = CSSValuePaint;
+ break;
+ case ContainsStyle:
+ m_value.valueID = CSSValueStyle;
+ break;
+ case ContainsLayout:
+ m_value.valueID = CSSValueLayout;
+ break;
+ }
+}
+
+template<> inline Containment CSSPrimitiveValue::convertTo() const
+{
+ switch (getValueID()) {
+ case CSSValueNone:
+ return ContainsNone;
+ case CSSValueStrict:
+ return ContainsStrict;
+ case CSSValuePaint:
+ return ContainsPaint;
+ case CSSValueStyle:
+ return ContainsStyle;
+ case CSSValueLayout:
+ return ContainsLayout;
+ default:
+ break;
+ }
+ ASSERT_NOT_REACHED();
+ return ContainsNone;
+}
+
} // namespace blink
#endif

Powered by Google App Engine
This is Rietveld 408576698