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

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

Issue 19266007: Web Animations: Introduce ActiveAnimations and AnimationStack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. 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 | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 5a19825381c5fdba3d64aa00c02bfffd820dfbb0..20dc97f347f486b1938243d03aa20841ca337a7e 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -35,6 +35,7 @@
#include "StylePropertyShorthand.h"
#include "core/animation/AnimatableValue.h"
#include "core/animation/Animation.h"
+#include "core/animation/DocumentTimeline.h"
#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSDefaultStyleSheets.h"
#include "core/css/CSSFontSelector.h"
@@ -980,17 +981,17 @@ PassRefPtr<CSSRuleList> StyleResolver::pseudoStyleRulesForElement(Element* e, Ps
// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
template <StyleResolver::StyleApplicationPass pass>
-void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Element* target)
+void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Element* target, const DocumentTimeline* timeline)
{
ASSERT(pass != VariableDefinitions);
ASSERT(pass != AnimationProperties);
- if (!target->hasActiveAnimations())
+ AnimationStack* animationStack = timeline->animationStack(target);
+ if (!animationStack)
return;
+ const Vector<Animation*>& animations = animationStack->activeAnimations(target);
- Vector<Animation*>* animations = target->activeAnimations();
-
- for (size_t i = 0; i < animations->size(); ++i) {
- RefPtr<Animation> animation = animations->at(i);
+ for (size_t i = 0; i < animations.size(); ++i) {
+ RefPtr<Animation> animation = animations.at(i);
const AnimationEffect::CompositableValueMap* compositableValues = animation->compositableValues();
for (AnimationEffect::CompositableValueMap::const_iterator iter = compositableValues->begin(); iter != compositableValues->end(); ++iter) {
CSSPropertyID property = iter->key;
@@ -1234,7 +1235,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
applyMatchedProperties<HighPriorityProperties>(state, matchResult, false, 0, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
// Animation contributions are processed here because CSS Animations are overridable by user !important rules.
if (RuntimeEnabledFeatures::webAnimationsEnabled())
- applyAnimatedProperties<HighPriorityProperties>(state, element);
+ applyAnimatedProperties<HighPriorityProperties>(state, element, element->document()->timeline());
applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
@@ -1264,7 +1265,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
// Now do the author and user normal priority properties and all the !important properties.
applyMatchedProperties<LowPriorityProperties>(state, matchResult, false, matchResult.ranges.lastUARule + 1, matchResult.matchedProperties.size() - 1, applyInheritedOnly);
if (RuntimeEnabledFeatures::webAnimationsEnabled())
- applyAnimatedProperties<LowPriorityProperties>(state, element);
+ applyAnimatedProperties<LowPriorityProperties>(state, element, element->document()->timeline());
applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698