chromium/third_party/blink/web_tests/editing/selection/modify_move/move_left_word_01_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<br><br><br>uvw xyz</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">abc| def<br><br><br>uvw xyz</div>'
      : '<div contenteditable dir="rtl">abc |def<br><br><br>uvw xyz</div>',
  '1-0 rtl left word');

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

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

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

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

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

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

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

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

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

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

selection_test(
  '<div contenteditable dir="rtl">abc def<br><br><br>u|vw xyz</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">abc def<br><br><br>uvw| xyz</div>'
      : '<div contenteditable dir="rtl">abc def<br><br><br>uvw |xyz</div>',
  '1-11 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">abc def<br><br><br>uv|w xyz</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">abc def<br><br><br>uvw| xyz</div>'
      : '<div contenteditable dir="rtl">abc def<br><br><br>uvw |xyz</div>',
  '1-12 rtl left word');

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

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

selection_test(
  '<div contenteditable dir="rtl">abc def<br><br><br>uvw x|yz</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">abc def<br><br><br>uvw xyz|</div>'
      : '<div contenteditable dir="rtl">abc def<br><br><br>uvw xyz|</div>',
  '1-15 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">abc def<br><br><br>uvw xy|z</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">abc def<br><br><br>uvw xyz|</div>'
      : '<div contenteditable dir="rtl">abc def<br><br><br>uvw xyz|</div>',
  '1-16 rtl left word');

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