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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutProgress.cpp

Issue 1721943002: Don't animate a progress bar if it isn't animated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/core/layout/LayoutProgress.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutProgress.cpp b/third_party/WebKit/Source/core/layout/LayoutProgress.cpp
index 5b2c45cf7b105c6d8d61788b09b3473ac276dcad..f9391543397bd5deefbc0cf123b33310d32ab546 100644
--- a/third_party/WebKit/Source/core/layout/LayoutProgress.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutProgress.cpp
@@ -74,6 +74,11 @@ bool LayoutProgress::isDeterminate() const
&& HTMLProgressElement::InvalidPosition != position());
}
+bool LayoutProgress::isAnimationTimerActive() const
+{
+ return m_animationTimer.isActive();
Xianzhu 2016/02/22 23:17:27 Nit: Can you use m_animating (and rename this func
Stephen Chennney 2016/02/23 19:24:01 I would rather check the timer itself, as that wil
+}
+
void LayoutProgress::animationTimerFired(Timer<LayoutProgress>*)
{
setShouldDoFullPaintInvalidation();
@@ -86,7 +91,7 @@ void LayoutProgress::updateAnimationState()
m_animationDuration = LayoutTheme::theme().animationDurationForProgressBar();
m_animationRepeatInterval = LayoutTheme::theme().animationRepeatIntervalForProgressBar();
- bool animating = style()->hasAppearance() && m_animationDuration > 0;
+ bool animating = !isDeterminate() && style()->hasAppearance() && m_animationDuration > 0;
if (animating == m_animating)
return;

Powered by Google App Engine
This is Rietveld 408576698