Skip to content

Commit a11d55a

Browse files
BorisChioumoz-wptsync-bot
authored andcommitted
Handle zero range for scroll-driven animations on the compositor thread.
It is possible to get a zero range from APZ sampler (e.g. see the test in this patch), so we have to early return it. Differential Revision: https://phabricator.services.mozilla.com/D275732 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1919415 gecko-commit: 08f98baa10e636695ce3aca42c346a6f19638e29 gecko-reviewers: hiro, layout-reviewers
1 parent f618291 commit a11d55a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html class="test-wait">
3+
<title>This test passes if it does not crash when resizing the scroller</title>
4+
<link rel="help" src="https://drafts.csswg.org/scroll-animations-1/">
5+
<script src="/web-animations/testcommon.js"></script>
6+
<style>
7+
@keyframes scrolling {
8+
from, to { background: lightblue; }
9+
}
10+
#box {
11+
width: 200px;
12+
height: 50px;
13+
overflow: auto;
14+
animation: scrolling;
15+
animation-timeline: scroll(self);
16+
}
17+
</style>
18+
<body onload="run()">
19+
<div id="box">
20+
<h3>Resize this box!</h3>
21+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer finibus elit sed ultricies semper. Proin faucibus sollicitudin nisi, id pellentesque lectus iaculis id.</p>
22+
</div>
23+
</body>
24+
<script>
25+
async function run() {
26+
let anims = document.getAnimations();
27+
await anims[0].ready;
28+
// Wait for some frames to wait for the setup of compositor animations.
29+
await waitForAnimationFrames(2);
30+
box.style.height = "200px";
31+
await waitForAnimationFrames(2);
32+
document.documentElement.className = "";
33+
}
34+
</script>

0 commit comments

Comments
 (0)