| Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp | 
| diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp | 
| index 525ee8c9a0279b03e1184b6255214832ca2158ff..3c517888a90261e4c6958f506ea4c99a57c284ad 100644 | 
| --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp | 
| +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp | 
| @@ -63,6 +63,8 @@ namespace blink { | 
|  | 
| SVGImage::SVGImage(ImageObserver* observer) | 
| : Image(observer) | 
| +    , m_updatingAnimations(false) | 
| +    , m_resetAnimationAfterUpdate(false) | 
| { | 
| } | 
|  | 
| @@ -416,6 +418,11 @@ void SVGImage::stopAnimation() | 
|  | 
| void SVGImage::resetAnimation() | 
| { | 
| +    if (m_updatingAnimations) { | 
| +        m_resetAnimationAfterUpdate = true; | 
| +        return; | 
| +    } | 
| + | 
| SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 
| if (!rootElement) | 
| return; | 
| @@ -541,4 +548,29 @@ String SVGImage::filenameExtension() const | 
| return "svg"; | 
| } | 
|  | 
| +void SVGImage::leaveNoResetAnimationScope() | 
| +{ | 
| +    if (!m_updatingAnimations) { | 
| +        DCHECK(!m_resetAnimationAfterUpdate); | 
| +        return; | 
| +    } | 
| +    m_updatingAnimations = false; | 
| +    if (m_resetAnimationAfterUpdate) { | 
| +        m_resetAnimationAfterUpdate = false; | 
| +        resetAnimation(); | 
| +    } | 
| +} | 
| + | 
| +SVGImage::UpdateAnimationScope::UpdateAnimationScope(SVGImage* image) | 
| +    : m_image(image) | 
| +    , m_imageObserver(m_image->getImageObserver()) | 
| +{ | 
| +    m_image->enterNoResetAnimationsScope(); | 
| +} | 
| + | 
| +SVGImage::UpdateAnimationScope::~UpdateAnimationScope() | 
| +{ | 
| +    m_image->leaveNoResetAnimationScope(); | 
| +} | 
| + | 
| } // namespace blink | 
|  |