blob: 5f2b2235296bacf285164cb311a9b45b91a1a3d2 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<div contenteditable id="root" class="editing">
<span id="sample"><i>F and seven</i> years <b> as </b>our fathers f upon this
continent, a new nation, conceived &nbsp;&nbsp; in Liberty, and dedicated to the
proposition that all<br>
men are created equal.</span>
</div>
<div id="log"></div>
<script>
test(function() {
var selection = window.getSelection();
selection.collapse(sample, 0);
for (i = 0; i < 158; ++i)
selection.modify('move', 'forward', 'character');
for (i = 0; i < 157; ++i)
selection.modify('move', 'backward', 'character');
assert_true(selection.isCollapsed, 'isCollapsed');
assert_equals(selection.anchorNode, sample.firstChild.firstChild, 'anchorNode');
assert_equals(selection.anchorOffset, 1, 'anchorOffset');
});
</script>
</body>