| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| .red { color: red; } |
| </style> |
| <script src="../../js/resources/js-test-pre.js"></script> |
| <script> |
| function writeToFrame(html) { |
| var frame = document.querySelector('iframe'); |
| var iframeDoc = frame.contentWindow.document; |
| iframeDoc.open(); |
| iframeDoc.write(html); |
| iframeDoc.close(); |
| } |
| |
| window.onload = function () { |
| debug("This test ensures that content written into a seamless iframe correctly inherits style."); |
| |
| writeToFrame('<div class=\"red\">Text.</div>'); |
| window.framedElement = document.querySelector('iframe').contentDocument.querySelector('div'); |
| |
| shouldBeEqualToString("window.getComputedStyle(framedElement).getPropertyCSSValue('color').cssText", "rgb(255, 0, 0)"); |
| }; |
| </script> |
| </head> |
| <body> |
| <iframe seamless></iframe> |
| </body> |
| </html> |