| 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 "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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); | 98 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); |
| 99 return static_cast<NumericValueType>(m_numericValueType); | 99 return static_cast<NumericValueType>(m_numericValueType); |
| 100 } | 100 } |
| 101 | 101 |
| 102 double CSSParserToken::numericValue() const | 102 double CSSParserToken::numericValue() const |
| 103 { | 103 { |
| 104 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); | 104 ASSERT(m_type == NumberToken || m_type == PercentageToken || m_type == Dimen
sionToken); |
| 105 return m_numericValue; | 105 return m_numericValue; |
| 106 } | 106 } |
| 107 | 107 |
| 108 CSSPropertyID CSSParserToken::parseAsCSSPropertyID() const | 108 CSSPropertyID CSSParserToken::parseAsUnresolvedCSSPropertyID() const |
| 109 { | 109 { |
| 110 ASSERT(m_type == IdentToken); | 110 ASSERT(m_type == IdentToken); |
| 111 return cssPropertyID(m_value); | 111 return unresolvedCSSPropertyID(m_value); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void CSSParserToken::serialize(StringBuilder& builder) const | 114 void CSSParserToken::serialize(StringBuilder& builder) const |
| 115 { | 115 { |
| 116 // This is currently only used for @supports CSSOM. To keep our implementati
on | 116 // This is currently only used for @supports CSSOM. To keep our implementati
on |
| 117 // simple we handle some of the edge cases incorrectly (see comments below). | 117 // simple we handle some of the edge cases incorrectly (see comments below). |
| 118 switch (type()) { | 118 switch (type()) { |
| 119 case IdentToken: | 119 case IdentToken: |
| 120 return serializeIdentifier(value(), builder); | 120 return serializeIdentifier(value(), builder); |
| 121 case FunctionToken: | 121 case FunctionToken: |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return builder.append('}'); | 194 return builder.append('}'); |
| 195 | 195 |
| 196 case EOFToken: | 196 case EOFToken: |
| 197 case CommentToken: | 197 case CommentToken: |
| 198 ASSERT_NOT_REACHED(); | 198 ASSERT_NOT_REACHED(); |
| 199 return; | 199 return; |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace blink | 203 } // namespace blink |
| OLD | NEW |