2010-04-01 MORITA Hajime <morrita@google.com>
[WebKit-https.git] / LayoutTests / editing / selection / script-tests / DOMSelection-DocumentType.js
1 description("Test to check if setBaseAndExtent guard node with null owner document (Bug 31680)");
2
3 var sel = window.getSelection();
4 var docType = document.implementation.createDocumentType('c');
5
6 sel.setBaseAndExtent(docType);
7 shouldBeNull("sel.anchorNode");
8
9 sel.setBaseAndExtent(null, 0, docType, 0);
10 shouldBeNull("sel.anchorNode");
11
12 sel.collapse(docType);
13 shouldBeNull("sel.anchorNode");
14
15 sel.selectAllChildren(docType);
16 shouldBeNull("sel.anchorNode");
17
18 sel.extend(docType, 0);
19 shouldBeNull("sel.anchorNode");
20
21 sel.containsNode(docType);
22 shouldBeNull("sel.anchorNode");
23
24 shouldBeFalse("sel.containsNode(docType)");
25
26 var successfullyParsed = true;