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

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: Rebase harder 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
« no previous file with comments | « Source/core/svg/graphics/SVGImage.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..753839d7e0ecf1d8b8c2ac3f368974904d02da3f 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 permanently change the animation timeline.
+ // TODO(pdr): Actually advance the document timeline so CSS animations
+ // 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())) {
« no previous file with comments | « Source/core/svg/graphics/SVGImage.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698