Index: Source/core/svg/animation/SVGSMILElement.cpp |
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp |
index c79205efa8d1ddae12bcac2561ba8e6803b2673a..85bd2a64f8a2a0bbfbb1479b61182ebc3c143bdc 100644 |
--- a/Source/core/svg/animation/SVGSMILElement.cpp |
+++ b/Source/core/svg/animation/SVGSMILElement.cpp |
@@ -51,6 +51,12 @@ static SMILEventSender& smilEndEventSender() |
return sender; |
} |
+static SMILEventSender& smilBeginEventSender() |
+{ |
+ DEFINE_STATIC_LOCAL(SMILEventSender, sender, ("beginEvent")); |
+ return sender; |
+} |
+ |
// This is used for duration type time values that can't be negative. |
static const double invalidCachedTime = -1.; |
@@ -141,6 +147,7 @@ SVGSMILElement::~SVGSMILElement() |
{ |
clearResourceReferences(); |
smilEndEventSender().cancelEvent(this); |
+ smilBeginEventSender().cancelEvent(this); |
disconnectConditions(); |
if (m_timeContainer && m_targetElement && hasValidAttributeName()) |
m_timeContainer->unschedule(this, m_targetElement, m_attributeName); |
@@ -1106,8 +1113,10 @@ bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b |
resetAnimatedType(); |
if (animationIsContributing) { |
- if (oldActiveState == Inactive) |
+ if (oldActiveState == Inactive) { |
+ smilBeginEventSender().dispatchEventSoon(this); |
startedActiveInterval(); |
+ } |
updateAnimation(percent, repeat, resultElement); |
m_lastPercent = percent; |
@@ -1123,6 +1132,8 @@ bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b |
// Triggering all the pending events if the animation timeline is changed. |
if (seekToTime) { |
+ if (m_activeState == Inactive) |
+ smilBeginEventSender().dispatchEventSoon(this); |
if (m_activeState == Inactive || m_activeState == Frozen) |
smilEndEventSender().dispatchEventSoon(this); |
} |
@@ -1205,7 +1216,7 @@ void SVGSMILElement::endedActiveInterval() |
void SVGSMILElement::dispatchPendingEvent(SMILEventSender* eventSender) |
{ |
- ASSERT(eventSender == &smilEndEventSender()); |
+ ASSERT(eventSender == &smilEndEventSender() || eventSender == &smilBeginEventSender()); |
const AtomicString& eventType = eventSender->eventType(); |
dispatchEvent(Event::create(eventType)); |
} |