| <script> |
| function test() |
| { |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| var result; |
| if (!document.getElementById('frame').document) |
| result = "TEST PASSED: The frame has no document property."; |
| else if (document == document.getElementById('frame').document) |
| result = "TEST FAILED: The document property is returning the document the iframe element is in."; |
| else |
| result = "TEST FAILED: The document property is returning a document other than the one the iframe element is in, probably the document inside the frame."; |
| var resultElement = document.getElementById('result'); |
| resultElement.replaceChild(document.createTextNode(result), resultElement.firstChild); |
| } |
| </script> |
| <body onload="test()"> |
| <p>This tests the document property on an HTMLIFrameElement. |
| Internet Explorer has a document property on all elements that gives the document the element is in. |
| Old versions of Safari had both this and another property on iframe elements to return the document |
| inside the iframe, which created an incompatibility with at least on SAP application because it |
| doesn't match the behavior of other browsers.</p> |
| <p id="result">TEST NOT RUN</p> |
| <iframe src="data:text/html,iframe contents" id="frame"></iframe> |
| </body> |