3 <script src=
"../../resources/js-test.js"></script>
5 if (window
.testRunner
) {
6 testRunner
.waitUntilDone();
7 testRunner
.dumpAsText();
10 var dummyResolverCalled
= false;
12 function dummyResolver() {
13 dummyResolverCalled
= true;
14 return "http://www.w3.org/1999/xhtml";
18 var iframe
= document
.createElement("iframe");
19 document
.body
.appendChild(iframe
);
20 var doc
= iframe
.contentWindow
.document
;
22 doc
.write("<html><body><div></div></body></html>");
24 document
.body
.removeChild(iframe
);
25 foundNode
= doc
.evaluate("//dummyns:div", doc
, dummyResolver
, XPathResult
.FIRST_ORDERED_NODE_TYPE
, null).singleNodeValue
;
27 testPassed("Did not crash.");
28 shouldBeTrue("dummyResolverCalled");
29 shouldBe("foundNode.toString()", "\"[object HTMLDivElement]\"");
31 if (window
.testRunner
)
32 testRunner
.notifyDone();
36 <body onload=
"test()">
37 <p>Ensure that using XPath namespace resolver with a detached iframe doesn't crash.
</p>
38 <div id=
"console"></div>