Skip to content

Commit e945386

Browse files
mattgperryclaude
andcommitted
Keep the timeline running on the drag-animate test page
Headless WebKit stops the document timeline while nothing requests a frame. x/y animations now run on WAAPI, so a 4s animate() froze a few pixels in, and the drag then stopped it at a different value from the one on screen. A plain element.animate() freezes the same way, so this is the test browser, not Motion. A rAF loop keeps the timeline running, as a browser with a display does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 625e6af commit e945386

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎dev/html/public/playwright/gestures/drag-animate.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939

4040
window.events = []
4141

42+
// Headless WebKit stops the document timeline while nothing
43+
// requests a frame, which freezes WAAPI animations like x/y.
44+
// A browser with a display keeps it running, so keep it running
45+
// here too.
46+
const tick = () => requestAnimationFrame(tick)
47+
tick()
48+
4249
// Where the box was when the pointer went down, before drag's
4350
// own pointerdown listener runs
4451
window.addEventListener(

0 commit comments

Comments
 (0)