Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<style>
body { margin: 0; }
iframe { position: absolute; left: 20px; top: 20px; width: 200px; height: 120px; border: 0; }
#over-iframe { position: absolute; left: 100px; top: 60px; width: 200px; height: 40px; background: rgba(255, 255, 255, 0.5); }
#elsewhere { position: absolute; left: 600px; top: 300px; width: 50px; height: 20px; background: green; }
</style>
<iframe id="frame" srcdoc="<body style='margin: 0; background: blue'></body>"></iframe>
<div id="over-iframe"></div>
<div id="elsewhere"></div>
<script>
promiseTest(async () => {
await new Promise(resolve => {
// The initial about:blank document is complete too, before the srcdoc document replaces it.
if (frame.contentDocument && frame.contentDocument.URL === "about:srcdoc" && frame.contentDocument.readyState === "complete") {
resolve();
return;
}
frame.onload = resolve;
});
await animationFrame();
println(internals.dumpDisplayList());
});
</script>