| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 15 matching lines...) Expand all Loading... |
| 26 #include "wtf/Vector.h" | 26 #include "wtf/Vector.h" |
| 27 | 27 |
| 28 namespace WebCore { | 28 namespace WebCore { |
| 29 | 29 |
| 30 class CSSParserValueList; | 30 class CSSParserValueList; |
| 31 | 31 |
| 32 class CSSValueList : public CSSValue { | 32 class CSSValueList : public CSSValue { |
| 33 public: | 33 public: |
| 34 static PassRefPtrWillBeRawPtr<CSSValueList> createCommaSeparated() | 34 static PassRefPtrWillBeRawPtr<CSSValueList> createCommaSeparated() |
| 35 { | 35 { |
| 36 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSValueList(
CommaSeparator)); | 36 return adoptRefWillBeRefCountedGarbageCollected(new CSSValueList(CommaSe
parator)); |
| 37 } | 37 } |
| 38 static PassRefPtrWillBeRawPtr<CSSValueList> createSpaceSeparated() | 38 static PassRefPtrWillBeRawPtr<CSSValueList> createSpaceSeparated() |
| 39 { | 39 { |
| 40 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSValueList(
SpaceSeparator)); | 40 return adoptRefWillBeRefCountedGarbageCollected(new CSSValueList(SpaceSe
parator)); |
| 41 } | 41 } |
| 42 static PassRefPtrWillBeRawPtr<CSSValueList> createSlashSeparated() | 42 static PassRefPtrWillBeRawPtr<CSSValueList> createSlashSeparated() |
| 43 { | 43 { |
| 44 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSValueList(
SlashSeparator)); | 44 return adoptRefWillBeRefCountedGarbageCollected(new CSSValueList(SlashSe
parator)); |
| 45 } | 45 } |
| 46 static PassRefPtrWillBeRawPtr<CSSValueList> createFromParserValueList(CSSPar
serValueList* list) | 46 static PassRefPtrWillBeRawPtr<CSSValueList> createFromParserValueList(CSSPar
serValueList* list) |
| 47 { | 47 { |
| 48 return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSValueList(
list)); | 48 return adoptRefWillBeRefCountedGarbageCollected(new CSSValueList(list)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 size_t length() const { return m_values.size(); } | 51 size_t length() const { return m_values.size(); } |
| 52 CSSValue* item(size_t index) { return index < m_values.size() ? m_values[ind
ex].get() : 0; } | 52 CSSValue* item(size_t index) { return index < m_values.size() ? m_values[ind
ex].get() : 0; } |
| 53 const CSSValue* item(size_t index) const { return index < m_values.size() ?
m_values[index].get() : 0; } | 53 const CSSValue* item(size_t index) const { return index < m_values.size() ?
m_values[index].get() : 0; } |
| 54 CSSValue* itemWithoutBoundsCheck(size_t index) { return m_values[index].get(
); } | 54 CSSValue* itemWithoutBoundsCheck(size_t index) { return m_values[index].get(
); } |
| 55 | 55 |
| 56 void append(PassRefPtr<CSSValue> value) { m_values.append(value); } | 56 void append(PassRefPtr<CSSValue> value) { m_values.append(value); } |
| 57 void prepend(PassRefPtr<CSSValue> value) { m_values.prepend(value); } | 57 void prepend(PassRefPtr<CSSValue> value) { m_values.prepend(value); } |
| 58 bool removeAll(CSSValue*); | 58 bool removeAll(CSSValue*); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void advance() { m_position++; ASSERT(m_position <= m_inspector.length());} | 109 void advance() { m_position++; ASSERT(m_position <= m_inspector.length());} |
| 110 size_t index() const { return m_position; } | 110 size_t index() const { return m_position; } |
| 111 private: | 111 private: |
| 112 CSSValueListInspector m_inspector; | 112 CSSValueListInspector m_inspector; |
| 113 size_t m_position; | 113 size_t m_position; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace WebCore | 116 } // namespace WebCore |
| 117 | 117 |
| 118 #endif // CSSValueList_h | 118 #endif // CSSValueList_h |
| OLD | NEW |