<!DOCTYPE html>
<style>iframe { border:none }</style>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<iframe src="../as-image/resources/200x200-blue-rect.svg">
</iframe>
<script>
t = async_test("Test <iframe> and <svg> size");
function check() {
var iframe = document.querySelector('iframe');
var iframeRect = iframe.getBoundingClientRect();
var svg = iframe.contentDocument.documentElement;
var svgRect = svg.getBoundingClientRect();
assert_equals(iframeRect.width, 300, "width should be fallback width.");
assert_equals(iframeRect.height, 150, "height should be the fallback height 150.");
assert_equals(svgRect.width, svg.width.baseVal.value, "width should be what the <svg> requests.");
assert_equals(svgRect.height, svg.height.baseVal.value, "height should be what the <svg> requests.");
t.done();
}
t.step(function() {
addEventListener('load', t.step_func(check));
});
</script>
<div id="log"></div>