Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index ca2cc3f6bb3804707b77e8066bb8aa936231ba70..4eece5f8640c22ca445bf53d48ec562c02656414 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -395,6 +395,20 @@ bool SVGImage::hasAnimations() const
return rootElement->timeContainer()->hasAnimations() || toLocalFrame(m_page->mainFrame())->document()->timeline().hasPendingUpdates();
}
+void SVGImage::advanceAnimationForTesting()
+{
+ if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) {
+ rootElement->timeContainer()->advanceFrameForTesting();
+
+ // The following triggers animation updates which can issue a new draw
+ // but will not perminately change the animation timeline.
fs 2015/09/08 14:50:57 s/perminately/permanently/ ?
pdr. 2015/09/08 22:50:37 Nice catch. Fixed.
+ // TODO(pdr): Actually advance the document timeline so CSS animations
fs 2015/09/08 14:50:57 Doing this would also "advance" the SMILTimeContai
+ // can be properly tested.
+ rootElement->document().page()->animator().serviceScriptedAnimations(rootElement->getCurrentTime());
+ imageObserver()->animationAdvanced(this);
+ }
+}
+
void SVGImage::updateUseCounters(Document& document) const
{
if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) {

Powered by Google App Engine
This is Rietveld 408576698