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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleVariableData.h

Issue 1521323002: Show custom properties in the computed style pane of the inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef StyleVariableData_h 1 #ifndef StyleVariableData_h
2 #define StyleVariableData_h 2 #define StyleVariableData_h
3 3
4 #include "core/css/CSSVariableData.h" 4 #include "core/css/CSSVariableData.h"
5 #include "wtf/Forward.h" 5 #include "wtf/Forward.h"
6 #include "wtf/HashMap.h" 6 #include "wtf/HashMap.h"
7 #include "wtf/RefCounted.h" 7 #include "wtf/RefCounted.h"
8 #include "wtf/text/AtomicStringHash.h" 8 #include "wtf/text/AtomicStringHash.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class StyleVariableData : public RefCounted<StyleVariableData> { 12 class StyleVariableData : public RefCounted<StyleVariableData> {
13 public: 13 public:
14 static PassRefPtr<StyleVariableData> create() { return adoptRef(new StyleVar iableData()); } 14 static PassRefPtr<StyleVariableData> create() { return adoptRef(new StyleVar iableData()); }
15 PassRefPtr<StyleVariableData> copy() const { return adoptRef(new StyleVariab leData(*this)); } 15 PassRefPtr<StyleVariableData> copy() const { return adoptRef(new StyleVariab leData(*this)); }
16 16
17 bool operator==(const StyleVariableData& other) const { return other.m_data == m_data; } 17 bool operator==(const StyleVariableData& other) const { return other.m_data == m_data; }
18 bool operator!=(const StyleVariableData& other) const { return !(*this == ot her); } 18 bool operator!=(const StyleVariableData& other) const { return !(*this == ot her); }
19 19
20 void setVariable(const AtomicString& name, PassRefPtr<CSSVariableData> value ) { m_data.set(name, value); } 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); } 21 CSSVariableData* getVariable(const AtomicString& name) const { return m_data .get(name); }
22 void removeVariable(const AtomicString& name) { return m_data.remove(name); } 22 void removeVariable(const AtomicString& name) { return m_data.remove(name); }
23
24 const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables() const { return &m_data; }
23 private: 25 private:
24 StyleVariableData() = default; 26 StyleVariableData() = default;
25 StyleVariableData(const StyleVariableData& other) : RefCounted<StyleVariable Data>(), m_data(other.m_data) { } 27 StyleVariableData(const StyleVariableData& other) : RefCounted<StyleVariable Data>(), m_data(other.m_data) { }
26 28
27 friend class CSSVariableResolver; 29 friend class CSSVariableResolver;
28 30
29 HashMap<AtomicString, RefPtr<CSSVariableData>> m_data; 31 HashMap<AtomicString, RefPtr<CSSVariableData>> m_data;
30 }; 32 };
31 33
32 } // namespace blink 34 } // namespace blink
33 35
34 #endif // StyleVariableData_h 36 #endif // StyleVariableData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698