OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .red { color: red; } | 5 .red { color: red; } |
6 </style> | 6 </style> |
7 <script src="../../js/resources/js-test-pre.js"></script> | 7 <script src="../../../resources/js-test.js"></script> |
8 <script> | 8 <script> |
9 function writeToFrame(html) { | 9 function writeToFrame(html) { |
10 var frame = document.querySelector('iframe'); | 10 var frame = document.querySelector('iframe'); |
11 var iframeDoc = frame.contentWindow.document; | 11 var iframeDoc = frame.contentWindow.document; |
12 iframeDoc.open(); | 12 iframeDoc.open(); |
13 iframeDoc.write(html); | 13 iframeDoc.write(html); |
14 iframeDoc.close(); | 14 iframeDoc.close(); |
15 } | 15 } |
16 | 16 |
17 window.onload = function () { | 17 window.onload = function () { |
18 debug("This test ensures that content written into a seamless iframe
correctly inherits style."); | 18 debug("This test ensures that content written into a seamless iframe
correctly inherits style."); |
19 | 19 |
20 writeToFrame('<div class=\"red\">Text.</div>'); | 20 writeToFrame('<div class=\"red\">Text.</div>'); |
21 window.framedElement = document.querySelector('iframe').contentDocum
ent.querySelector('div'); | 21 window.framedElement = document.querySelector('iframe').contentDocum
ent.querySelector('div'); |
22 | 22 |
23 shouldBeEqualToString("window.getComputedStyle(framedElement).getPro
pertyCSSValue('color').cssText", "rgb(255, 0, 0)"); | 23 shouldBeEqualToString("window.getComputedStyle(framedElement).getPro
pertyCSSValue('color').cssText", "rgb(255, 0, 0)"); |
24 }; | 24 }; |
25 </script> | 25 </script> |
26 </head> | 26 </head> |
27 <body> | 27 <body> |
28 <iframe seamless></iframe> | 28 <iframe seamless></iframe> |
29 </body> | 29 </body> |
30 </html> | 30 </html> |
OLD | NEW |