| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 return newItem; | 223 return newItem; |
| 224 } | 224 } |
| 225 | 225 |
| 226 template <typename Derived, typename ItemProperty> | 226 template <typename Derived, typename ItemProperty> |
| 227 ItemProperty* SVGListPropertyHelper<Derived, ItemProperty>::removeItem( | 227 ItemProperty* SVGListPropertyHelper<Derived, ItemProperty>::removeItem( |
| 228 size_t index, | 228 size_t index, |
| 229 ExceptionState& exceptionState) { | 229 ExceptionState& exceptionState) { |
| 230 if (index >= m_values.size()) { | 230 if (index >= m_values.size()) { |
| 231 exceptionState.throwDOMException( | 231 exceptionState.throwDOMException( |
| 232 IndexSizeError, ExceptionMessages::indexExceedsMaximumBound( | 232 IndexSizeError, |
| 233 "index", index, m_values.size())); | 233 ExceptionMessages::indexExceedsMaximumBound("index", index, |
| 234 m_values.size())); |
| 234 return nullptr; | 235 return nullptr; |
| 235 } | 236 } |
| 236 ASSERT(m_values.at(index)->ownerList() == this); | 237 ASSERT(m_values.at(index)->ownerList() == this); |
| 237 ItemPropertyType* oldItem = m_values.at(index); | 238 ItemPropertyType* oldItem = m_values.at(index); |
| 238 m_values.remove(index); | 239 m_values.remove(index); |
| 239 oldItem->setOwnerList(0); | 240 oldItem->setOwnerList(0); |
| 240 return oldItem; | 241 return oldItem; |
| 241 } | 242 } |
| 242 | 243 |
| 243 template <typename Derived, typename ItemProperty> | 244 template <typename Derived, typename ItemProperty> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 277 |
| 277 return newItem; | 278 return newItem; |
| 278 } | 279 } |
| 279 | 280 |
| 280 template <typename Derived, typename ItemProperty> | 281 template <typename Derived, typename ItemProperty> |
| 281 bool SVGListPropertyHelper<Derived, ItemProperty>::checkIndexBound( | 282 bool SVGListPropertyHelper<Derived, ItemProperty>::checkIndexBound( |
| 282 size_t index, | 283 size_t index, |
| 283 ExceptionState& exceptionState) { | 284 ExceptionState& exceptionState) { |
| 284 if (index >= m_values.size()) { | 285 if (index >= m_values.size()) { |
| 285 exceptionState.throwDOMException( | 286 exceptionState.throwDOMException( |
| 286 IndexSizeError, ExceptionMessages::indexExceedsMaximumBound( | 287 IndexSizeError, |
| 287 "index", index, m_values.size())); | 288 ExceptionMessages::indexExceedsMaximumBound("index", index, |
| 289 m_values.size())); |
| 288 return false; | 290 return false; |
| 289 } | 291 } |
| 290 | 292 |
| 291 return true; | 293 return true; |
| 292 } | 294 } |
| 293 | 295 |
| 294 template <typename Derived, typename ItemProperty> | 296 template <typename Derived, typename ItemProperty> |
| 295 size_t SVGListPropertyHelper<Derived, ItemProperty>::findItem( | 297 size_t SVGListPropertyHelper<Derived, ItemProperty>::findItem( |
| 296 ItemPropertyType* item) { | 298 ItemPropertyType* item) { |
| 297 return m_values.find(item); | 299 return m_values.find(item); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 for (size_t i = 0; i < paddingCount; ++i) | 342 for (size_t i = 0; i < paddingCount; ++i) |
| 341 append(createPaddingItem()); | 343 append(createPaddingItem()); |
| 342 } | 344 } |
| 343 | 345 |
| 344 return true; | 346 return true; |
| 345 } | 347 } |
| 346 | 348 |
| 347 } // namespace blink | 349 } // namespace blink |
| 348 | 350 |
| 349 #endif // SVGListPropertyHelper_h | 351 #endif // SVGListPropertyHelper_h |
| OLD | NEW |