Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: Source/core/animation/AnimatableShadow.h

Issue 38823002: Web Animations CSS: Support animation of {text,box,-webkit-box}-shadow and fix blur clamping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
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 #ifndef AnimatableSVGLength_h 31 #ifndef AnimatableShadow_h
32 #define AnimatableSVGLength_h 32 #define AnimatableShadow_h
33 33
34 #include "core/animation/AnimatableValue.h" 34 #include "core/animation/AnimatableValue.h"
35 #include "core/svg/SVGLength.h" 35 #include "core/rendering/style/ShadowList.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 class AnimatableSVGLength: public AnimatableValue { 39 class AnimatableShadow : public AnimatableValue {
40 public: 40 public:
41 virtual ~AnimatableSVGLength() { } 41 virtual ~AnimatableShadow() { }
42 42 static PassRefPtr<AnimatableShadow> create(PassRefPtr<ShadowList> shadowList )
43 static PassRefPtr<AnimatableSVGLength> create(const SVGLength& length)
44 { 43 {
45 return adoptRef(new AnimatableSVGLength(length)); 44 return adoptRef(new AnimatableShadow(shadowList));
46 } 45 }
47 46 ShadowList* shadowList() const { return m_shadowList.get(); }
48 const SVGLength& toSVGLength() const
49 {
50 return m_length;
51 }
52 47
53 protected: 48 protected:
54 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE; 49 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE;
55 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE; 50 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE;
56 51
57 private: 52 private:
58 AnimatableSVGLength(const SVGLength& length) 53 explicit AnimatableShadow(PassRefPtr<ShadowList> shadowList)
59 : m_length(length) 54 : m_shadowList(shadowList)
60 { 55 {
61 } 56 }
62 57 virtual AnimatableType type() const OVERRIDE { return TypeShadow; }
63 virtual AnimatableType type() const { return TypeSVGLength; }
64 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; 58 virtual bool equalTo(const AnimatableValue*) const OVERRIDE;
65 59
66 SVGLength m_length; 60 const RefPtr<ShadowList> m_shadowList;
mithro-old 2013/10/24 01:04:16 Why const?
Timothy Loh 2013/10/24 03:04:54 It doesn't change. Probably the better question is
67 }; 61 };
68 62
69 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableSVGLength, isSVGLength()); 63 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableShadow, isShadow());
70 64
71 } // namespace WebCore 65 } // namespace WebCore
72 66
73 #endif // AnimatableSVGLength_h 67 #endif // AnimatableShadow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698