Commit d552263c authored by kouhei@chromium.org's avatar kouhei@chromium.org

SVG: Remove&inline |invokeMethodOnAllTargetProperties|

|invokeMethodOnAllTargetProperties| is now only used from |endAnimation|.
The code is more readable when inlined.

BUG=378670

Review URL: https://codereview.chromium.org/305033004

git-svn-id: svn://svn.chromium.org/blink/trunk@175125 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c591f214
...@@ -156,19 +156,6 @@ void SVGAnimatedTypeAnimator::calculateFromAndByValues(RefPtr<SVGPropertyBase>& ...@@ -156,19 +156,6 @@ void SVGAnimatedTypeAnimator::calculateFromAndByValues(RefPtr<SVGPropertyBase>&
namespace { namespace {
typedef void (SVGAnimatedPropertyBase::*SVGAnimatedPropertyMethod)();
void invokeMethodOnAllTargetProperties(const WillBeHeapVector<RawPtrWillBeMember<SVGElement> >& list, const QualifiedName& attributeName, SVGAnimatedPropertyMethod method)
{
WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator it = list.begin();
WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator itEnd = list.end();
for (; it != itEnd; ++it) {
RefPtr<SVGAnimatedPropertyBase> animatedProperty = (*it)->propertyFromAttribute(attributeName);
if (animatedProperty)
(animatedProperty.get()->*method)();
}
}
void setAnimatedValueOnAllTargetProperties(const WillBeHeapVector<RawPtrWillBeMember<SVGElement> >& list, const QualifiedName& attributeName, PassRefPtr<SVGPropertyBase> passValue) void setAnimatedValueOnAllTargetProperties(const WillBeHeapVector<RawPtrWillBeMember<SVGElement> >& list, const QualifiedName& attributeName, PassRefPtr<SVGPropertyBase> passValue)
{ {
RefPtr<SVGPropertyBase> value = passValue; RefPtr<SVGPropertyBase> value = passValue;
...@@ -207,7 +194,13 @@ void SVGAnimatedTypeAnimator::stopAnimValAnimation(const WillBeHeapVector<RawPtr ...@@ -207,7 +194,13 @@ void SVGAnimatedTypeAnimator::stopAnimValAnimation(const WillBeHeapVector<RawPtr
ASSERT(isAnimatingSVGDom()); ASSERT(isAnimatingSVGDom());
SVGElement::InstanceUpdateBlocker blocker(m_contextElement); SVGElement::InstanceUpdateBlocker blocker(m_contextElement);
invokeMethodOnAllTargetProperties(list, m_animatedProperty->attributeName(), &SVGAnimatedPropertyBase::animationEnded); WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator it = list.begin();
WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator itEnd = list.end();
for (; it != itEnd; ++it) {
RefPtr<SVGAnimatedPropertyBase> animatedProperty = (*it)->propertyFromAttribute(m_animatedProperty->attributeName());
if (animatedProperty)
animatedProperty->animationEnded();
}
} }
PassRefPtr<SVGPropertyBase> SVGAnimatedTypeAnimator::resetAnimValToBaseVal(const WillBeHeapVector<RawPtrWillBeMember<SVGElement> >& list) PassRefPtr<SVGPropertyBase> SVGAnimatedTypeAnimator::resetAnimValToBaseVal(const WillBeHeapVector<RawPtrWillBeMember<SVGElement> >& list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment