blob: 6d7a3fd156bd04d8786fa399e3c9317713bd5159 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style> .selected { color: blue; } </style>
</head>
<body>
<p>This tests horizontal caret movement in vertical writing mode. "は猫である。" and "名前" must be selected.</p>
<div id="test" style="-webkit-writing-mode: vertical-rl; outline: none;" contenteditable>
<p>吾輩は猫である。名前はまだ無い。</p>
</div>
<span id="span-for-height-calc" style="-webkit-writing-mode: vertical-rl; outline: none;">
<p>吾輩は猫である。<br>名前はまだ無い。</p>
</span>
<pre id="log"></pre>
<script>
var desiredHeight = document.getElementById('span-for-height-calc');
var test = document.getElementById('test');
test.style.height = (desiredHeight.offsetHeight + 2) + 'px';
desiredHeight.style.display = 'none';
window.getSelection().setPosition(test.getElementsByTagName('p')[0].firstChild, 2);
window.getSelection().modify('Extend', 'Forward', 'Line');
</script>
</body>
</html>