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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleVariableData.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #ifndef StyleVariableData_h
2 #define StyleVariableData_h
3
4 #include "core/css/CSSVariableData.h"
5 #include "wtf/Forward.h"
6 #include "wtf/HashMap.h"
7 #include "wtf/RefCounted.h"
8 #include "wtf/text/AtomicStringHash.h"
9
10 namespace blink {
11
12 class StyleVariableData : public RefCounted<StyleVariableData> {
13 public:
14 static PassRefPtr<StyleVariableData> create() { return adoptRef(new StyleVar iableData()); }
15 PassRefPtr<StyleVariableData> copy() const { return adoptRef(new StyleVariab leData(*this)); }
16
17 bool operator==(const StyleVariableData& other) const { return other.m_data == m_data; }
18 bool operator!=(const StyleVariableData& other) const { return !(*this == ot her); }
19
20 void setVariable(const AtomicString& name, PassRefPtr<CSSVariableData> value ) { m_data.set(name, value); }
21 CSSVariableData* getVariable(const AtomicString& name) const { return m_data .get(name); }
22 void removeVariable(const AtomicString& name) { return m_data.remove(name); }
23 private:
24 StyleVariableData() = default;
25 StyleVariableData(const StyleVariableData& other) : RefCounted<StyleVariable Data>(), m_data(other.m_data) { }
26
27 friend class CSSVariableResolver;
28
29 HashMap<AtomicString, RefPtr<CSSVariableData>> m_data;
30 };
31
32 } // namespace blink
33
34 #endif // StyleVariableData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698