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

Unified Diff: Source/core/css/CSSVariableData.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unnecessary enum Created 5 years, 6 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: Source/core/css/CSSVariableData.h
diff --git a/Source/core/css/CSSVariableData.h b/Source/core/css/CSSVariableData.h
new file mode 100644
index 0000000000000000000000000000000000000000..a951ffef19b71403f7aac0047001c1f4b6e37d60
--- /dev/null
+++ b/Source/core/css/CSSVariableData.h
@@ -0,0 +1,45 @@
+// 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 CSSVariableData_h
+#define CSSVariableData_h
+
+#include "core/css/parser/CSSTokenizer.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class CSSParserTokenRange;
+
+class CSSVariableData : public RefCounted<CSSVariableData> {
+ WTF_MAKE_NONCOPYABLE(CSSVariableData);
+ WTF_MAKE_FAST_ALLOCATED(CSSVariableData);
+public:
+ static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, bool needsVariableResolution = true)
+ {
+ return adoptRef(new CSSVariableData(range, needsVariableResolution));
+ }
+
+ Vector<CSSParserToken>& tokens() { return m_tokens; }
+
+ bool needsVariableResolution() const { return m_needsVariableResolution; }
+ void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVariableResolution = needsVariableResolution; }
+
+ String string() const { return m_string; }
+private:
+ CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution);
+
+ template<typename CharacterType> void consumeAndUpdateTokens(const CSSParserTokenRange&);
+
+ String m_string;
+ Vector<String> m_stringPool;
+ Vector<CSSParserToken> m_tokens;
+ bool m_needsVariableResolution : 1;
+ bool m_important : 1;
alancutter (OOO until 2018) 2015/07/14 06:12:57 Is m_important ever used? Shouldn't this bool be p
+};
+
+} // namespace blink
+
+#endif // CSSVariableData_h

Powered by Google App Engine
This is Rietveld 408576698