OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 value.id = CSSValueInvalid; | 58 value.id = CSSValueInvalid; |
59 value.isInt = false; | 59 value.isInt = false; |
60 value.setUnit(CSSPrimitiveValue::UnitType::URI); | 60 value.setUnit(CSSPrimitiveValue::UnitType::URI); |
61 value.string = next.value(); | 61 value.string = next.value(); |
62 break; | 62 break; |
63 } | 63 } |
64 | 64 |
65 value.id = CSSValueInvalid; | 65 value.id = CSSValueInvalid; |
66 value.isInt = false; | 66 value.isInt = false; |
67 | 67 |
68 CSSValueID id = cssValueKeywordID(token.value()); | 68 CSSValueID id = token.functionId(); |
69 if (id == CSSValueCalc || id == CSSValueWebkitCalc) { | 69 if (id == CSSValueCalc || id == CSSValueWebkitCalc) { |
70 value.m_unit = CSSParserValue::CalcFunction; | 70 value.m_unit = CSSParserValue::CalcFunction; |
71 value.calcFunction = new CSSParserCalcFunction(range.consumeBloc
k()); | 71 value.calcFunction = new CSSParserCalcFunction(range.consumeBloc
k()); |
72 break; | 72 break; |
73 } | 73 } |
74 range.consume(); | 74 range.consume(); |
75 value.m_unit = CSSParserValue::Function; | 75 value.m_unit = CSSParserValue::Function; |
76 CSSParserFunction* function = new CSSParserFunction; | 76 CSSParserFunction* function = new CSSParserFunction; |
77 function->id = id; | 77 function->id = id; |
78 CSSParserValueList* list = new CSSParserValueList; | 78 CSSParserValueList* list = new CSSParserValueList; |
(...skipping 22 matching lines...) Expand all Loading... |
101 destroyAndClear(); | 101 destroyAndClear(); |
102 return; | 102 return; |
103 } | 103 } |
104 continue; | 104 continue; |
105 } | 105 } |
106 bracketCounts.last()--; | 106 bracketCounts.last()--; |
107 value.setFromOperator(')'); | 107 value.setFromOperator(')'); |
108 break; | 108 break; |
109 } | 109 } |
110 case IdentToken: { | 110 case IdentToken: { |
111 value.id = cssValueKeywordID(token.value()); | 111 value.id = token.id(); |
112 value.isInt = false; | 112 value.isInt = false; |
113 value.m_unit = CSSParserValue::Identifier; | 113 value.m_unit = CSSParserValue::Identifier; |
114 value.string = token.value(); | 114 value.string = token.value(); |
115 break; | 115 break; |
116 } | 116 } |
117 case DimensionToken: | 117 case DimensionToken: |
118 if (!std::isfinite(token.numericValue())) { | 118 if (!std::isfinite(token.numericValue())) { |
119 destroyAndClear(); | 119 destroyAndClear(); |
120 return; | 120 return; |
121 } | 121 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 { | 248 { |
249 destroy(m_values); | 249 destroy(m_values); |
250 } | 250 } |
251 | 251 |
252 void CSSParserValueList::addValue(const CSSParserValue& v) | 252 void CSSParserValueList::addValue(const CSSParserValue& v) |
253 { | 253 { |
254 m_values.append(v); | 254 m_values.append(v); |
255 } | 255 } |
256 | 256 |
257 } // namespace blink | 257 } // namespace blink |
OLD | NEW |