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

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

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use m_unit Created 5 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/CSSCustomPropertyDeclaration.h
diff --git a/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h b/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h
new file mode 100644
index 0000000000000000000000000000000000000000..01c959bd134aa02151cf9617cab628e78d55daca
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h
@@ -0,0 +1,61 @@
+// Copyright 2015 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 CSSCustomPropertyDeclaration_h
+#define CSSCustomPropertyDeclaration_h
+
+#include "core/css/CSSValue.h"
+#include "core/css/CSSVariableData.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/AtomicString.h"
+
+namespace blink {
+
+class CSSCustomPropertyDeclaration : public CSSValue {
+public:
+ static PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, PassRefPtr<CSSVariableData> value)
+ {
+ return adoptRefWillBeNoop(new CSSCustomPropertyDeclaration(name, value));
+ }
+
+ static PassRefPtrWillBeRawPtr<CSSCustomPropertyDeclaration> create(const AtomicString& name, CSSValueID id)
+ {
+ return adoptRefWillBeNoop(new CSSCustomPropertyDeclaration(name, id));
+ }
+
+ const AtomicString& name() const { return m_name; }
+ CSSVariableData* value() const { return m_value.get(); }
+ CSSValueID id() const { return m_valueId; }
+
+ bool equals(const CSSCustomPropertyDeclaration& other) const { return this == &other; }
+
+ DECLARE_TRACE_AFTER_DISPATCH();
+private:
+ CSSCustomPropertyDeclaration(const AtomicString& name, CSSValueID id)
+ : CSSValue(CustomPropertyDeclarationClass)
+ , m_name(name)
+ , m_value(nullptr)
+ , m_valueId(id)
+ {
+ ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset);
+ }
+
+ CSSCustomPropertyDeclaration(const AtomicString& name, PassRefPtr<CSSVariableData> value)
+ : CSSValue(CustomPropertyDeclarationClass)
+ , m_name(name)
+ , m_value(value)
+ , m_valueId(CSSValueInternalVariableValue)
+ {
+ }
+
+ const AtomicString m_name;
+ RefPtr<CSSVariableData> m_value;
+ CSSValueID m_valueId;
+};
+
+DEFINE_CSS_VALUE_TYPE_CASTS(CSSCustomPropertyDeclaration, isCustomPropertyDeclaration());
+
+} // namespace blink
+
+#endif // CSSCustomPropertyDeclaration_h
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698