blob: bb7f31c5b079620f859551b34aff3d6d096c3d6b [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<div id="parent" style="width: 200px; height: 200px;">
<iframe id="iframe" seamless src="about:blank"></iframe>
</div>
<script>
debug("Test that frames with inherited security origins can still be seamless.")
window.onload = function () {
window.iframe = document.getElementById("iframe");
shouldBeTrue("iframe.seamless");
shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px");
// Initially about:blank has no content, thus no height.
shouldBeEqualToString("window.getComputedStyle(iframe).height", "0px");
// Replace the empty document with a 100x100px square to test if it displays seamlessly.
window.iframe.contentDocument.write("<!DOCTYPE html><html style='width: 100px; height: 100px; background-color: green'></html>");
shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px");
shouldBeEqualToString("window.getComputedStyle(iframe).height", "100px");
}
</script>