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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 1329843002: Support per property CSS Animation stacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comments 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
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 7f0c7acb3afa822111d5783cfd2c9f3b8bf1eccf..73f5b530e8c60123413ac6b7f2b47b8d6bf02138 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -35,6 +35,7 @@
#include "core/StylePropertyShorthand.h"
#include "core/animation/AnimationTimeline.h"
#include "core/animation/ElementAnimations.h"
+#include "core/animation/InvalidatableStyleInterpolation.h"
#include "core/animation/KeyframeEffect.h"
#include "core/animation/StyleInterpolation.h"
#include "core/animation/animatable/AnimatableValue.h"
@@ -959,15 +960,15 @@ bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Ele
state.setApplyPropertyToVisitedLinkStyle(true);
}
- const ActiveInterpolationMap& activeInterpolationsForAnimations = state.animationUpdate().activeInterpolationsForAnimations();
- const ActiveInterpolationMap& activeInterpolationsForTransitions = state.animationUpdate().activeInterpolationsForTransitions();
- applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsForAnimations);
- applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsForTransitions);
+ const ActiveInterpolationsMap& activeInterpolationsMapForAnimations = state.animationUpdate().activeInterpolationsForAnimations();
+ const ActiveInterpolationsMap& activeInterpolationsMapForTransitions = state.animationUpdate().activeInterpolationsForTransitions();
+ applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsMapForAnimations);
+ applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsMapForTransitions);
updateFont(state);
- applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsForAnimations);
- applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsForTransitions);
+ applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsMapForAnimations);
+ applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsMapForTransitions);
// Start loading resources used by animations.
loadPendingResources(state);
@@ -1009,16 +1010,19 @@ StyleRuleKeyframes* StyleResolver::findKeyframesRule(const Element* element, con
}
template <CSSPropertyPriority priority>
-void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const HashMap<PropertyHandle, RefPtr<Interpolation>>& activeInterpolations)
+void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const ActiveInterpolationsMap& activeInterpolationsMap)
{
- for (const auto& interpolationEntry : activeInterpolations) {
- if (!interpolationEntry.key.isCSSProperty())
+ for (const auto& interpolationsVectorEntry : activeInterpolationsMap) {
+ if (!interpolationsVectorEntry.key.isCSSProperty())
continue;
- CSSPropertyID property = interpolationEntry.key.cssProperty();
+ CSSPropertyID property = interpolationsVectorEntry.key.cssProperty();
if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property))
continue;
- const StyleInterpolation* interpolation = toStyleInterpolation(interpolationEntry.value.get());
- interpolation->apply(state);
+ const Interpolation& interpolation = *interpolationsVectorEntry.value.first();
+ if (interpolation.isInvalidatableStyleInterpolation())
+ InvalidatableStyleInterpolation::applyStack(interpolationsVectorEntry.value, state);
+ else
+ toStyleInterpolation(interpolation).apply(state);
}
}

Powered by Google App Engine
This is Rietveld 408576698