Index: Source/core/svg/graphics/SVGImage.cpp |
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp |
index 50112683e71a9d0dd6f2553cb5ca3a8d7de991af..02ee9054b96882c98f6f853f4c7e5216310a3dfb 100644 |
--- a/Source/core/svg/graphics/SVGImage.cpp |
+++ b/Source/core/svg/graphics/SVGImage.cpp |
@@ -282,6 +282,8 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl |
if (imageObserver()) |
imageObserver()->didDraw(this); |
+ |
+ startAnimation(); |
kouhei (in TOK)
2014/03/20 15:27:29
This line took me a while to understand. This call
fs
2014/03/20 17:02:17
Added a comment to that effect.
|
} |
RenderBox* SVGImage::embeddedContentBox() const |
@@ -351,10 +353,9 @@ void SVGImage::startAnimation(bool /* catchUpIfNecessary */) |
return; |
LocalFrame* frame = m_page->mainFrame(); |
SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement(); |
- if (!rootElement) |
+ if (!rootElement || !rootElement->animationsPaused()) |
return; |
rootElement->unpauseAnimations(); |
- rootElement->setCurrentTime(0); |
} |
void SVGImage::stopAnimation() |
@@ -370,7 +371,14 @@ void SVGImage::stopAnimation() |
void SVGImage::resetAnimation() |
{ |
- stopAnimation(); |
+ if (!m_page) |
+ return; |
+ LocalFrame* frame = m_page->mainFrame(); |
+ SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement(); |
+ if (!rootElement) |
+ return; |
+ rootElement->pauseAnimations(); |
+ rootElement->setCurrentTime(0); |
} |
bool SVGImage::hasAnimations() const |