blob: 17ce20dfdec1adcece70102ce2b406d4bc151cd0 [file] [log] [blame]
<!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 ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc| ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc |ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-0 rtl left word');
selection_test(
'<div contenteditable dir="rtl">a|bc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc| ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc |ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-1 rtl left word');
selection_test(
'<div contenteditable dir="rtl">ab|c ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc| ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc |ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-2 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc| ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc |ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-3 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc |ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-4 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc g|hi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-5 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc gh|i<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi|<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-6 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi|<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div>|<img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div>|<img src="../../resources/abe.png"></div><div></div><div></div>opq rst</div>',
'9-7 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div>|<img src=../../resources/abe.png></div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png">|</div><div></div><div></div>opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png">|</div><div></div><div></div>opq rst</div>',
'9-8 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png>|</div><div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>|opq rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>|opq rst</div>',
'9-9 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div>|<div></div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-10 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div>|</div><div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-11 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div>|<div></div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-12 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div>|</div>opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-13 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>|opq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-14 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>o|pq rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-15 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>op|q rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq| rst</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-16 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq| rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq |rst</div>',
'9-17 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq |rst</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>',
'9-18 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq r|st</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>',
'9-19 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rs|t</div>',
selection => selection.modify('move', 'left', 'word'),
isMac
? '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>'
: '<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>',
'9-20 rtl left word');
selection_test(
'<div contenteditable dir="rtl">abc ghi<div><img src=../../resources/abe.png></div><div></div><div></div>opq rst|</div>',
selection => selection.modify('move', 'left', 'word'),
'<div contenteditable dir="rtl">abc ghi<div><img src="../../resources/abe.png"></div><div></div><div></div>opq rst|</div>',
'9-21 rtl left word');
</script>