| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SVGListPropertyHelper_h | 31 #ifndef SVGListPropertyHelper_h |
| 32 #define SVGListPropertyHelper_h | 32 #define SVGListPropertyHelper_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ExceptionMessages.h" | 34 #include "bindings/core/v8/ExceptionMessages.h" |
| 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
| 37 #include "core/svg/SVGAnimationElement.h" | 37 #include "core/svg/SVGAnimationElement.h" |
| 38 #include "core/svg/properties/SVGPropertyHelper.h" | 38 #include "core/svg/properties/SVGPropertyHelper.h" |
| 39 #include "wtf/Allocator.h" |
| 39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 // This is an implementation of the SVG*List property spec: | 45 // This is an implementation of the SVG*List property spec: |
| 45 // http://www.w3.org/TR/SVG/single-page.html#types-InterfaceSVGLengthList | 46 // http://www.w3.org/TR/SVG/single-page.html#types-InterfaceSVGLengthList |
| 46 template<typename Derived, typename ItemProperty> | 47 template<typename Derived, typename ItemProperty> |
| 47 class SVGListPropertyHelper : public SVGPropertyHelper<Derived> { | 48 class SVGListPropertyHelper : public SVGPropertyHelper<Derived> { |
| 48 public: | 49 public: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 67 ASSERT(m_values.at(index)->ownerList() == this); | 68 ASSERT(m_values.at(index)->ownerList() == this); |
| 68 return m_values.at(index).get(); | 69 return m_values.at(index).get(); |
| 69 } | 70 } |
| 70 | 71 |
| 71 const ItemPropertyType* at(size_t index) const | 72 const ItemPropertyType* at(size_t index) const |
| 72 { | 73 { |
| 73 return const_cast<SVGListPropertyHelper<Derived, ItemProperty>*>(this)->
at(index); | 74 return const_cast<SVGListPropertyHelper<Derived, ItemProperty>*>(this)->
at(index); |
| 74 } | 75 } |
| 75 | 76 |
| 76 class ConstIterator { | 77 class ConstIterator { |
| 78 STACK_ALLOCATED(); |
| 77 private: | 79 private: |
| 78 typedef typename WillBeHeapVector<RefPtrWillBeMember<ItemPropertyType>>:
:const_iterator WrappedType; | 80 typedef typename WillBeHeapVector<RefPtrWillBeMember<ItemPropertyType>>:
:const_iterator WrappedType; |
| 79 | 81 |
| 80 public: | 82 public: |
| 81 ConstIterator(WrappedType it) | 83 ConstIterator(WrappedType it) |
| 82 : m_it(it) | 84 : m_it(it) |
| 83 { | 85 { |
| 84 } | 86 } |
| 85 | 87 |
| 86 ConstIterator& operator++() { ++m_it; return *this; } | 88 ConstIterator& operator++() { ++m_it; return *this; } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 for (size_t i = 0; i < paddingCount; ++i) | 365 for (size_t i = 0; i < paddingCount; ++i) |
| 364 append(createPaddingItem()); | 366 append(createPaddingItem()); |
| 365 } | 367 } |
| 366 | 368 |
| 367 return true; | 369 return true; |
| 368 } | 370 } |
| 369 | 371 |
| 370 } | 372 } |
| 371 | 373 |
| 372 #endif // SVGListPropertyHelper_h | 374 #endif // SVGListPropertyHelper_h |
| OLD | NEW |