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

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

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove reftest.list :( 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 // 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 "core/css/parser/CSSParserTokenRange.h"
10 #include "wtf/RefCounted.h"
11 #include "wtf/text/WTFString.h"
12
13 namespace blink {
14
15 class CSSParserTokenRange;
16
17 class CSSVariableData : public RefCounted<CSSVariableData> {
18 WTF_MAKE_NONCOPYABLE(CSSVariableData);
19 WTF_MAKE_FAST_ALLOCATED(CSSVariableData);
20 public:
21 static PassRefPtr<CSSVariableData> create(const CSSParserTokenRange& range, bool needsVariableResolution = true)
22 {
23 return adoptRef(new CSSVariableData(range, needsVariableResolution));
24 }
25
26 static PassRefPtr<CSSVariableData> createResolved(const Vector<CSSParserToke n>& resolvedTokens)
27 {
28 return adoptRef(new CSSVariableData(resolvedTokens));
29 }
30
31 CSSParserTokenRange tokenRange() { return m_tokens; }
32
33 const Vector<CSSParserToken>& tokens() { return m_tokens; }
34
35 bool needsVariableResolution() const { return m_needsVariableResolution; }
36 private:
37 CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution);
38 CSSVariableData(const Vector<CSSParserToken>& resolvedTokens)
alancutter (OOO until 2018) 2015/10/28 07:31:20 What guarantees do we have that the backing string
leviw_travelin_and_unemployed 2015/10/30 21:41:16 I added a comment about why its safe, and added an
39 : m_tokens(resolvedTokens)
40 , m_needsVariableResolution(false)
41 { }
42
43 void consumeAndUpdateTokens(const CSSParserTokenRange&);
44 template<typename CharacterType> void updateTokens(const CSSParserTokenRange &);
45
46 String m_backingString;
47 Vector<CSSParserToken> m_tokens;
48 const bool m_needsVariableResolution;
49 };
50
51 } // namespace blink
52
53 #endif // CSSVariableData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698