<!DOCTYPE html> <html> <head> <script> function addFrame(contents) { var frame = document.createElement("iframe"); frame.src = "data:text/html," + contents; document.body.appendChild(frame); } function boom() { addFrame("1"); document.documentElement.offsetHeight; addFrame("2"); document.body.style.display = "table-caption"; } </script> </head> <body onload="boom();"></body> </html>