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

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

Issue 2702173002: Generate mappings between CSSValueID and ComputedStyle enums. (Closed)
Patch Set: Forgot case Created 3 years, 10 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/CSSIdentifierValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSIdentifierValue.h b/third_party/WebKit/Source/core/css/CSSIdentifierValue.h
index 8944bc6ce71b195994fd7f7bf727e3e0b7fa002a..9d7d12b08d58cfc3ce9f0de3114e89c05f70aab4 100644
--- a/third_party/WebKit/Source/core/css/CSSIdentifierValue.h
+++ b/third_party/WebKit/Source/core/css/CSSIdentifierValue.h
@@ -7,6 +7,7 @@
#include "core/CSSValueKeywords.h"
#include "core/css/CSSValue.h"
+#include "core/css/CSSValueIDMappings.h"
#include "wtf/TypeTraits.h"
namespace blink {
@@ -41,7 +42,10 @@ class CORE_EXPORT CSSIdentifierValue : public CSSValue {
}
template <typename T>
- inline T convertTo() const; // Defined in CSSPrimitiveValueMappings.h
+ inline T convertTo()
+ const { // Overridden for special cases in CSSPrimitiveValueMappings.h
+ return cssValueIDToPlatformEnum<T>(m_valueID);
+ }
DECLARE_TRACE_AFTER_DISPATCH();
@@ -51,7 +55,10 @@ class CORE_EXPORT CSSIdentifierValue : public CSSValue {
// TODO(sashab): Remove this function, and update mapping methods to
// specialize the create() method instead.
template <typename T>
- CSSIdentifierValue(T); // Defined in CSSPrimitiveValueMappings.h
+ CSSIdentifierValue(
+ T t) // Overriden for special cases in CSSPrimitiveValueMappings.h
+ : CSSValue(IdentifierClass),
+ m_valueID(platformEnumToCSSValueID(t)) {}
CSSIdentifierValue(const Length&);
« no previous file with comments | « third_party/WebKit/Source/core/css/BUILD.gn ('k') | third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698