gecko-dev/testing/web-platform/tests/animation-worklet/worklet-animation-with-scroll-timeline-and-display-none.https.html
Yi Gu da46e66a24 Bug 1534487 [wpt PR 15734] - Revert "[Animation Worklet] Remove unnecessary force composition", a=testonly
Automatic update from web-platform-tests
Revert "[Animation Worklet] Remove unnecessary force composition"

This reverts commit b9fdefc5712d3ec3b2482ad9c2af1c2e6fa6b25a.

Reason for revert: Removing compositing caused flaky on Mac

Original change's description:
> [Animation Worklet] Remove unnecessary force composition
>
> We used to have will-change: transform in test reference but they are
> no longer needed.
>
> Change-Id: Ib6870863760e32de201a0560fa59f43634c72da8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504711
> Commit-Queue: Yi Gu <yigu@chromium.org>
> Reviewed-by: Xida Chen <xidachen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#638107}

TBR=xidachen@chromium.org,yigu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1350b6c5e53e35fd0fb5de035e33c9f44528a4c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1510077
Reviewed-by: Yi Gu <yigu@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638867}

--

wpt-commits: 4371a004caa7771794a31109bc019e001799f8e2
wpt-pr: 15734
2019-04-01 14:43:07 +01:00

77 lines
No EOL
2.1 KiB
HTML

<html class="reftest-wait">
<title>Scroll timeline with WorkletAnimation and transition from display:none to display:block</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
<meta name="assert" content="Scroll timeline should properly handle going from display:none to display:block">
<link rel="match" href="worklet-animation-with-scroll-timeline-ref.html">
<script src="/web-animations/testcommon.js"></script>
<script src="/common/reftest-wait.js"></script>
<script src="common.js"></script>
<style>
#box {
width: 100px;
height: 100px;
background-color: green;
}
#covered {
width: 100px;
height: 100px;
background-color: red;
}
#scroller {
overflow: auto;
height: 100px;
width: 100px;
}
.removed {
display: none;
}
#contents {
height: 1000px;
width: 100%;
}
</style>
<div id="box"></div>
<div id="covered"></div>
<div id="scroller">
<div id="contents"></div>
</div>
<script>
registerPassthroughAnimator().then(()=>{
const box = document.getElementById('box');
const effect = new KeyframeEffect(box,
[
{ transform: 'translateY(0)', opacity: 1 },
{ transform: 'translateY(200px)', opacity: 0 }
], {
duration: 1000,
}
);
const scroller = document.getElementById('scroller');
scroller.classList.add('removed');
const timeline = new ScrollTimeline({ scrollSource: scroller, timeRange: 1000, orientation: 'block' });
const animation = new WorkletAnimation('passthrough', effect, timeline);
animation.play();
// Ensure that the WorkletAnimation will have been started on the compositor.
waitForAsyncAnimationFrames(1).then(_ => {
// Now return the scroller to the world, which will cause it to be composited
// and the animation should update on the compositor side.
scroller.classList.remove('removed');
const maxScroll = scroller.scrollHeight - scroller.clientHeight;
scroller.scrollTop = 0.5 * maxScroll;
waitForAsyncAnimationFrames(1).then(_ => {
takeScreenshot();
});
});
});
</script>