blob: dabc315e53605122d5cf0f352edff8448fc09572 [file] [log] [blame]
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
var dummyFilterCalled = false;
var foundNode;
function dummyFilter() {
dummyFilterCalled = true;
return NodeFilter.FILTER_ACCEPT;
}
function test() {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
var doc = iframe.contentWindow.document;
document.body.removeChild(iframe);
var iterator = doc.createNodeIterator(doc, NodeFilter.SHOW_ELEMENT, dummyFilter, false);
foundNode = iterator.nextNode();
testPassed("Did not crash.");
shouldBeTrue("dummyFilterCalled");
shouldBe("foundNode.toString()", "\"[object HTMLHtmlElement]\"");
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body onload="test()">
<p>Ensure that using node filter with a detached iframe doesn't crash.</p>
<div id="console"></div>
</body>
</html>