| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include "core/css/CSSMarkup.h" | 8 #include "core/css/CSSMarkup.h" |
| 9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "core/css/parser/CSSPropertyParser.h" | 10 #include "core/css/parser/CSSPropertyParser.h" |
| 11 #include "platform/wtf/HashMap.h" | 11 #include "platform/wtf/HashMap.h" |
| 12 #include "platform/wtf/text/StringBuilder.h" | 12 #include "platform/wtf/text/StringBuilder.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 CSSParserToken::CSSParserToken(CSSParserTokenType type, BlockType block_type) | |
| 17 : type_(type), block_type_(block_type) {} | |
| 18 | |
| 19 // Just a helper used for Delimiter tokens. | 16 // Just a helper used for Delimiter tokens. |
| 20 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar c) | 17 CSSParserToken::CSSParserToken(CSSParserTokenType type, UChar c) |
| 21 : type_(type), block_type_(kNotBlock), delimiter_(c) { | 18 : type_(type), block_type_(kNotBlock), delimiter_(c) { |
| 22 DCHECK_EQ(type_, static_cast<unsigned>(kDelimiterToken)); | 19 DCHECK_EQ(type_, static_cast<unsigned>(kDelimiterToken)); |
| 23 } | 20 } |
| 24 | 21 |
| 25 CSSParserToken::CSSParserToken(CSSParserTokenType type, | 22 CSSParserToken::CSSParserToken(CSSParserTokenType type, |
| 26 StringView value, | |
| 27 BlockType block_type) | |
| 28 : type_(type), block_type_(block_type) { | |
| 29 InitValueFromStringView(value); | |
| 30 id_ = -1; | |
| 31 } | |
| 32 | |
| 33 CSSParserToken::CSSParserToken(CSSParserTokenType type, | |
| 34 double numeric_value, | 23 double numeric_value, |
| 35 NumericValueType numeric_value_type, | 24 NumericValueType numeric_value_type, |
| 36 NumericSign sign) | 25 NumericSign sign) |
| 37 : type_(type), | 26 : type_(type), |
| 38 block_type_(kNotBlock), | 27 block_type_(kNotBlock), |
| 39 numeric_value_type_(numeric_value_type), | 28 numeric_value_type_(numeric_value_type), |
| 40 numeric_sign_(sign), | 29 numeric_sign_(sign), |
| 41 unit_(static_cast<unsigned>(CSSPrimitiveValue::UnitType::kNumber)) { | 30 unit_(static_cast<unsigned>(CSSPrimitiveValue::UnitType::kNumber)) { |
| 42 DCHECK_EQ(type, kNumberToken); | 31 DCHECK_EQ(type, kNumberToken); |
| 43 numeric_value_ = | 32 numeric_value_ = |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 return builder.Append('}'); | 266 return builder.Append('}'); |
| 278 | 267 |
| 279 case kEOFToken: | 268 case kEOFToken: |
| 280 case kCommentToken: | 269 case kCommentToken: |
| 281 NOTREACHED(); | 270 NOTREACHED(); |
| 282 return; | 271 return; |
| 283 } | 272 } |
| 284 } | 273 } |
| 285 | 274 |
| 286 } // namespace blink | 275 } // namespace blink |
| OLD | NEW |