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

Unified Diff: Source/core/rendering/RenderObject.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
« Source/core/css/resolver/StyleResolver.cpp ('K') | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 376a739140520cab245ee520d644e3c46b0efdc8..251c125da449391bde4c97df5798592fc2827ab1 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -30,6 +30,7 @@
#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "core/accessibility/AXObjectCache.h"
+#include "core/animation/ActiveAnimations.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/editing/EditingBoundary.h"
#include "core/editing/FrameSelection.h"
@@ -1725,10 +1726,18 @@ void RenderObject::handleDynamicFloatPositionChange()
void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)
{
- if (!isText() && style && !RuntimeEnabledFeatures::webAnimationsCSSEnabled())
- setStyle(animation()->updateAnimations(this, style.get()));
- else
+ if (!isText() && style) {
+ if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && node() && node()->isElementNode()) {
+ Element* element = toElement(node());
+ if (CSSAnimations::needsUpdate(element, style.get()))
+ element->ensureActiveAnimations()->cssAnimations()->update(element, style.get());
+ setStyle(style);
+ } else {
+ setStyle(animation()->updateAnimations(this, style.get()));
Steve Block 2013/08/06 03:57:01 Is this 'else' correct? Surely we never want to do
dstockwell 2013/08/06 05:43:25 Fixed.
+ }
+ } else {
setStyle(style);
+ }
}
StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsigned contextSensitiveProperties) const
« Source/core/css/resolver/StyleResolver.cpp ('K') | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698