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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Post-merge Created 5 years, 3 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserToken.h" 6 #include "core/css/parser/CSSParserToken.h"
7 7
8 #include "core/css/CSSMarkup.h" 8 #include "core/css/CSSMarkup.h"
9 #include "core/css/parser/CSSPropertyParser.h" 9 #include "core/css/parser/CSSPropertyParser.h"
10 #include "wtf/HashMap.h" 10 #include "wtf/HashMap.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 CSSValueID CSSParserToken::functionId() const 123 CSSValueID CSSParserToken::functionId() const
124 { 124 {
125 if (m_type != FunctionToken) 125 if (m_type != FunctionToken)
126 return CSSValueInvalid; 126 return CSSValueInvalid;
127 if (m_id < 0) 127 if (m_id < 0)
128 m_id = cssValueKeywordID(value()); 128 m_id = cssValueKeywordID(value());
129 return static_cast<CSSValueID>(m_id); 129 return static_cast<CSSValueID>(m_id);
130 } 130 }
131 131
132 bool CSSParserToken::needsStringBacking() const
133 {
134 CSSParserTokenType t = type();
Timothy Loh 2015/09/30 02:09:28 t -> tokenType?
135 return t == IdentToken
136 || t == FunctionToken
137 || t == AtKeywordToken
138 || t == HashToken
139 || t == UrlToken
140 || t == DimensionToken
141 || t == StringToken;
142 }
143
132 void CSSParserToken::serialize(StringBuilder& builder) const 144 void CSSParserToken::serialize(StringBuilder& builder) const
133 { 145 {
134 // This is currently only used for @supports CSSOM. To keep our implementati on 146 // This is currently only used for @supports CSSOM. To keep our implementati on
135 // simple we handle some of the edge cases incorrectly (see comments below). 147 // simple we handle some of the edge cases incorrectly (see comments below).
136 switch (type()) { 148 switch (type()) {
137 case IdentToken: 149 case IdentToken:
138 serializeIdentifier(value(), builder); 150 serializeIdentifier(value(), builder);
139 break; 151 break;
140 case FunctionToken: 152 case FunctionToken:
141 serializeIdentifier(value(), builder); 153 serializeIdentifier(value(), builder);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return builder.append('}'); 228 return builder.append('}');
217 229
218 case EOFToken: 230 case EOFToken:
219 case CommentToken: 231 case CommentToken:
220 ASSERT_NOT_REACHED(); 232 ASSERT_NOT_REACHED();
221 return; 233 return;
222 } 234 }
223 } 235 }
224 236
225 } // namespace blink 237 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698