From c1fc73bb2dab785657921e0d9d9694259d94ddb9 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 7 Jun 2018 09:30:33 +0900 Subject: [PATCH] Bug 1253164 - Make nsIFrame allow running async animations once the frame is able able to run animations on the compositor again. r=birtles For example, we don't run transform animations on large frames but once the frame size is small enough we should run transform animations on the frame. MozReview-Commit-ID: DkfB9g2Gcdi --HG-- extra : rebase_source : 93a884c3063d4a6c2626e6695583664b24fe11c8 --- .../test/chrome/test_animation_performance_warning.html | 6 ++---- layout/painting/nsDisplayList.cpp | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dom/animation/test/chrome/test_animation_performance_warning.html b/dom/animation/test/chrome/test_animation_performance_warning.html index 5acda77925d7..a7a393c5cf56 100644 --- a/dom/animation/test/chrome/test_animation_performance_warning.html +++ b/dom/animation/test/chrome/test_animation_performance_warning.html @@ -1195,10 +1195,9 @@ function start() { animation.effect.target.style = 'width: 100px; height: 100px'; return waitForFrame(); }).then(() => { - // FIXME: Bug 1253164: the animation should get back on compositor. assert_animation_property_state_equals( animation.effect.getProperties(), - [ { property: 'transform', runningOnCompositor: false } ]); + [ { property: 'transform', runningOnCompositor: true } ]); }); }, 'transform on too big element - area'); @@ -1231,10 +1230,9 @@ function start() { animation.effect.target.style = 'width: 100px; height: 100px'; return waitForFrame(); }).then(() => { - // FIXME: Bug 1253164: the animation should get back on compositor. assert_animation_property_state_equals( animation.effect.getProperties(), - [ { property: 'transform', runningOnCompositor: false } ]); + [ { property: 'transform', runningOnCompositor: true } ]); }); }, 'transform on too big element - dimensions'); diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index e55a184e54cd..7c4429feb2a7 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -8724,6 +8724,10 @@ already_AddRefed nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu container->SetContentFlags(container->GetContentFlags() & ~Layer::CONTENT_EXTEND_3D_CONTEXT); } + if (mAllowAsyncAnimation) { + mFrame->SetProperty(nsIFrame::RefusedAsyncAnimationProperty(), false); + } + nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder, this, mFrame, eCSSProperty_transform);