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">
8 <script type=
"text/javascript">
9 window
.jsTestIsAsync
= true;
10 window
.outputRepaintRects
= false;
11 if (window
.testRunner
)
12 testRunner
.waitUntilDone();
15 object1
= document
.getElementsByTagName("object")[0];
16 debug("Check initial <object> size, before external resource loaded");
18 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
19 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
22 function repaintTest() {
23 object1
= document
.getElementsByTagName("object")[0];
26 debug("Check initial <object> size, after external resource loaded - should not change.");
27 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
28 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
33 function requestSizeChange() {
34 object1
= document
.getElementsByTagName("object")[0];
35 var htmlDoc
= object1
.contentDocument
;
37 setTimeout(requestSizeChange
, 50);
41 var htmlWindow
= htmlDoc
.defaultView
;
42 // Wait until the embedded SVG (of the embedded HTML that we're loading), is loaded.
43 if (htmlWindow
.canChangeSize
) {
44 htmlWindow
.changeSize();
47 setTimeout(requestSizeChange
, 50);
51 object1
= document
.getElementsByTagName("object")[0];
54 debug("Check final <object> size, after resizing finished");
55 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).width", "400px");
56 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).height", "200px");
59 debug("Test passed if you see two green rectangles");
65 <object style=
"border: 1px red solid; width: 400px; height: 200px;" onload=
"runRepaintAndPixelTest()" data=
"resources/nested-embedded-svg-size-changes-target.html"></object>
66 <p id=
"description"></p>
67 <div id=
"console"></div>
70 description("This test checks that intrinsic size changes of an embedded SVG cause immediate updates of the object that embeds it.");