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