| Index: Source/core/svg/SVGSVGElement.cpp
|
| diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
|
| index 8fb720631d075ff2bfd1a2bb75339d4d6d72c7b9..d19cfd1613192c3043cf2f8cb3f9e8f218f3caa8 100644
|
| --- a/Source/core/svg/SVGSVGElement.cpp
|
| +++ b/Source/core/svg/SVGSVGElement.cpp
|
| @@ -554,13 +554,15 @@ Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro
|
| if (rootParent->document().isXMLDocument())
|
| UseCounter::count(document(), UseCounter::SVGSVGElementInXMLDocument);
|
|
|
| - document().accessSVGExtensions().addTimeContainer(this);
|
| -
|
| - // Animations are started at the end of document parsing and after firing the load event,
|
| - // but if we miss that train (deferred programmatic element insertion for example) we need
|
| - // to initialize the time container here.
|
| - if (!document().parsing() && !document().processingLoadEvent() && document().loadEventFinished() && !timeContainer()->isStarted())
|
| - timeContainer()->begin();
|
| + if (RuntimeEnabledFeatures::sMILEnabled()) {
|
| + document().accessSVGExtensions().addTimeContainer(this);
|
| +
|
| + // Animations are started at the end of document parsing and after firing the load event,
|
| + // but if we miss that train (deferred programmatic element insertion for example) we need
|
| + // to initialize the time container here.
|
| + if (!document().parsing() && !document().processingLoadEvent() && document().loadEventFinished() && !timeContainer()->isStarted())
|
| + timeContainer()->begin();
|
| + }
|
| }
|
| return SVGGraphicsElement::insertedInto(rootParent);
|
| }
|
| @@ -578,28 +580,33 @@ void SVGSVGElement::removedFrom(ContainerNode* rootParent)
|
|
|
| void SVGSVGElement::pauseAnimations()
|
| {
|
| + ASSERT(RuntimeEnabledFeatures::sMILEnabled());
|
| if (!m_timeContainer->isPaused())
|
| m_timeContainer->pause();
|
| }
|
|
|
| void SVGSVGElement::unpauseAnimations()
|
| {
|
| + ASSERT(RuntimeEnabledFeatures::sMILEnabled());
|
| if (m_timeContainer->isPaused())
|
| m_timeContainer->resume();
|
| }
|
|
|
| bool SVGSVGElement::animationsPaused() const
|
| {
|
| + ASSERT(RuntimeEnabledFeatures::sMILEnabled());
|
| return m_timeContainer->isPaused();
|
| }
|
|
|
| float SVGSVGElement::getCurrentTime() const
|
| {
|
| + ASSERT(RuntimeEnabledFeatures::sMILEnabled());
|
| return narrowPrecisionToFloat(m_timeContainer->elapsed().value());
|
| }
|
|
|
| void SVGSVGElement::setCurrentTime(float seconds)
|
| {
|
| + ASSERT(RuntimeEnabledFeatures::sMILEnabled());
|
| ASSERT(std::isfinite(seconds));
|
| seconds = max(seconds, 0.0f);
|
| m_timeContainer->setElapsed(seconds);
|
|
|