Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Reference: the same content zoomed inside an unzoomed iframe</title>
<script src="/common/reftest-wait.js"></script>
<script src="../resources/iframe-zoom.js"></script>
<style>
body { margin: 0; }
iframe { display: block; width: 256px; height: 128px; border: 0; }
</style>
<body>
<script type="module">
const boxHtml = `<!doctype html>
<style>
body { margin: 0; }
#box { width: 32px; height: 32px; background: green; }
#spacer { height: 64px; }
</style>
<div id="box">Box</div>
<div id="spacer"></div>`;
const iframe = await loadIframe({ srcdoc: boxHtml });
iframe.contentDocument.documentElement.style.zoom = 4;
await nextFrame();
takeScreenshot();
</script>