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

Side by Side Diff: Source/core/css/CSSVariableData.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed again... Created 5 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CSSVariableData_h
6 #define CSSVariableData_h
7
8 #include "core/css/parser/CSSParserToken.h"
9 #include "wtf/RefCounted.h"
10 #include "wtf/text/WTFString.h"
11
12 namespace blink {
13
14 class CSSParserTokenRange;
15
16 class CSSVariableData : public RefCounted<CSSVariableData> {
17 WTF_MAKE_NONCOPYABLE(CSSVariableData);
18 WTF_MAKE_FAST_ALLOCATED(CSSVariableData);
19 public:
20 static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, const String& baseString, bool needsVariableResolution = true)
21 {
22 return adoptRef(new CSSVariableData(range, baseString, needsVariableReso lution));
23 }
24
25 Vector<CSSParserToken>& tokens() { return m_tokens; }
Timothy Loh 2015/07/23 08:11:46 better to return a CSSParserTokenRange
leviw_travelin_and_unemployed 2015/08/04 00:42:20 I believe change this will result in a lot of extr
26
27 bool needsVariableResolution() const { return m_needsVariableResolution; }
28 void setNeedsVariableResolution(bool needsVariableResolution) { m_needsVaria bleResolution = needsVariableResolution; }
29
30 String string() const { return m_string; }
31 private:
32 CSSVariableData(const CSSParserTokenRange&, const String&, bool needsVariabl eResolution);
33
34 template<typename CharacterType> void consumeAndUpdateTokens(const CSSParser TokenRange&, const String&);
35
36 String m_string;
Timothy Loh 2015/07/23 08:11:46 Probably nicer if we just join all the token strin
leviw_travelin_and_unemployed 2015/08/04 00:42:20 Makes sense.
37 Vector<String> m_stringPool;
38 Vector<CSSParserToken> m_tokens;
39 bool m_needsVariableResolution;
40 };
41
42 } // namespace blink
43
44 #endif // CSSVariableData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698