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

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: Rebase and rename hasActiveAnimationOnCompositor to hasActiveAnimationsOnCompositor 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 5f37acf43383dd249aca76f37987bd19da1df0be..040126d7cf190eafce0188ed5829b02ed42bd02f 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->hasActiveAnimationsOnCompositor(propertyID))
+ document.serviceAnimations(monotonicallyIncreasingTime());
+ }
+ }
+
document.updateStyleForNodeIfNeeded(styledNode);
// The style recalc could have caused the styled node to be discarded or replaced
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698