<html>
<head>
<script>
function runTest() {
if (window.testRunner)
testRunner.dumpAsText();
var frame = document.getElementById('theFrame');
if (!frame.contentDocument)
return;
var text = frame.contentDocument.getElementById('text');
if (!text)
return;
if (text.innerText != 'This text comes from the hidden iframe')
return;
if (window.frames.length != 1)
return;
if (window.frames[0].document != frame.contentDocument)
return;
document.getElementById('result').innerText = 'SUCCESS';
}
</script>
</head>
<body onload="runTest()">
<iframe id="theFrame" style="display:none" src="resources/iframe-display-none-child.html"></iframe>
This tests that a hidden iframe (with display set to none) can still be accessed using JavaScript.
<div id="result">SUCCESS</div>
</body>
</html>