chromium/third_party/blink/web_tests/editing/selection/unrendered-003.html

<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div contenteditable id="root" class="editing">
<div id="sample"><span>foo</span><span id="start" style="display: none;">bar</span> baz</div>
</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');

    assert_false(selection.isCollapsed, 'isCollapsed');
    assert_equals(selection.anchorNode, sample.lastChild, 'anchorNode');
    assert_equals(selection.anchorOffset, 0, 'anchorOffset');
    assert_equals(selection.focusNode, sample.lastChild, 'focusNode');
    assert_equals(selection.focusOffset, 1, 'focusOffset');
});
</script>