| <!DOCTYPE HTML> | |
| <html> | |
| <body> | |
| <script src="../../resources/js-test.js"></script> | |
| <div id="div" contenteditable="true">hello</div> | |
| <script> | |
| description("Ensure that collapse with null clears selection"); | |
| var selection = getSelection(); | |
| selection.selectAllChildren(div); | |
| selection.rangeCount | |
| shouldBe("selection.rangeCount", "1"); | |
| selection.collapse(null); | |
| shouldBe("selection.rangeCount", "0"); | |
| selection.collapse(div.firstChild, 2); | |
| shouldBe("selection.rangeCount", "1"); | |
| selection.collapse(null); | |
| shouldBe("selection.rangeCount", "0"); | |
| </script> | |
| </body> | |
| </html> |