blob: 9f91564af526e9a1db65f6c537b7321e45e6ee41 [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 sandbox srcdoc="<html style='width: 100px; height: 100px; background-color: green'></html>"></iframe>
</div>
<script>
debug("Test that iframes with srcdoc contents can still be seamless.")
window.onload = function () {
window.iframe = document.getElementById("iframe");
shouldBeTrue("iframe.seamless");
// When an iframe is sandboxed, its origin is unique, thus seamless check
// should fail, but the spec makes a specific exception for srcdoc iframes.
shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px");
shouldBeEqualToString("window.getComputedStyle(iframe).height", "100px");
}
</script>