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 : CSSValueObject(ValueListClass) | 36 : CSSValueObject(ValueListClass) |
37 { | 37 { |
38 m_valueListSeparator = listSeparator; | 38 m_valueListSeparator = listSeparator; |
39 } | 39 } |
40 | 40 |
41 bool CSSValueList::removeAll(CSSValue val) | 41 bool CSSValueList::removeAll(const CSSValue& val) |
42 { | 42 { |
43 bool found = false; | 43 bool found = false; |
44 for (int index = m_values.size() - 1; index >= 0; --index) { | 44 for (int index = m_values.size() - 1; index >= 0; --index) { |
45 CSSValue& value = m_values.at(index); | 45 CSSValue& value = m_values.at(index); |
46 if (value.equals(val)) { | 46 if (value.equals(val)) { |
47 m_values.remove(index); | 47 m_values.remove(index); |
48 found = true; | 48 found = true; |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 return found; | 52 return found; |
53 } | 53 } |
54 | 54 |
55 bool CSSValueList::hasValue(CSSValue val) const | 55 bool CSSValueList::hasValue(const CSSValue& val) const |
56 { | 56 { |
57 for (size_t index = 0; index < m_values.size(); index++) { | 57 for (size_t index = 0; index < m_values.size(); index++) { |
58 const CSSValue& value = m_values.at(index); | 58 const CSSValue& value = m_values.at(index); |
59 if (value.equals(val)) | 59 if (value.equals(val)) |
60 return true; | 60 return true; |
61 } | 61 } |
62 return false; | 62 return false; |
63 } | 63 } |
64 | 64 |
65 PassRefPtrWillBeRawPtr<CSSValueList> CSSValueList::copy() | 65 PassRefPtrWillBeRawPtr<CSSValueList> CSSValueList::copy() |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 DEFINE_TRACE_AFTER_DISPATCH(CSSValueList) | 128 DEFINE_TRACE_AFTER_DISPATCH(CSSValueList) |
129 { | 129 { |
130 for (unsigned i = 0; i < m_values.size(); ++i) { | 130 for (unsigned i = 0; i < m_values.size(); ++i) { |
131 visitor->trace(m_values[i]); | 131 visitor->trace(m_values[i]); |
132 } | 132 } |
133 CSSValueObject::traceAfterDispatch(visitor); | 133 CSSValueObject::traceAfterDispatch(visitor); |
134 } | 134 } |
135 | 135 |
136 } // namespace blink | 136 } // namespace blink |
OLD | NEW |