blob: a1aa2c888c342605b32795c139c4b19af7a16925 [file] [log] [blame]
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>window.enablePixelTesting = true;</script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body style="margin: 0px">
<script type="text/javascript">
function test1() {
debug("Check initial &lt;object&gt; size, before external resource loaded");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
}
function test2() {
debug("");
debug("Check initial &lt;object&gt; size, after external resource loaded - should not change.");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
var htmlDoc = object1.contentDocument;
var htmlWindow = htmlDoc.defaultView;
htmlWindow.changeSize();
test3();
}
function test3() {
debug("");
debug("Check final &lt;object&gt; size, after resizing finished");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
debug("");
debug("Test passed if you see two green rectangles");
completeTest();
}
function completeTest() {
var script = document.createElement("script");
script.onload = function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
};
script.src = "../../fast/js/resources/js-test-post.js";
document.body.appendChild(script);
}
</script>
<object style="border: 1px red solid; width: 400px; height: 200px;" onload="setTimeout(test2, 0)" data="resources/nested-embedded-svg-size-changes-target.html"></object>
<p id="description"></p>
<div id="console"></div>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var object1 = document.getElementsByTagName("object")[0];
description("This test checks that intrinsic size changes of an embedded SVG cause immediate updates of the object that embeds it.");
test1();
</script>
</body>
</html>