OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef SVGStringList_h | 31 #ifndef SVGStringList_h |
32 #define SVGStringList_h | 32 #define SVGStringList_h |
33 | 33 |
34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "core/svg/SVGParsingError.h" |
35 #include "core/svg/SVGString.h" | 35 #include "core/svg/SVGString.h" |
36 #include "core/svg/properties/SVGPropertyHelper.h" | 36 #include "core/svg/properties/SVGPropertyHelper.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
| 40 class ExceptionState; |
40 class SVGStringListTearOff; | 41 class SVGStringListTearOff; |
41 | 42 |
42 // Implementation of SVGStringList spec: | 43 // Implementation of SVGStringList spec: |
43 // http://www.w3.org/TR/SVG/single-page.html#types-InterfaceSVGStringList | 44 // http://www.w3.org/TR/SVG/single-page.html#types-InterfaceSVGStringList |
44 // See SVGStringListTearOff for actual Javascript interface. | 45 // See SVGStringListTearOff for actual Javascript interface. |
45 // Unlike other SVG*List implementations, SVGStringList is NOT tied to SVGString
. | 46 // Unlike other SVG*List implementations, SVGStringList is NOT tied to SVGString
. |
46 // SVGStringList operates directly on DOMString. | 47 // SVGStringList operates directly on DOMString. |
47 // | 48 // |
48 // In short: | 49 // In short: |
49 // SVGStringList has_a Vector<String>. | 50 // SVGStringList has_a Vector<String>. |
(...skipping 17 matching lines...) Expand all Loading... |
67 unsigned long length() { return m_values.size(); } | 68 unsigned long length() { return m_values.size(); } |
68 void clear() { m_values.clear(); } | 69 void clear() { m_values.clear(); } |
69 void initialize(const String&); | 70 void initialize(const String&); |
70 String getItem(size_t, ExceptionState&); | 71 String getItem(size_t, ExceptionState&); |
71 void insertItemBefore(const String&, size_t); | 72 void insertItemBefore(const String&, size_t); |
72 String removeItem(size_t, ExceptionState&); | 73 String removeItem(size_t, ExceptionState&); |
73 void appendItem(const String&); | 74 void appendItem(const String&); |
74 void replaceItem(const String&, size_t, ExceptionState&); | 75 void replaceItem(const String&, size_t, ExceptionState&); |
75 | 76 |
76 // SVGPropertyBase: | 77 // SVGPropertyBase: |
77 void setValueAsString(const String&, ExceptionState&); | 78 SVGParsingError setValueAsString(const String&); |
78 String valueAsString() const override; | 79 String valueAsString() const override; |
79 | 80 |
80 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 81 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
81 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; | 82 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; |
82 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; | 83 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; |
83 | 84 |
84 static AnimatedPropertyType classType() { return AnimatedStringList; } | 85 static AnimatedPropertyType classType() { return AnimatedStringList; } |
85 | 86 |
86 private: | 87 private: |
87 SVGStringList(); | 88 SVGStringList(); |
88 | 89 |
89 template <typename CharType> | 90 template <typename CharType> |
90 void parseInternal(const CharType*& ptr, const CharType* end); | 91 void parseInternal(const CharType*& ptr, const CharType* end); |
91 bool checkIndexBound(size_t, ExceptionState&); | 92 bool checkIndexBound(size_t, ExceptionState&); |
92 | 93 |
93 Vector<String> m_values; | 94 Vector<String> m_values; |
94 }; | 95 }; |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
97 | 98 |
98 #endif // SVGStringList_h | 99 #endif // SVGStringList_h |
OLD | NEW |