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

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

Issue 935973002: Clean up KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/KeyframeEffectModel.cpp
diff --git a/Source/core/animation/KeyframeEffectModel.cpp b/Source/core/animation/KeyframeEffectModel.cpp
index 71f7f059f169214b4657130dfe7e09ff749d9886..67972c8802dbedb95908e7bcddbc635e9b88a2ed 100644
--- a/Source/core/animation/KeyframeEffectModel.cpp
+++ b/Source/core/animation/KeyframeEffectModel.cpp
@@ -93,16 +93,16 @@ void KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI
ensureKeyframeGroups();
auto& keyframes = m_keyframeGroups->get(property)->m_keyframes;
-
ASSERT(keyframes.size() >= 2);
- ASSERT(!toStringPropertySpecificKeyframe(*keyframes[0]).value() || !toStringPropertySpecificKeyframe(*keyframes[keyframes.size() - 1]).value());
- if (!toStringPropertySpecificKeyframe(*keyframes.first()).value())
- toStringPropertySpecificKeyframe(*keyframes.first()).setAnimatableValue(value);
- if (!toStringPropertySpecificKeyframe(*keyframes.last()).value())
- toStringPropertySpecificKeyframe(*keyframes.last()).setAnimatableValue(value);
+ auto& first = toStringPropertySpecificKeyframe(*keyframes.first());
+ auto& last = toStringPropertySpecificKeyframe(*keyframes.last());
+ ASSERT(!first.value() || !last.value());
- // FIXME: Handle neutral keyframes that are not at 0% or 100%.
+ if (!first.value())
+ first.setAnimatableValue(value);
+ if (!last.value())
+ last.setAnimatableValue(value);
}
KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyframes(const KeyframeVector& keyframes)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698