blob: 0b73d14b62d605758c0e39df191b31841b764007 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<p>This tests horizontal caret movement in vertical writing mode. "は猫である。" and "名前" must be selected.</p>
<div id="test" style="height: 30ex; -webkit-writing-mode: vertical-rl; outline: none;" contenteditable>
<p id="p1">吾輩は猫である。</p>
<p id="p2">名前はまだ無い。</p>
<div id="log"></div>
<script>
test(function() {
var selection = window.getSelection();
var p1 = document.getElementById('p1');
var p2 = document.getElementById('p2');
selection.collapse(p1.firstChild, 2);
selection.modify('Extend', 'Forward', 'Line');
assert_false(selection.isCollapsed, 'isCollapsed');
assert_equals(selection.anchorNode, p1.firstChild, 'anchorNode');
assert_equals(selection.anchorOffset, 2, 'anchorOffset');
assert_equals(selection.focusNode, p2.firstChild, 'focusNode');
assert_equals(selection.focusOffset, 2, 'focusOffset');
});
</script>