| OLD | NEW |
| 1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 2 <head> | 2 <head> |
| 3 <script>window.enablePixelTesting = true;</script> | 3 <script>window.enablePixelTesting = true;</script> |
| 4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 5 <script src="../../fast/repaint/resources/repaint.js"></script> | 5 <script src="../../fast/repaint/resources/repaint.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body style="margin: 0px"> | 7 <body style="margin: 0px"> |
| 8 | 8 |
| 9 <script type="text/javascript"> | 9 <script type="text/javascript"> |
| 10 function test1() { | 10 function test1() { |
| 11 object1 = document.getElementsByTagName("object")[0]; | 11 object1 = document.getElementsByTagName("object")[0]; |
| 12 debug("Check initial <object> size, before external resource loade
d"); | 12 debug("Check initial <object> size, before external resource loade
d"); |
| 13 | 13 |
| 14 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); | 14 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); |
| 15 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); | 15 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); |
| 16 } | 16 } |
| 17 | 17 |
| 18 function repaintTest() { | 18 function repaintTest() { |
| 19 object1 = document.getElementsByTagName("object")[0]; | 19 object1 = document.getElementsByTagName("object")[0]; |
| 20 | 20 |
| 21 debug(""); | 21 debug(""); |
| 22 debug("Check initial <object> size, after external resource loaded
- should not change."); | 22 debug("Check initial <object> size, after external resource loaded
- should not change."); |
| 23 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); | 23 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); |
| 24 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); | 24 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); |
| 25 | 25 |
| 26 window.jsTestIsAsync = true; |
| 26 if (window.testRunner) | 27 if (window.testRunner) |
| 27 testRunner.waitUntilDone(); | 28 testRunner.waitUntilDone(); |
| 28 requestSizeChange(); | 29 requestSizeChange(); |
| 29 } | 30 } |
| 30 | 31 |
| 31 function requestSizeChange() { | 32 function requestSizeChange() { |
| 32 object1 = document.getElementsByTagName("object")[0]; | 33 object1 = document.getElementsByTagName("object")[0]; |
| 33 var htmlDoc = object1.contentDocument; | 34 var htmlDoc = object1.contentDocument; |
| 34 if (!htmlDoc) { | 35 if (!htmlDoc) { |
| 35 setTimeout(requestSizeChange, 50); | 36 setTimeout(requestSizeChange, 50); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 object1 = document.getElementsByTagName("object")[0]; | 50 object1 = document.getElementsByTagName("object")[0]; |
| 50 | 51 |
| 51 debug(""); | 52 debug(""); |
| 52 debug("Check final <object> size, after resizing finished"); | 53 debug("Check final <object> size, after resizing finished"); |
| 53 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); | 54 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).wi
dth", "400px"); |
| 54 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); | 55 shouldBeEqualToString("document.defaultView.getComputedStyle(object1).he
ight", "200px"); |
| 55 | 56 |
| 56 debug(""); | 57 debug(""); |
| 57 debug("Test passed if you see two green rectangles"); | 58 debug("Test passed if you see two green rectangles"); |
| 58 | 59 |
| 59 completeTest(); | 60 finishJSTest(); |
| 60 } | |
| 61 | |
| 62 function completeTest() { | |
| 63 var script = document.createElement("script"); | |
| 64 script.onload = function() { | |
| 65 if (window.testRunner) | |
| 66 testRunner.notifyDone(); | |
| 67 }; | |
| 68 | |
| 69 script.src = "../../fast/js/resources/js-test-post.js"; | |
| 70 document.body.appendChild(script); | |
| 71 } | 61 } |
| 72 </script> | 62 </script> |
| 73 | 63 |
| 74 <object style="border: 1px red solid; width: 400px; height: 200px;" onload="runR
epaintTest()" data="resources/nested-embedded-svg-size-changes-target.html"></ob
ject> | 64 <object style="border: 1px red solid; width: 400px; height: 200px;" onload="runR
epaintTest()" data="resources/nested-embedded-svg-size-changes-target.html"></ob
ject> |
| 75 <p id="description"></p> | 65 <p id="description"></p> |
| 76 <div id="console"></div> | 66 <div id="console"></div> |
| 77 | 67 |
| 78 <script> | 68 <script> |
| 79 description("This test checks that intrinsic size changes of an embedded SVG
cause immediate updates of the object that embeds it."); | 69 description("This test checks that intrinsic size changes of an embedded SVG
cause immediate updates of the object that embeds it."); |
| 80 test1(); | 70 test1(); |
| 81 </script> | 71 </script> |
| 82 </body> | 72 </body> |
| 83 </html> | 73 </html> |
| OLD | NEW |