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 15 matching lines...) Expand all Loading... |
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 SVGAnimatedNumberOptionalNumber_h | 31 #ifndef SVGAnimatedNumberOptionalNumber_h |
32 #define SVGAnimatedNumberOptionalNumber_h | 32 #define SVGAnimatedNumberOptionalNumber_h |
33 | 33 |
34 #include "core/svg/SVGAnimatedNumber.h" | 34 #include "core/svg/SVGAnimatedNumber.h" |
35 #include "core/svg/SVGNumberOptionalNumber.h" | 35 #include "core/svg/SVGNumberOptionalNumber.h" |
| 36 #include "platform/heap/Handle.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 // SVG Spec: http://www.w3.org/TR/SVG11/types.html <number-optional-number> | 40 // SVG Spec: http://www.w3.org/TR/SVG11/types.html <number-optional-number> |
40 // Unlike other SVGAnimated* class, this class is not exposed to Javascript dire
ctly, | 41 // Unlike other SVGAnimated* class, this class is not exposed to Javascript dire
ctly, |
41 // while DOM attribute and SMIL animations operate on this class. | 42 // while DOM attribute and SMIL animations operate on this class. |
42 // From Javascript, the two SVGAnimatedNumbers |firstNumber| and |secondNumber|
are used. | 43 // From Javascript, the two SVGAnimatedNumbers |firstNumber| and |secondNumber|
are used. |
43 // For example, see SVGFEDropShadowElement::stdDeviation{X,Y}() | 44 // For example, see SVGFEDropShadowElement::stdDeviation{X,Y}() |
44 class SVGAnimatedNumberOptionalNumber : public SVGAnimatedPropertyCommon<SVGNumb
erOptionalNumber> { | 45 class SVGAnimatedNumberOptionalNumber : public SVGAnimatedPropertyCommon<SVGNumb
erOptionalNumber> { |
45 public: | 46 public: |
46 static PassRefPtr<SVGAnimatedNumberOptionalNumber> create(SVGElement* contex
tElement, const QualifiedName& attributeName, float initialFirstValue = 0, float
initialSecondValue = 0) | 47 static PassRefPtrWillBeRawPtr<SVGAnimatedNumberOptionalNumber> create(SVGEle
ment* contextElement, const QualifiedName& attributeName, float initialFirstValu
e = 0, float initialSecondValue = 0) |
47 { | 48 { |
48 return adoptRef(new SVGAnimatedNumberOptionalNumber(contextElement, attr
ibuteName, initialFirstValue, initialSecondValue)); | 49 return adoptRefWillBeNoop(new SVGAnimatedNumberOptionalNumber(contextEle
ment, attributeName, initialFirstValue, initialSecondValue)); |
49 } | 50 } |
50 | 51 |
51 virtual void setAnimatedValue(PassRefPtr<SVGPropertyBase>) override; | 52 virtual void setAnimatedValue(PassRefPtrWillBeRawPtr<SVGPropertyBase>) overr
ide; |
52 virtual bool needsSynchronizeAttribute() override; | 53 virtual bool needsSynchronizeAttribute() override; |
53 virtual void animationEnded() override; | 54 virtual void animationEnded() override; |
54 | 55 |
55 SVGAnimatedNumber* firstNumber() { return m_firstNumber.get(); } | 56 SVGAnimatedNumber* firstNumber() { return m_firstNumber.get(); } |
56 SVGAnimatedNumber* secondNumber() { return m_secondNumber.get(); } | 57 SVGAnimatedNumber* secondNumber() { return m_secondNumber.get(); } |
57 | 58 |
| 59 virtual void trace(Visitor*) override; |
| 60 |
58 protected: | 61 protected: |
59 SVGAnimatedNumberOptionalNumber(SVGElement* contextElement, const QualifiedN
ame& attributeName, float initialFirstValue, float initialSecondValue); | 62 SVGAnimatedNumberOptionalNumber(SVGElement* contextElement, const QualifiedN
ame& attributeName, float initialFirstValue, float initialSecondValue); |
60 | 63 |
61 RefPtr<SVGAnimatedNumber> m_firstNumber; | 64 RefPtrWillBeMember<SVGAnimatedNumber> m_firstNumber; |
62 RefPtr<SVGAnimatedNumber> m_secondNumber; | 65 RefPtrWillBeMember<SVGAnimatedNumber> m_secondNumber; |
63 }; | 66 }; |
64 | 67 |
65 } // namespace blink | 68 } // namespace blink |
66 | 69 |
67 #endif // SVGAnimatedNumberOptionalNumber_h | 70 #endif // SVGAnimatedNumberOptionalNumber_h |
OLD | NEW |