| 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 SVGString_h | 31 #ifndef SVGString_h |
| 32 #define SVGString_h | 32 #define SVGString_h |
| 33 | 33 |
| 34 #include "core/svg/SVGParsingError.h" |
| 34 #include "core/svg/properties/SVGProperty.h" | 35 #include "core/svg/properties/SVGProperty.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class ExceptionState; | |
| 39 | |
| 40 class SVGString : public SVGPropertyBase { | 39 class SVGString : public SVGPropertyBase { |
| 41 public: | 40 public: |
| 42 // SVGString does not have a tear-off type. | 41 // SVGString does not have a tear-off type. |
| 43 typedef void TearOffType; | 42 typedef void TearOffType; |
| 44 typedef String PrimitiveType; | 43 typedef String PrimitiveType; |
| 45 | 44 |
| 46 static PassRefPtrWillBeRawPtr<SVGString> create() | 45 static PassRefPtrWillBeRawPtr<SVGString> create() |
| 47 { | 46 { |
| 48 return adoptRefWillBeNoop(new SVGString()); | 47 return adoptRefWillBeNoop(new SVGString()); |
| 49 } | 48 } |
| 50 | 49 |
| 51 static PassRefPtrWillBeRawPtr<SVGString> create(const String& value) | 50 static PassRefPtrWillBeRawPtr<SVGString> create(const String& value) |
| 52 { | 51 { |
| 53 return adoptRefWillBeNoop(new SVGString(value)); | 52 return adoptRefWillBeNoop(new SVGString(value)); |
| 54 } | 53 } |
| 55 | 54 |
| 56 PassRefPtrWillBeRawPtr<SVGString> clone() const { return create(m_value); } | 55 PassRefPtrWillBeRawPtr<SVGString> clone() const { return create(m_value); } |
| 57 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String& valu
e) const override | 56 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String& valu
e) const override |
| 58 { | 57 { |
| 59 return create(value); | 58 return create(value); |
| 60 } | 59 } |
| 61 | 60 |
| 62 String valueAsString() const override { return m_value; } | 61 String valueAsString() const override { return m_value; } |
| 63 void setValueAsString(const String& value, ExceptionState&) { m_value = valu
e; } | 62 SVGParsingError setValueAsString(const String& value) |
| 63 { |
| 64 m_value = value; |
| 65 return NoError; |
| 66 } |
| 64 | 67 |
| 65 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 68 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
| 66 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement*) override; | 69 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP
tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio
nValue, SVGElement*) override; |
| 67 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; | 70 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; |
| 68 | 71 |
| 69 const String& value() const { return m_value; } | 72 const String& value() const { return m_value; } |
| 70 void setValue(const String& value) { m_value = value; } | 73 void setValue(const String& value) { m_value = value; } |
| 71 | 74 |
| 72 static AnimatedPropertyType classType() { return AnimatedString; } | 75 static AnimatedPropertyType classType() { return AnimatedString; } |
| 73 | 76 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 84 } | 87 } |
| 85 | 88 |
| 86 String m_value; | 89 String m_value; |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGString); | 92 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGString); |
| 90 | 93 |
| 91 } // namespace blink | 94 } // namespace blink |
| 92 | 95 |
| 93 #endif // SVGString_h | 96 #endif // SVGString_h |
| OLD | NEW |