blob: ec39706210b5cbe45eed0d187203f6e4b4489e06 [file] [log] [blame]
<!DOCTYPE html>
<title>Document-detached use of DOMParser</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
var iframe = document.createElement("iframe");
iframe.src = "data:text/html,<b>";
document.body.appendChild(iframe);
var Parser = iframe.contentWindow.DOMParser;
iframe.remove();
var d = new Parser();
assert_true(d != null);
var detached = d.parseFromString("no crash", "text/html");
assert_equals(detached.origin, "null");
});
</script>
</body>