Truly independent web browser
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="frame-in-flight.js"></script>
<style>
body { margin: 0; }
#card { width: 200px; height: 100px; color: rgb(0, 0, 0); }
#card:hover { color: rgb(255, 0, 0); }
#card:hover .badge { background: rgb(255, 255, 0); }
.badge { background: rgb(128, 128, 128); }
</style>
<div id="card"><span id="text">Text</span> <span class="badge" id="badge">Badge</span></div>
<script>
// A hover beside the task restyles what inherits from the hovered element and what a selector reaches through it.
asyncTest(async done => {
const presentedBy = await whileLaneHovers(() => {
internals.injectHoverPointer(150, 50);
return internals.lastFramePresentedBy(document);
});
println(`last frame presented by: ${presentedBy}`);
await nextFrame();
println(`card matches :hover: ${card.matches(":hover")}`);
println(`text color: ${getComputedStyle(text).color}`);
println(`badge background: ${getComputedStyle(badge).backgroundColor}`);
println(`badge color: ${getComputedStyle(badge).color}`);
done();
});
</script>