| 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, 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 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 20 matching lines...) Expand all Loading... |
| 31 { | 31 { |
| 32 m_valueListSeparator = listSeparator; | 32 m_valueListSeparator = listSeparator; |
| 33 } | 33 } |
| 34 | 34 |
| 35 CSSValueList::CSSValueList(ValueListSeparator listSeparator) | 35 CSSValueList::CSSValueList(ValueListSeparator listSeparator) |
| 36 : CSSValue(ValueListClass) | 36 : CSSValue(ValueListClass) |
| 37 { | 37 { |
| 38 m_valueListSeparator = listSeparator; | 38 m_valueListSeparator = listSeparator; |
| 39 } | 39 } |
| 40 | 40 |
| 41 CSSValueList::CSSValueList(CSSParserValueList* parserValues) | |
| 42 : CSSValue(ValueListClass) | |
| 43 { | |
| 44 m_valueListSeparator = SpaceSeparator; | |
| 45 if (parserValues) { | |
| 46 m_values.reserveInitialCapacity(parserValues->size()); | |
| 47 for (unsigned i = 0; i < parserValues->size(); ++i) | |
| 48 m_values.uncheckedAppend(parserValues->valueAt(i)->createCSSValue())
; | |
| 49 } | |
| 50 } | |
| 51 | |
| 52 bool CSSValueList::removeAll(CSSValue* val) | 41 bool CSSValueList::removeAll(CSSValue* val) |
| 53 { | 42 { |
| 54 bool found = false; | 43 bool found = false; |
| 55 for (size_t index = 0; index < m_values.size(); index++) { | 44 for (size_t index = 0; index < m_values.size(); index++) { |
| 56 RefPtrWillBeMember<CSSValue>& value = m_values.at(index); | 45 RefPtrWillBeMember<CSSValue>& value = m_values.at(index); |
| 57 if (value && val && value->equals(*val)) { | 46 if (value && val && value->equals(*val)) { |
| 58 m_values.remove(index); | 47 m_values.remove(index); |
| 59 found = true; | 48 found = true; |
| 60 } | 49 } |
| 61 } | 50 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return adoptRefWillBeNoop(new CSSValueList(*this)); | 151 return adoptRefWillBeNoop(new CSSValueList(*this)); |
| 163 } | 152 } |
| 164 | 153 |
| 165 void CSSValueList::traceAfterDispatch(Visitor* visitor) | 154 void CSSValueList::traceAfterDispatch(Visitor* visitor) |
| 166 { | 155 { |
| 167 visitor->trace(m_values); | 156 visitor->trace(m_values); |
| 168 CSSValue::traceAfterDispatch(visitor); | 157 CSSValue::traceAfterDispatch(visitor); |
| 169 } | 158 } |
| 170 | 159 |
| 171 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |