Truly independent web browser
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="frame-in-flight.js"></script>
<style>
body { margin: 0; }
a { display: block; width: 200px; height: 40px; color: rgb(0, 0, 255); background-color: rgb(255, 255, 255); transition: background-color 100s linear; }
a:hover { color: rgb(255, 0, 0); background-color: rgb(0, 128, 0); }
</style>
<a id="link" href="#"><span id="label">Link</span></a>
<script>
// A hover beside the task styles the children of an element whose transition animates nothing they inherit, over
// the element's record, while the transition runs.
asyncTest(async done => {
const presentedBy = await whileLaneHovers(() => {
internals.injectHoverPointer(150, 20);
return internals.lastFramePresentedBy(document);
});
println(`last frame presented by: ${presentedBy}`);
await nextFrame();
println(`link matches :hover: ${link.matches(":hover")}`);
println(`label color: ${getComputedStyle(label).color}`);
println(`transitions once the main thread took over: ${link.getAnimations().length}`);
done();
});
</script>