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

Unified Diff: Source/WebCore/svg/animation/SVGSMILElement.cpp

Issue 9569016: Merge 108134 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/animation/SVGSMILElement.cpp
===================================================================
--- Source/WebCore/svg/animation/SVGSMILElement.cpp (revision 109359)
+++ Source/WebCore/svg/animation/SVGSMILElement.cpp (working copy)
@@ -513,17 +513,32 @@
ContainerNode* target = href.isEmpty() ? parentNode() : SVGURIReference::targetElementFromIRIString(href, document());
if (!target || !target->isSVGElement())
return 0;
-
+
m_targetElement = static_cast<SVGElement*>(target);
document()->accessSVGExtensions()->addAnimationElementToTarget(this, m_targetElement);
+
+ targetElementDidChange(m_targetElement);
+
return m_targetElement;
}
-SMILTime SVGSMILElement::elapsed() const
+void SVGSMILElement::resetTargetElement()
{
+ m_targetElement = 0;
+
+ // Force the animation to recompute values that are only calculated when an animation becomes active.
+ // Failing to do this means that a target reset and change during active animation may result in
+ // invalid state.
+ m_activeState = Inactive;
+
+ targetElementDidChange(0);
+}
+
+SMILTime SVGSMILElement::elapsed() const
+{
return m_timeContainer ? m_timeContainer->elapsed() : 0;
-}
-
+}
+
bool SVGSMILElement::isInactive() const
{
return m_activeState == Inactive;
« no previous file with comments | « Source/WebCore/svg/animation/SVGSMILElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698