Skip to content

Truly independent web browser

986 B
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="frame-in-flight.js"></script>
<div id="box" style="width: 10px; height: 0px; background: green"></div>
<script>
    // Script that changes an animation beside the lane of the presented frame parks the lane's animations: the lane ticked
    // them as the last rendering update planned them.
    asyncTest(async done => {
        const result = await whileLaneAnimates(() => {
            return box.animate([{ height: "0px" }, { height: "100px" }], { duration: 10000, easing: "linear" });
        }, (frameTime, animation) => {
            internals.injectClockTick(frameTime + 500);
            const before = internals.clockLaneState(document);
            animation.pause();
            return { before, after: internals.clockLaneState(document) };
        });
        println(`lane before the pause: ${result.before}`);
        println(`lane after the pause: ${result.after}`);
        done();
    });
</script>