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, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 unsigned currentIndex() { return m_current; } | 182 unsigned currentIndex() { return m_current; } |
183 CSSParserValue* current() { return m_current < m_values.size() ? &m_values[m
_current] : 0; } | 183 CSSParserValue* current() { return m_current < m_values.size() ? &m_values[m
_current] : 0; } |
184 CSSParserValue* next() { ++m_current; return current(); } | 184 CSSParserValue* next() { ++m_current; return current(); } |
185 CSSParserValue* previous() | 185 CSSParserValue* previous() |
186 { | 186 { |
187 if (!m_current) | 187 if (!m_current) |
188 return 0; | 188 return 0; |
189 --m_current; | 189 --m_current; |
190 return current(); | 190 return current(); |
191 } | 191 } |
| 192 void setCurrentIndex(unsigned index) |
| 193 { |
| 194 ASSERT(index >= 0 && index < m_values.size()); |
| 195 if (index >= 0 && index < m_values.size()) |
| 196 m_current = index; |
| 197 } |
192 | 198 |
193 CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values
[i] : 0; } | 199 CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &m_values
[i] : 0; } |
194 | 200 |
195 void clear() { m_values.clear(); } | 201 void clear() { m_values.clear(); } |
196 | 202 |
197 private: | 203 private: |
198 unsigned m_current; | 204 unsigned m_current; |
199 Vector<CSSParserValue, 4> m_values; | 205 Vector<CSSParserValue, 4> m_values; |
200 }; | 206 }; |
201 | 207 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu
eList) | 285 inline void CSSParserValue::setFromValueList(PassOwnPtr<CSSParserValueList> valu
eList) |
280 { | 286 { |
281 id = CSSValueInvalid; | 287 id = CSSValueInvalid; |
282 this->valueList = valueList.leakPtr(); | 288 this->valueList = valueList.leakPtr(); |
283 unit = ValueList; | 289 unit = ValueList; |
284 } | 290 } |
285 | 291 |
286 } | 292 } |
287 | 293 |
288 #endif | 294 #endif |
OLD | NEW |