bool SVGDocumentExtensions::sampleAnimationAtTime(const String& elementId, SVGSMILElement* element, double time) { ASSERT(element); SMILTimeContainer* container = element->timeContainer(); if (!container || container->isPaused()) return false; container->sampleAnimationAtTime(elementId, time); return true; }
void SVGDocumentExtensions::startAnimations() { // FIXME: Eventually every "Time Container" will need a way to latch on to some global timer // starting animations for a document will do this "latching" // FIXME: We hold a ref pointers to prevent a shadow tree from getting removed out from underneath us. // In the future we should refactor the use-element to avoid this. See https://webkit.org/b/53704 WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers; copyToVector(m_timeContainers, timeContainers); for (const auto& container : timeContainers) { SMILTimeContainer* timeContainer = container->timeContainer(); if (!timeContainer->isStarted()) timeContainer->begin(); } }
bool SVGDocumentExtensions::sampleAnimationAtTime(const String& elementId, SVGSMILElement* element, double time) { #if !ENABLE(SVG_ANIMATION) UNUSED_PARAM(elementId); UNUSED_PARAM(element); UNUSED_PARAM(time); return false; #else ASSERT(element); SMILTimeContainer* container = element->timeContainer(); if (!container || container->isPaused()) return false; container->sampleAnimationAtTime(elementId, time); return true; #endif }