OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../js/resources/js-test-pre.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <div id="parent" style="width: 200px; height: 200px;"> | 3 <div id="parent" style="width: 200px; height: 200px;"> |
4 <iframe id="iframe" seamless src="about:blank"></iframe> | 4 <iframe id="iframe" seamless src="about:blank"></iframe> |
5 </div> | 5 </div> |
6 <script> | 6 <script> |
7 debug("Test that frames with inherited security origins can still be seamless.") | 7 debug("Test that frames with inherited security origins can still be seamless.") |
8 window.onload = function () { | 8 window.onload = function () { |
9 window.iframe = document.getElementById("iframe"); | 9 window.iframe = document.getElementById("iframe"); |
10 shouldBeTrue("iframe.seamless"); | 10 shouldBeTrue("iframe.seamless"); |
11 | 11 |
12 shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px"); | 12 shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px"); |
13 // Initially about:blank has no content, thus no height. | 13 // Initially about:blank has no content, thus no height. |
14 shouldBeEqualToString("window.getComputedStyle(iframe).height", "0px"); | 14 shouldBeEqualToString("window.getComputedStyle(iframe).height", "0px"); |
15 | 15 |
16 // Replace the empty document with a 100x100px square to test if it displays
seamlessly. | 16 // Replace the empty document with a 100x100px square to test if it displays
seamlessly. |
17 window.iframe.contentDocument.write("<!DOCTYPE html><html style='width: 100p
x; height: 100px; background-color: green'></html>"); | 17 window.iframe.contentDocument.write("<!DOCTYPE html><html style='width: 100p
x; height: 100px; background-color: green'></html>"); |
18 shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px"); | 18 shouldBeEqualToString("window.getComputedStyle(iframe).width", "200px"); |
19 shouldBeEqualToString("window.getComputedStyle(iframe).height", "100px"); | 19 shouldBeEqualToString("window.getComputedStyle(iframe).height", "100px"); |
20 } | 20 } |
21 </script> | 21 </script> |
OLD | NEW |