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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 mutable unsigned m_hasCachedCSSText : 1; | 217 mutable unsigned m_hasCachedCSSText : 1; |
218 unsigned m_isQuirkValue : 1; | 218 unsigned m_isQuirkValue : 1; |
219 | 219 |
220 unsigned m_valueListSeparator : ValueListSeparatorBits; | 220 unsigned m_valueListSeparator : ValueListSeparatorBits; |
221 | 221 |
222 private: | 222 private: |
223 unsigned m_classType : ClassTypeBits; // ClassType | 223 unsigned m_classType : ClassTypeBits; // ClassType |
224 }; | 224 }; |
225 | 225 |
226 template<typename CSSValueType, size_t inlineCapacity> | 226 template<typename CSSValueType, size_t inlineCapacity> |
227 inline bool compareCSSValueVector(const WillBeHeapVector<RefPtrWillBeMember<CSSV
alueType>, inlineCapacity>& firstVector, const WillBeHeapVector<RefPtrWillBeMemb
er<CSSValueType>, inlineCapacity>& secondVector) | 227 inline bool compareCSSValueVector(const Vector<RefPtr<CSSValueType>, inlineCapac
ity>& firstVector, const Vector<RefPtr<CSSValueType>, inlineCapacity>& secondVec
tor) |
228 { | 228 { |
229 size_t size = firstVector.size(); | 229 size_t size = firstVector.size(); |
230 if (size != secondVector.size()) | 230 if (size != secondVector.size()) |
231 return false; | 231 return false; |
232 | 232 |
233 for (size_t i = 0; i < size; i++) { | 233 for (size_t i = 0; i < size; i++) { |
234 const RefPtrWillBeMember<CSSValueType>& firstPtr = firstVector[i]; | 234 const RefPtr<CSSValueType>& firstPtr = firstVector[i]; |
235 const RefPtrWillBeMember<CSSValueType>& secondPtr = secondVector[i]; | 235 const RefPtr<CSSValueType>& secondPtr = secondVector[i]; |
236 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(
*secondPtr))) | 236 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(
*secondPtr))) |
237 continue; | 237 continue; |
238 return false; | 238 return false; |
239 } | 239 } |
240 return true; | 240 return true; |
241 } | 241 } |
242 | 242 |
| 243 // FIXME: oilpan: this will be merged with the above compareCSSVector method |
| 244 // once CSSValue is moved to the transition types. |
| 245 template<typename CSSValueType, size_t inlineCapacity> |
| 246 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC
apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s
econdVector) |
| 247 { |
| 248 size_t size = firstVector.size(); |
| 249 if (size != secondVector.size()) |
| 250 return false; |
| 251 |
| 252 for (size_t i = 0; i < size; i++) { |
| 253 const Member<CSSValueType>& firstPtr = firstVector[i]; |
| 254 const Member<CSSValueType>& secondPtr = secondVector[i]; |
| 255 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(
*secondPtr))) |
| 256 continue; |
| 257 return false; |
| 258 } |
| 259 return true; |
| 260 } |
| 261 |
243 template<typename CSSValueType> | 262 template<typename CSSValueType> |
244 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C
SSValueType>& second) | 263 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C
SSValueType>& second) |
245 { | 264 { |
246 return first ? second && first->equals(*second) : !second; | 265 return first ? second && first->equals(*second) : !second; |
247 } | 266 } |
248 | 267 |
249 template<typename CSSValueType> | 268 template<typename CSSValueType> |
250 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C
SSValueType>& second) | 269 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C
SSValueType>& second) |
251 { | 270 { |
252 return first ? second && first->equals(*second) : !second; | 271 return first ? second && first->equals(*second) : !second; |
253 } | 272 } |
254 | 273 |
255 template<typename CSSValueType> | 274 template<typename CSSValueType> |
256 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C
SSValueType>& second) | 275 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C
SSValueType>& second) |
257 { | 276 { |
258 return first ? second && first->equals(*second) : !second; | 277 return first ? second && first->equals(*second) : !second; |
259 } | 278 } |
260 | 279 |
261 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 280 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
262 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 281 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
263 | 282 |
264 } // namespace WebCore | 283 } // namespace WebCore |
265 | 284 |
266 #endif // CSSValue_h | 285 #endif // CSSValue_h |
OLD | NEW |