#include "core/frame/FrameView.h"
#include "core/svg/graphics/SVGImage.h"
+#include "platform/ScriptForbiddenScope.h"
#include "platform/graphics/ImageObserver.h"
#include "wtf/CurrentTime.h"
-namespace WebCore {
+namespace blink {
static const double animationFrameDelay = 0.025;
void SVGImageChromeClient::animationTimerFired(Timer<SVGImageChromeClient>*)
{
- // In principle, we should call requestAnimationFrame callbacks here, but
- // we know there aren't any because script is forbidden inside SVGImages.
- if (m_image) {
- m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
- m_image->frameView()->updateLayoutAndStyleForPainting();
- }
+ if (!m_image)
+ return;
+ // serviceScriptedAnimations runs requestAnimationFrame callbacks, but SVG
+ // images can't have any so we assert there's no script.
+ ScriptForbiddenScope forbidScript;
+ m_image->frameView()->page()->animator().serviceScriptedAnimations(monotonicallyIncreasingTime());
+ m_image->frameView()->updateLayoutAndStyleForPainting();
}
}