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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 // FIXME: This should use mass removal. | 137 // FIXME: This should use mass removal. |
138 for (unsigned i = 0; i < propertiesToRemove.size(); i++) | 138 for (unsigned i = 0; i < propertiesToRemove.size(); i++) |
139 style->removeProperty(propertiesToRemove[i]); | 139 style->removeProperty(propertiesToRemove[i]); |
140 } | 140 } |
141 | 141 |
142 PassRefPtr<CSSMutableStyleDeclaration> CSSStyleDeclaration::copyPropertiesInSet(
const int* set, unsigned length) const | 142 PassRefPtr<CSSMutableStyleDeclaration> CSSStyleDeclaration::copyPropertiesInSet(
const int* set, unsigned length) const |
143 { | 143 { |
144 Vector<CSSProperty> list; | 144 Vector<CSSProperty> list; |
145 list.reserveCapacity(length); | 145 list.reserveInitialCapacity(length); |
146 unsigned variableDependentValueCount = 0; | 146 unsigned variableDependentValueCount = 0; |
147 for (unsigned i = 0; i < length; i++) { | 147 for (unsigned i = 0; i < length; i++) { |
148 RefPtr<CSSValue> value = getPropertyCSSValue(set[i]); | 148 RefPtr<CSSValue> value = getPropertyCSSValue(set[i]); |
149 if (value) { | 149 if (value) { |
150 if (value->isVariableDependentValue()) | 150 if (value->isVariableDependentValue()) |
151 variableDependentValueCount++; | 151 variableDependentValueCount++; |
152 list.append(CSSProperty(set[i], value.release(), false)); | 152 list.append(CSSProperty(set[i], value.release(), false)); |
153 } | 153 } |
154 } | 154 } |
155 return CSSMutableStyleDeclaration::create(list, variableDependentValueCount)
; | 155 return CSSMutableStyleDeclaration::create(list, variableDependentValueCount)
; |
156 } | 156 } |
157 | 157 |
158 } // namespace WebCore | 158 } // namespace WebCore |
OLD | NEW |