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

Unified Diff: Source/core/dom/Element.cpp

Issue 21012002: Web Animations: Trigger and update CSS Animations backed by the Web Animations model (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix windows build. 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 7f381978a9a9c09bdf91da623a831f7d4f3fc282..35f2b930af3e75e5389ff44412b2f9d800801bb5 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -210,6 +210,11 @@ Element::~Element()
data->setPseudoElement(AFTER, 0);
data->setPseudoElement(BACKDROP, 0);
data->clearShadow();
+
+ if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()) {
+ if (ActiveAnimations* activeAnimations = data->activeAnimations())
+ activeAnimations->cssAnimations()->cancel();
+ }
}
if (isCustomElement())
@@ -1367,6 +1372,11 @@ void Element::detach(const AttachContext& context)
data->resetComputedStyle();
data->resetDynamicRestyleObservations();
data->setIsInsideRegion(false);
+
+ if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && !context.performingReattach) {
+ if (ActiveAnimations* activeAnimations = data->activeAnimations())
+ activeAnimations->cssAnimations()->cancel();
+ }
}
if (ElementShadow* shadow = this->shadow())
shadow->detach(context);
@@ -1474,9 +1484,9 @@ bool Element::recalcStyle(StyleChange change)
InspectorInstrumentation::didRecalculateStyleForElement(this);
if (RenderObject* renderer = this->renderer()) {
- if (localChange != NoChange || pseudoStyleCacheIsInvalid(currentStyle.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRecalcPropagation()) || shouldNotifyRendererWithIdenticalStyles())
+ if (localChange != NoChange || pseudoStyleCacheIsInvalid(currentStyle.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRecalcPropagation()) || shouldNotifyRendererWithIdenticalStyles()) {
renderer->setAnimatableStyle(newStyle.get());
- else if (needsStyleRecalc()) {
+ } else if (needsStyleRecalc()) {
// Although no change occurred, we use the new style so that the cousin style sharing code won't get
// fooled into believing this style is the same.
renderer->setStyleInternal(newStyle.get());

Powered by Google App Engine
This is Rietveld 408576698