OLD | NEW |
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 "core/css/parser/CSSParserToken.h" | 5 #include "core/css/parser/CSSParserToken.h" |
6 | 6 |
7 #include "core/css/CSSMarkup.h" | 7 #include "core/css/CSSMarkup.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 serializeIdentifier(value().toString(), builder); | 206 serializeIdentifier(value().toString(), builder); |
207 break; | 207 break; |
208 case FunctionToken: | 208 case FunctionToken: |
209 serializeIdentifier(value().toString(), builder); | 209 serializeIdentifier(value().toString(), builder); |
210 return builder.append('('); | 210 return builder.append('('); |
211 case AtKeywordToken: | 211 case AtKeywordToken: |
212 builder.append('@'); | 212 builder.append('@'); |
213 serializeIdentifier(value().toString(), builder); | 213 serializeIdentifier(value().toString(), builder); |
214 break; | 214 break; |
215 case HashToken: | 215 case HashToken: |
216 // This will always serialize as a hash-token with 'id' type instead of | |
217 // preserving the type of the input. | |
218 builder.append('#'); | 216 builder.append('#'); |
219 serializeIdentifier(value().toString(), builder); | 217 serializeIdentifier(value().toString(), builder, (getHashTokenType() ==
HashTokenUnrestricted)); |
220 break; | 218 break; |
221 case UrlToken: | 219 case UrlToken: |
222 builder.append("url("); | 220 builder.append("url("); |
223 serializeIdentifier(value().toString(), builder); | 221 serializeIdentifier(value().toString(), builder); |
224 return builder.append(")"); | 222 return builder.append(")"); |
225 case DelimiterToken: | 223 case DelimiterToken: |
226 if (delimiter() == '\\') | 224 if (delimiter() == '\\') |
227 return builder.append("\\\n"); | 225 return builder.append("\\\n"); |
228 return builder.append(delimiter()); | 226 return builder.append(delimiter()); |
229 case NumberToken: | 227 case NumberToken: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return value >= -std::numeric_limits<float>::max() | 293 return value >= -std::numeric_limits<float>::max() |
296 && value <= std::numeric_limits<float>::max(); | 294 && value <= std::numeric_limits<float>::max(); |
297 } | 295 } |
298 | 296 |
299 bool CSSParserToken::isValidNumericValue() const | 297 bool CSSParserToken::isValidNumericValue() const |
300 { | 298 { |
301 return isValidNumericValue(numericValue()); | 299 return isValidNumericValue(numericValue()); |
302 } | 300 } |
303 | 301 |
304 } // namespace blink | 302 } // namespace blink |
OLD | NEW |