1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <script>window.enablePixelTesting = true;</script>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
6 <body style="margin: 0px">
8 <script type="text/javascript">
10 debug("Check initial <object> size, before external resource loaded");
12 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "300px");
13 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "150px");
18 debug("Check initial <object> size, after external resource loaded");
19 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "200px");
20 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
22 var svgDoc = object1.getSVGDocument();
23 var svgWindow = svgDoc.defaultView;
24 svgWindow.changeSize();
30 debug("Check final <object> size, after resizing finished");
31 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
32 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
35 debug("Test passed if you see two green rectangles");
40 function completeTest() {
41 var script = document.createElement("script");
43 script.onload = function() {
44 if (window.layoutTestController)
45 layoutTestController.notifyDone();
48 script.src = "../../fast/js/resources/js-test-post.js";
49 document.body.appendChild(script);
53 <object style="border: 1px red solid" onload="test2()" data="resources/embedded-svg-size-changes.svg"></object>
54 <p id="description"></p>
55 <div id="console"></div>
58 if (window.layoutTestController)
59 layoutTestController.waitUntilDone();
60 var object1 = document.getElementsByTagName("object")[0];
61 description("This test checks that intrinsic size changes of an embedded SVG cause immediate updates of the object that embeds it.");