chromium/third_party/blink/web_tests/editing/selection/modify_move/move_left_word_03_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">|\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-0 rtl left word');

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

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0|\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-2 rtl left word');

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

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-4 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0|\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-5 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0|\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-6 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br>|<br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br>|<br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-7 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br>|<br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br>|<br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br>|<br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-8 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br>|<br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>|\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>|\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  '3-9 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>|\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0</div>',
  '3-10 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0|\u05D0\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0</div>',
  '3-11 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0|\u05D0 \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0</div>',
  '3-12 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0| \u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  isMac
      ? '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>'
      : '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0</div>',
  '3-13 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 |\u05D0\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>',
  '3-14 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0|\u05D0\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>',
  '3-15 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0|\u05D0</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>',
  '3-16 rtl left word');

selection_test(
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="rtl">\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0<br><br><br>\u05D0\u05D0\u05D0 \u05D0\u05D0\u05D0|</div>',
  '3-17 rtl left word');
</script>