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

Unified Diff: Source/core/animation/Animation.cpp

Issue 46043014: Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reinstate assert Created 7 years, 1 month 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/animation/Animation.cpp
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index 7e283213a67168f0e00910167375c54c745e33a2..73038bb43925fa239bdad2fd009d851a6794b420 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -62,11 +62,11 @@ static AnimationStack& ensureAnimationStack(Element* element)
return element->ensureActiveAnimations()->defaultStack();
}
-void Animation::applyEffects(bool previouslyInEffect)
+bool Animation::applyEffects(bool previouslyInEffect)
{
ASSERT(player());
if (!m_target || !m_effect)
- return;
+ return false;
if (!previouslyInEffect) {
ensureAnimationStack(m_target.get()).add(this);
@@ -75,6 +75,7 @@ void Animation::applyEffects(bool previouslyInEffect)
m_compositableValues = m_effect->sample(currentIteration(), timeFraction());
m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
+ return true;
}
void Animation::clearEffects()
@@ -87,15 +88,19 @@ void Animation::clearEffects()
m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
}
-void Animation::updateChildrenAndEffects() const
+bool Animation::updateChildrenAndEffects() const
{
if (!m_effect)
- return;
+ return false;
if (isInEffect())
- const_cast<Animation*>(this)->applyEffects(m_activeInAnimationStack);
- else if (m_activeInAnimationStack)
+ return const_cast<Animation*>(this)->applyEffects(m_activeInAnimationStack);
+
+ if (m_activeInAnimationStack) {
const_cast<Animation*>(this)->clearEffects();
+ return true;
+ }
+ return false;
}
double Animation::calculateTimeToEffectChange(double inheritedTime, double activeTime, Phase phase) const

Powered by Google App Engine
This is Rietveld 408576698