| 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 14 matching lines...) Expand all Loading... |
| 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 SVGPath_h | 31 #ifndef SVGPath_h |
| 32 #define SVGPath_h | 32 #define SVGPath_h |
| 33 | 33 |
| 34 #include "core/css/CSSPathValue.h" | 34 #include "core/css/CSSPathValue.h" |
| 35 #include "core/svg/SVGParsingError.h" |
| 35 #include "core/svg/SVGPathByteStream.h" | 36 #include "core/svg/SVGPathByteStream.h" |
| 36 #include "core/svg/properties/SVGProperty.h" | 37 #include "core/svg/properties/SVGProperty.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class ExceptionState; | |
| 41 class Path; | |
| 42 | |
| 43 class SVGPath : public SVGPropertyBase { | 41 class SVGPath : public SVGPropertyBase { |
| 44 public: | 42 public: |
| 45 typedef void TearOffType; | 43 typedef void TearOffType; |
| 46 | 44 |
| 47 static PassRefPtrWillBeRawPtr<SVGPath> create() | 45 static PassRefPtrWillBeRawPtr<SVGPath> create() |
| 48 { | 46 { |
| 49 return adoptRefWillBeNoop(new SVGPath()); | 47 return adoptRefWillBeNoop(new SVGPath()); |
| 50 } | 48 } |
| 51 static PassRefPtrWillBeRawPtr<SVGPath> create(PassRefPtrWillBeRawPtr<CSSPath
Value> pathValue) | 49 static PassRefPtrWillBeRawPtr<SVGPath> create(PassRefPtrWillBeRawPtr<CSSPath
Value> pathValue) |
| 52 { | 50 { |
| 53 return adoptRefWillBeNoop(new SVGPath(pathValue)); | 51 return adoptRefWillBeNoop(new SVGPath(pathValue)); |
| 54 } | 52 } |
| 55 | 53 |
| 56 ~SVGPath() override; | 54 ~SVGPath() override; |
| 57 | 55 |
| 58 const SVGPathByteStream& byteStream() const { return m_pathValue->byteStream
(); } | 56 const SVGPathByteStream& byteStream() const { return m_pathValue->byteStream
(); } |
| 59 CSSPathValue* pathValue() const { return m_pathValue.get(); } | 57 CSSPathValue* pathValue() const { return m_pathValue.get(); } |
| 60 | 58 |
| 61 // SVGPropertyBase: | 59 // SVGPropertyBase: |
| 62 PassRefPtrWillBeRawPtr<SVGPath> clone() const; | 60 PassRefPtrWillBeRawPtr<SVGPath> clone() const; |
| 63 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con
st override; | 61 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con
st override; |
| 64 String valueAsString() const override; | 62 String valueAsString() const override; |
| 65 void setValueAsString(const String&, ExceptionState&); | 63 SVGParsingError setValueAsString(const String&); |
| 66 | 64 |
| 67 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 65 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
| 68 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; | 66 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; |
| 69 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; | 67 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; |
| 70 | 68 |
| 71 static AnimatedPropertyType classType() { return AnimatedPath; } | 69 static AnimatedPropertyType classType() { return AnimatedPath; } |
| 72 | 70 |
| 73 DECLARE_VIRTUAL_TRACE(); | 71 DECLARE_VIRTUAL_TRACE(); |
| 74 | 72 |
| 75 private: | 73 private: |
| 76 SVGPath(); | 74 SVGPath(); |
| 77 explicit SVGPath(PassRefPtrWillBeRawPtr<CSSPathValue>); | 75 explicit SVGPath(PassRefPtrWillBeRawPtr<CSSPathValue>); |
| 78 | 76 |
| 79 RefPtrWillBeMember<CSSPathValue> m_pathValue; | 77 RefPtrWillBeMember<CSSPathValue> m_pathValue; |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPath); | 80 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPath); |
| 83 | 81 |
| 84 } // namespace blink | 82 } // namespace blink |
| 85 | 83 |
| 86 #endif | 84 #endif |
| OLD | NEW |