Index: third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h |
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2540a5405a8e0f07241c138927a5b9294055d528 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h |
@@ -0,0 +1,30 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/CSSPropertyNames.h" |
+#include "core/css/CSSValue.h" |
+#include "core/css/properties/CSSPropertyAPI.h" |
+ |
+namespace blink { |
+ |
+struct CSSPropertyDescriptor { |
+ const CSSValue* (*parseSingleValue)(CSSParserTokenRange&, |
aazzam
2016/11/28 23:29:00
Comments about matching the API methods
|
+ const CSSParserContext&); |
+ CSSPropertyID (*getID)(); |
+ bool isValidProperty; |
aazzam
2016/11/28 23:29:00
_isValidProperty - shows its private
comment expl
|
+}; |
+ |
+const CSSPropertyDescriptor& get(CSSPropertyID); |
aazzam
2016/11/28 23:29:00
Move to be static methocs on CSSPropertyDescriptor
|
+CSSPropertyDescriptor getInvalidDescriptor(); |
aazzam
2016/11/28 23:29:00
Move to static method in cpp file
OR ideally
Ano
|
+void add(CSSPropertyDescriptor, CSSPropertyID); |
aazzam
2016/11/28 23:29:00
Move to static
CSSPropertyDescriptor::add()
|
+ |
+template <class T> |
+CSSPropertyDescriptor getDescriptor() { |
+ CSSPropertyDescriptor a; |
+ a.parseSingleValue = &T::parseSingleValue; |
aazzam
2016/11/28 23:29:00
Add ASSERT(a.parse != CSSPropertyAPI::parse)
|
+ a.getID = &T::getID; |
+ a.isValidProperty = true; |
+ return a; |
+} |
+} |