blob: ead5fcea8c71dabba3ab8dcfa7a0122ad055992d [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div contenteditable id="root" class="editing">
<span id="sample">foo</span><span id="start" style="display: none;">bar</span> baz
</div>
<div id="log"></div>
<script>
test(function() {
var selection = window.getSelection();
var sample = document.getElementById('sample');
selection.collapse(document.getElementById('start').firstChild, 2);
selection.modify('extend', 'forward', 'character');
selection.modify('move', 'backward', 'character');
assert_true(selection.isCollapsed, 'isCollapsed');
assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode');
assert_equals(selection.anchorOffset, 3, 'anchorOffset');
});
</script>