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

Side by Side Diff: Source/core/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h

Issue 19914002: Use toSVGPathElement() instead of static_cast<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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) Research In Motion Limited 2010, 2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010, 2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void animationEnded() 81 void animationEnded()
82 { 82 {
83 ASSERT(m_animatedPathByteStream); 83 ASSERT(m_animatedPathByteStream);
84 m_animatedPathByteStream = 0; 84 m_animatedPathByteStream = 0;
85 SVGAnimatedListPropertyTearOff<SVGPathSegList>::animationEnded(); 85 SVGAnimatedListPropertyTearOff<SVGPathSegList>::animationEnded();
86 } 86 }
87 87
88 void animValDidChange() 88 void animValDidChange()
89 { 89 {
90 ASSERT(m_animatedPathByteStream); 90 ASSERT(m_animatedPathByteStream);
91 SVGPathElement* pathElement = static_cast<SVGPathElement*>(contextElemen t()); 91 SVGPathElement* pathElement = toSVGPathElement(contextElement());
92 92
93 // If the animVal is observed from JS, we have to update it on each anim ation step. 93 // If the animVal is observed from JS, we have to update it on each anim ation step.
94 // This is an expensive operation and only done, if someone actually obs erves the animatedPathSegList() while an animation is running. 94 // This is an expensive operation and only done, if someone actually obs erves the animatedPathSegList() while an animation is running.
95 if (pathElement->isAnimValObserved()) { 95 if (pathElement->isAnimValObserved()) {
96 SVGPathSegList& animatedList = currentAnimatedValue(); 96 SVGPathSegList& animatedList = currentAnimatedValue();
97 animatedList.clear(); 97 animatedList.clear();
98 buildSVGPathSegListFromByteStream(m_animatedPathByteStream, pathElem ent, animatedList, UnalteredParsing); 98 buildSVGPathSegListFromByteStream(m_animatedPathByteStream, pathElem ent, animatedList, UnalteredParsing);
99 } 99 }
100 100
101 SVGAnimatedListPropertyTearOff<SVGPathSegList>::animValDidChange(); 101 SVGAnimatedListPropertyTearOff<SVGPathSegList>::animValDidChange();
102 } 102 }
103 103
104 SVGPathByteStream* animatedPathByteStream() const { return m_animatedPathByt eStream; } 104 SVGPathByteStream* animatedPathByteStream() const { return m_animatedPathByt eStream; }
105 105
106 private: 106 private:
107 SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const Qual ifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegL ist& values) 107 SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const Qual ifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegL ist& values)
108 : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attribu teName, animatedPropertyType, values) 108 : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attribu teName, animatedPropertyType, values)
109 , m_animatedPathByteStream(0) 109 , m_animatedPathByteStream(0)
110 { 110 {
111 } 111 }
112 112
113 SVGPathByteStream* m_animatedPathByteStream; 113 SVGPathByteStream* m_animatedPathByteStream;
114 }; 114 };
115 115
116 } 116 }
117 117
118 #endif // SVGAnimatedPathSegListPropertyTearOff_h 118 #endif // SVGAnimatedPathSegListPropertyTearOff_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698