Skip to content

Truly independent web browser

1.1 KB
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="frame-in-flight.js"></script>
<style>
    body { margin: 0; }
    #box { width: 200px; padding-top: 50px; font: 10px/1 sans-serif; transition: font-size 1s linear; }
    #box:hover { font-size: 30px; }
    #child:hover { display: block; }
</style>
<div id="box"><span id="child">item</span></div>
<script>
    // A hover beside the task starts a transition of an inherited property, and the next one turns an inline element
    // that shows what it inherits of it into a block, which builds the boxes around it again. The frame of that move
    // shows the transition halfway in the boxes it built, not the value it ends at.
    asyncTest(async done => {
        const result = await whileLaneHovers(frameTime => {
            internals.injectHoverPointer(150, 20, frameTime + 16);
            internals.injectHoverPointer(5, 55, frameTime + 16 + 500);
            return internals.presentedBorderBox(child)?.height;
        });
        println(`child height halfway through: ${result}`);
        done();
    });
</script>