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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup isRunning* and shouldCompositeForAnimation Created 7 years, 1 month 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/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 164c4a0f5161b28691e68dfdff265f690c0d53af..b4ef9fe2b0bb25150287407e8f0c7bbd70fc6c97 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -29,6 +29,9 @@
#include "RuntimeEnabledFeatures.h"
#include "StylePropertyShorthand.h"
#include "bindings/v8/ExceptionState.h"
+#include "core/animation/ActiveAnimations.h"
+#include "core/animation/AnimationClock.h"
+#include "core/animation/DocumentTimeline.h"
#include "core/css/BasicShapeFunctions.h"
#include "core/css/CSSArrayFunctionValue.h"
#include "core/css/CSSAspectRatioValue.h"
@@ -1620,6 +1623,16 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
if (updateLayout) {
Document& document = styledNode->document();
+ // If a compositor animation is running we may need to service animations
+ // in order to generate an up to date value.
+ if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && styledNode->isElementNode()) {
+ const Element* element = toElement(styledNode);
+ if (const ActiveAnimations* activeAnimations = element->activeAnimations()) {
+ if (activeAnimations->isRunningCompositorAnimation(propertyID))
+ document.serviceAnimations(monotonicallyIncreasingTime());
+ }
+ }
+
document.updateStyleForNodeIfNeeded(styledNode);
// The style recalc could have caused the styled node to be discarded or replaced

Powered by Google App Engine
This is Rietveld 408576698