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 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
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 #include "config.h" | 31 #include "config.h" |
32 #include "core/svg/properties/NewSVGAnimatedProperty.h" | 32 #include "core/svg/properties/SVGAnimatedProperty.h" |
33 | 33 |
34 #include "core/svg/SVGElement.h" | 34 #include "core/svg/SVGElement.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 NewSVGAnimatedPropertyBase::NewSVGAnimatedPropertyBase(AnimatedPropertyType type
, SVGElement* contextElement, const QualifiedName& attributeName) | 38 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase(AnimatedPropertyType type, SVGE
lement* contextElement, const QualifiedName& attributeName) |
39 : m_type(type) | 39 : m_type(type) |
40 , m_isReadOnly(false) | 40 , m_isReadOnly(false) |
41 , m_isAnimating(false) | 41 , m_isAnimating(false) |
42 , m_contextElement(contextElement) | 42 , m_contextElement(contextElement) |
43 , m_attributeName(attributeName) | 43 , m_attributeName(attributeName) |
44 { | 44 { |
45 ASSERT(m_contextElement); | 45 ASSERT(m_contextElement); |
46 ASSERT(m_attributeName != nullQName()); | 46 ASSERT(m_attributeName != nullQName()); |
47 // FIXME: setContextElement should be delayed until V8 wrapper is created. | 47 // FIXME: setContextElement should be delayed until V8 wrapper is created. |
48 // FIXME: oilpan: or we can remove this backref ptr hack in oilpan. | 48 // FIXME: oilpan: or we can remove this backref ptr hack in oilpan. |
49 m_contextElement->setContextElement(); | 49 m_contextElement->setContextElement(); |
50 } | 50 } |
51 | 51 |
52 NewSVGAnimatedPropertyBase::~NewSVGAnimatedPropertyBase() | 52 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() |
53 { | 53 { |
54 ASSERT(!isAnimating()); | 54 ASSERT(!isAnimating()); |
55 } | 55 } |
56 | 56 |
57 void NewSVGAnimatedPropertyBase::animationStarted() | 57 void SVGAnimatedPropertyBase::animationStarted() |
58 { | 58 { |
59 ASSERT(!isAnimating()); | 59 ASSERT(!isAnimating()); |
60 m_isAnimating = true; | 60 m_isAnimating = true; |
61 } | 61 } |
62 | 62 |
63 void NewSVGAnimatedPropertyBase::animationEnded() | 63 void SVGAnimatedPropertyBase::animationEnded() |
64 { | 64 { |
65 ASSERT(isAnimating()); | 65 ASSERT(isAnimating()); |
66 m_isAnimating = false; | 66 m_isAnimating = false; |
67 } | 67 } |
68 | 68 |
69 void NewSVGAnimatedPropertyBase::synchronizeAttribute() | 69 void SVGAnimatedPropertyBase::synchronizeAttribute() |
70 { | 70 { |
71 ASSERT(needsSynchronizeAttribute()); | 71 ASSERT(needsSynchronizeAttribute()); |
72 AtomicString value(currentValueBase()->valueAsString()); | 72 AtomicString value(currentValueBase()->valueAsString()); |
73 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); | 73 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); |
74 } | 74 } |
75 | 75 |
76 bool NewSVGAnimatedPropertyBase::isSpecified() const | 76 bool SVGAnimatedPropertyBase::isSpecified() const |
77 { | 77 { |
78 return isAnimating() || contextElement()->hasAttribute(attributeName()); | 78 return isAnimating() || contextElement()->hasAttribute(attributeName()); |
79 } | 79 } |
80 | 80 |
81 void NewSVGAnimatedPropertyBase::commitChange() | 81 void SVGAnimatedPropertyBase::commitChange() |
82 { | 82 { |
83 contextElement()->invalidateSVGAttributes(); | 83 contextElement()->invalidateSVGAttributes(); |
84 contextElement()->svgAttributeChanged(m_attributeName); | 84 contextElement()->svgAttributeChanged(m_attributeName); |
85 } | 85 } |
86 | 86 |
87 } // namespace WebCore | 87 } // namespace WebCore |
OLD | NEW |