1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 <script>window
.enablePixelTesting
= true;</script>
4 <script src=
"../../resources/js-test.js"></script>
5 <script src=
"../../fast/repaint/resources/text-based-repaint.js"></script>
7 <body style=
"margin: 0px" onload=
"runRepaintAndPixelTest()">
9 <script type=
"text/javascript">
10 window
.outputRepaintRects
= false;
12 object1
= document
.getElementsByTagName("object")[0];
13 debug("Check initial <object> size, before external resource loaded");
15 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "300px");
16 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "150px");
19 function repaintTest() {
20 object1
= document
.getElementsByTagName("object")[0];
23 debug("Check initial <object> size, after external resource loaded");
24 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "200px");
25 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
27 setTimeout(function() {
28 var svgDoc
= object1
.getSVGDocument();
29 var svgWindow
= svgDoc
.defaultView
;
30 svgWindow
.changeSize();
36 object1
= document
.getElementsByTagName("object")[0];
39 debug("Check final <object> size, after resizing finished");
40 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
41 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
44 debug("Test passed if you see two green rectangles");
50 <object style=
"border: 1px red solid" data=
"resources/embedded-svg-size-changes.svg"></object>
51 <p id=
"description"></p>
52 <div id=
"console"></div>
55 window
.jsTestIsAsync
= true;
56 if (window
.testRunner
)
57 testRunner
.waitUntilDone();
58 description("This test checks that intrinsic size changes of an embedded SVG cause immediate updates of the object that embeds it.");