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

Unified Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyDescriptor.h

Issue 2533673002: Added CSSPropertyAPI and CSS padding properties which implement this API (Closed)
Patch Set: fix branch Created 4 years, 1 month 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/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;
+}
+}

Powered by Google App Engine
This is Rietveld 408576698