| <!DOCTYPE html> |
| <script src="../../resources/js-test.js"></script> |
| <body> |
| <script> |
| window.selection = getSelection(); |
| |
| shouldNotThrow('selection.collapse(document.body, 0)'); |
| shouldNotThrow('selection.collapse(null, 0)'); |
| shouldNotThrow('selection.collapse(undefined, 0)'); |
| shouldThrow('selection.collapse(0, 0)'); |
| shouldThrow('selection.collapse(window, 0)'); |
| |
| shouldNotThrow('selection.setPosition(document.body, 0)'); |
| shouldNotThrow('selection.setPosition(null, 0)'); |
| shouldNotThrow('selection.setPosition(undefined, 0)'); |
| shouldThrow('selection.setPosition(0, 0)'); |
| shouldThrow('selection.setPosition(window, 0)'); |
| |
| shouldNotThrow('selection.setBaseAndExtent(document.body, 0, document.body, 0)'); |
| shouldNotThrow('selection.setBaseAndExtent(null, 0, null, 0)'); |
| shouldNotThrow('selection.setBaseAndExtent(undefined, 0, undefined, 0)'); |
| shouldThrow('selection.setBaseAndExtent(0, 0, null, 0)'); |
| shouldThrow('selection.setBaseAndExtent(null, 0, 0, 0)'); |
| shouldThrow('selection.setBaseAndExtent(window, 0, null, 0)'); |
| shouldThrow('selection.setBaseAndExtent(null, 0, window, 0)'); |
| </script> |