<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
internals.settings.setEditingBehavior('win');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">|abc def hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc |def hij opq</div>',
'34-0 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">a|bc def hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc |def hij opq</div>',
'34-1 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">ab|c def hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc |def hij opq</div>',
'34-2 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc| def hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc |def hij opq</div>',
'34-3 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc |def hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-4 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc d|ef hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-5 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc de|f hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-6 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def| hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-7 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def | hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-8 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def | hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-9 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def | hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
'34-10 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def |hij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij |opq</div>',
'34-11 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def h|ij opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij |opq</div>',
'34-12 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hi|j opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij |opq</div>',
'34-13 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij| opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij |opq</div>',
'34-14 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij |opq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij opq|</div>',
'34-15 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij o|pq</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij opq|</div>',
'34-16 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij op|q</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij opq|</div>',
'34-17 left word');
selection_test(
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij opq|</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl" style="white-space:pre">abc def hij opq|</div>',
'34-18 left word');
</script>