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

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

Issue 2310823002: Skeleton implementation of CSS Properties and Values API (Closed)
Patch Set: fix stylevardata copy ctor Created 4 years, 3 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/PropertyRegistry.h
diff --git a/third_party/WebKit/Source/core/css/PropertyRegistry.h b/third_party/WebKit/Source/core/css/PropertyRegistry.h
new file mode 100644
index 0000000000000000000000000000000000000000..010941f882a4467be5aa441060c1c96949d55c26
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/PropertyRegistry.h
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef PropertyRegistry_h
+#define PropertyRegistry_h
+
+#include "core/css/CSSSyntaxDescriptor.h"
+#include "core/css/CSSValue.h"
+#include "core/css/CSSVariableData.h"
+#include "wtf/HashMap.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/AtomicStringHash.h"
+
+namespace blink {
+
+class PropertyRegistry : public GarbageCollected<PropertyRegistry> {
+public:
+ static PropertyRegistry* create()
+ {
+ return new PropertyRegistry();
+ }
+
+ class Registration : public GarbageCollectedFinalized<Registration> {
+ public:
+ Registration(const CSSSyntaxDescriptor& syntax, bool inherits, const CSSValue* initial)
+ : m_syntax(syntax), m_inherits(inherits), m_initial(initial) { }
+
+ const CSSSyntaxDescriptor& syntax() const { return m_syntax; }
+ bool inherits() const { return m_inherits; }
+ const CSSValue* initial() const { return m_initial; }
+
+ DEFINE_INLINE_TRACE() { visitor->trace(m_initial); }
+
+ private:
+ const CSSSyntaxDescriptor m_syntax;
+ const bool m_inherits;
+ const Member<const CSSValue> m_initial;
+ };
+
+ void registerProperty(const AtomicString&, const CSSSyntaxDescriptor&, bool inherits, const CSSValue* initial);
+ void unregisterProperty(const AtomicString&);
+ const Registration* registration(const AtomicString&) const;
+
+ DEFINE_INLINE_TRACE() { visitor->trace(m_registrations); }
+
+private:
+ HeapHashMap<AtomicString, Member<Registration>> m_registrations;
+};
+
+} // namespace blink
+
+#endif // PropertyRegistry_h
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertyRegistration.idl ('k') | third_party/WebKit/Source/core/css/PropertyRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698