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 18 matching lines...) Expand all Loading... |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 using namespace WTF; | 31 using namespace WTF; |
32 | 32 |
33 CSSParserValueList::~CSSParserValueList() | 33 CSSParserValueList::~CSSParserValueList() |
34 { | 34 { |
35 size_t numValues = m_values.size(); | 35 size_t numValues = m_values.size(); |
36 for (size_t i = 0; i < numValues; i++) { | 36 for (size_t i = 0; i < numValues; i++) { |
37 if (m_values[i].unit == CSSParserValue::Function) | 37 if (m_values[i].unit == CSSParserValue::Function) |
38 delete m_values[i].function; | 38 delete m_values[i].function; |
| 39 else if (m_values[i].unit == CSSParserValue::ValueList) |
| 40 delete m_values[i].valueList; |
39 } | 41 } |
40 } | 42 } |
41 | 43 |
42 void CSSParserValueList::addValue(const CSSParserValue& v) | 44 void CSSParserValueList::addValue(const CSSParserValue& v) |
43 { | 45 { |
44 m_values.append(v); | 46 m_values.append(v); |
45 } | 47 } |
46 | 48 |
47 void CSSParserValueList::insertValueAt(unsigned i, const CSSParserValue& v) | 49 void CSSParserValueList::insertValueAt(unsigned i, const CSSParserValue& v) |
48 { | 50 { |
(...skipping 17 matching lines...) Expand all Loading... |
66 if (id) | 68 if (id) |
67 return CSSPrimitiveValue::createIdentifier(id); | 69 return CSSPrimitiveValue::createIdentifier(id); |
68 | 70 |
69 if (unit == CSSParserValue::Operator) { | 71 if (unit == CSSParserValue::Operator) { |
70 RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createPars
erOperator(iValue); | 72 RefPtr<CSSPrimitiveValue> primitiveValue = CSSPrimitiveValue::createPars
erOperator(iValue); |
71 primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR)
; | 73 primitiveValue->setPrimitiveType(CSSPrimitiveValue::CSS_PARSER_OPERATOR)
; |
72 return primitiveValue; | 74 return primitiveValue; |
73 } | 75 } |
74 if (unit == CSSParserValue::Function) | 76 if (unit == CSSParserValue::Function) |
75 return CSSFunctionValue::create(function); | 77 return CSSFunctionValue::create(function); |
| 78 if (unit == CSSParserValue::ValueList) |
| 79 return CSSValueList::createFromParserValueList(valueList); |
76 if (unit >= CSSParserValue::Q_EMS) | 80 if (unit >= CSSParserValue::Q_EMS) |
77 return CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitive
Value::CSS_EMS); | 81 return CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitive
Value::CSS_EMS); |
78 | 82 |
79 CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::
UnitTypes>(unit); | 83 CSSPrimitiveValue::UnitTypes primitiveUnit = static_cast<CSSPrimitiveValue::
UnitTypes>(unit); |
80 switch (primitiveUnit) { | 84 switch (primitiveUnit) { |
81 case CSSPrimitiveValue::CSS_IDENT: | 85 case CSSPrimitiveValue::CSS_IDENT: |
82 case CSSPrimitiveValue::CSS_PROPERTY_ID: | 86 case CSSPrimitiveValue::CSS_PROPERTY_ID: |
83 case CSSPrimitiveValue::CSS_VALUE_ID: | 87 case CSSPrimitiveValue::CSS_VALUE_ID: |
84 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_I
DENTIFIER); | 88 return CSSPrimitiveValue::create(string, CSSPrimitiveValue::CSS_PARSER_I
DENTIFIER); |
85 case CSSPrimitiveValue::CSS_NUMBER: | 89 case CSSPrimitiveValue::CSS_NUMBER: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); | 233 CSSParserSelector* selector = const_cast<CSSParserSelector*>(this); |
230 do { | 234 do { |
231 if (selector->isDistributedPseudoElement()) | 235 if (selector->isDistributedPseudoElement()) |
232 return selector; | 236 return selector; |
233 } while ((selector = selector->tagHistory())); | 237 } while ((selector = selector->tagHistory())); |
234 return 0; | 238 return 0; |
235 } | 239 } |
236 | 240 |
237 } | 241 } |
238 | 242 |
OLD | NEW |