chromium/third_party/blink/web_tests/editing/selection/modify_move/move_right_word_02_rtl_multi_line.html

<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
// To verify "mac" behavior other than macOS, please add following lines:
//   internals.settings.setEditingBehavior('mac');
//   internals.settings.setSelectTrailingWhitespaceEnabled(false);
const isMac = navigator.platform.indexOf('Mac') === 0;

selection_test(
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-0 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">a|bc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-1 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">ab|c def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-2 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc| def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-3 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc |def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">|abc def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-4 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc d|ef<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-5 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc de|f<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-6 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def|<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc |def<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-7 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div>|<br></div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def|<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-8 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br>|</div><div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def|<div><br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-9 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div>|<div><br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div>|<br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-10 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div>|<br></div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div>|<br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-11 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br>|</div><div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div>|<br></div><div><br></div><div><br></div>uvw xyz</div>',
  '2-12 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div>|<div><br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div>|<br></div><div><br></div>uvw xyz</div>',
  '2-13 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div>|<br></div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div>|<br></div><div><br></div>uvw xyz</div>',
  '2-14 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br>|</div>uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div>|<br></div><div><br></div>uvw xyz</div>',
  '2-15 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>|uvw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div>|<br></div>uvw xyz</div>',
  '2-16 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>u|vw xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>|uvw xyz</div>',
  '2-17 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uv|w xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>|uvw xyz</div>',
  '2-18 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw| xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>|uvw xyz</div>',
  '2-19 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw |xyz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>|uvw xyz</div>',
  '2-20 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw x|yz</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw |xyz</div>',
  '2-21 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw xy|z</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw |xyz</div>',
  '2-22 rtl right word');

selection_test(
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw xyz|</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="rtl">abc def<div><br></div><div><br></div><div><br></div>uvw |xyz</div>',
  '2-23 rtl right word');
</script>