| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(
*secondPtr))) | 210 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(
*secondPtr))) |
| 211 continue; | 211 continue; |
| 212 return false; | 212 return false; |
| 213 } | 213 } |
| 214 return true; | 214 return true; |
| 215 } | 215 } |
| 216 | 216 |
| 217 template<typename CSSValueType> | 217 template<typename CSSValueType> |
| 218 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C
SSValueType>& second) | 218 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C
SSValueType>& second) |
| 219 { | 219 { |
| 220 return first ? second && first->equals(*second) : !second; | 220 if (first == second) |
| 221 return true; |
| 222 if (!first || !second) |
| 223 return false; |
| 224 return first->equals(*second); |
| 221 } | 225 } |
| 222 | 226 |
| 223 template<typename CSSValueType> | 227 template<typename CSSValueType> |
| 224 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C
SSValueType>& second) | 228 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C
SSValueType>& second) |
| 225 { | 229 { |
| 226 return first ? second && first->equals(*second) : !second; | 230 if (first == second) |
| 231 return true; |
| 232 if (!first || !second) |
| 233 return false; |
| 234 return first->equals(*second); |
| 227 } | 235 } |
| 228 | 236 |
| 229 template<typename CSSValueType> | 237 template<typename CSSValueType> |
| 230 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C
SSValueType>& second) | 238 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C
SSValueType>& second) |
| 231 { | 239 { |
| 232 return first ? second && first->equals(*second) : !second; | 240 if (first == second) |
| 241 return true; |
| 242 if (!first || !second) |
| 243 return false; |
| 244 return first->equals(*second); |
| 233 } | 245 } |
| 234 | 246 |
| 235 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 247 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
| 236 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 248 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
| 237 | 249 |
| 238 } // namespace blink | 250 } // namespace blink |
| 239 | 251 |
| 240 #endif // CSSValue_h | 252 #endif // CSSValue_h |
| OLD | NEW |