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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 2010963003: Restart any animations when we allocate a composited layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove test due to flakiness. Created 4 years, 7 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 | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index 3f2989fa7c51c0b6cdee51c7037f4a815a8b0db6..58a1ff7a906827e2aca5ae432dd0daef1d512b24 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -27,6 +27,7 @@
#include "core/animation/AnimationTimeline.h"
#include "core/animation/DocumentAnimations.h"
+#include "core/animation/ElementAnimations.h"
#include "core/dom/DOMNodeIds.h"
#include "core/dom/Fullscreen.h"
#include "core/editing/FrameSelection.h"
@@ -457,6 +458,14 @@ void PaintLayerCompositor::updateIfNeeded()
InspectorInstrumentation::layerTreeDidChange(m_layoutView.frame());
}
+static void restartAnimationOnCompositor(const LayoutObject& layoutObject)
+{
+ Node* node = layoutObject.node();
+ ElementAnimations* elementAnimations = (node && node->isElementNode()) ? toElement(node)->elementAnimations() : nullptr;
+ if (elementAnimations)
+ elementAnimations->restartAnimationOnCompositor();
+}
+
bool PaintLayerCompositor::allocateOrClearCompositedLayerMapping(PaintLayer* layer, const CompositingStateTransitionType compositedLayerUpdate)
{
bool compositedLayerMappingChanged = false;
@@ -483,7 +492,9 @@ bool PaintLayerCompositor::allocateOrClearCompositedLayerMapping(PaintLayer* lay
layer->ensureCompositedLayerMapping();
compositedLayerMappingChanged = true;
- // At this time, the ScrollingCooridnator only supports the top-level frame.
+ restartAnimationOnCompositor(*layer->layoutObject());
+
+ // At this time, the ScrollingCoordinator only supports the top-level frame.
if (layer->isRootLayer() && m_layoutView.frame()->isLocalRoot()) {
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->frameViewRootLayerDidChange(m_layoutView.frameView());
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698