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

Unified Diff: Source/core/svg/animation/SVGSMILElement.cpp

Issue 19946002: [SVG] Handle animation freeze when 'repeatDur' is not a multiple of 'dur' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 | « LayoutTests/svg/animations/script-tests/animate-fill-freeze-with-repeatDur.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SVGSMILElement.cpp
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index b5fdb07a90989cedd5fdaa9f87670f30f427d0c1..b84205a95ed9eb8f7a5adc1f246e7e84a17ed50e 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -1001,7 +1001,9 @@ float SVGSMILElement::calculateAnimationPercentAndRepeat(SMILTime elapsed, unsig
SMILTime activeTime = elapsed - m_intervalBegin;
SMILTime repeatingDuration = this->repeatingDuration();
if (elapsed >= m_intervalEnd || activeTime > repeatingDuration) {
- repeat = static_cast<unsigned>(repeatingDuration.value() / simpleDuration.value()) - 1;
+ repeat = static_cast<unsigned>(repeatingDuration.value() / simpleDuration.value());
+ if (!fmod(repeatingDuration.value(), simpleDuration.value()))
+ repeat--;
double percent = (m_intervalEnd.value() - m_intervalBegin.value()) / simpleDuration.value();
percent = percent - floor(percent);
« no previous file with comments | « LayoutTests/svg/animations/script-tests/animate-fill-freeze-with-repeatDur.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698