blob: 7cf5440ea49faf9ab207b2cc466a6615224a2969 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/js-test-selection-shared.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test to check if setBaseAndExtent guard node with null owner document (Bug 31680)");
var sel = window.getSelection();
var docType = document.implementation.createDocumentType('c', '', '');
sel.setBaseAndExtent(docType, 0, docType, 0);
shouldBeNull("sel.anchorNode");
sel.setBaseAndExtent(docType, 0, docType, 0);
shouldBeNull("sel.anchorNode");
sel.collapse(docType);
shouldBeNull("sel.anchorNode");
sel.selectAllChildren(docType);
shouldBeNull("sel.anchorNode");
sel.extend(docType, 0);
shouldBeNull("sel.anchorNode");
sel.containsNode(docType);
shouldBeNull("sel.anchorNode");
shouldBeFalse("sel.containsNode(docType)");
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>