blob: 73ef884840f60f5ae5500d97c847e453729ca308 [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="ltr">|abc ghi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
isMac
? '<div contenteditable dir="ltr">abc| ghi<div></div><div></div><div></div></div>'
: '<div contenteditable dir="ltr">abc |ghi<div></div><div></div><div></div></div>',
'8-0 ltr right word');
selection_test(
'<div contenteditable dir="ltr">a|bc ghi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
isMac
? '<div contenteditable dir="ltr">abc| ghi<div></div><div></div><div></div></div>'
: '<div contenteditable dir="ltr">abc |ghi<div></div><div></div><div></div></div>',
'8-1 ltr right word');
selection_test(
'<div contenteditable dir="ltr">ab|c ghi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
isMac
? '<div contenteditable dir="ltr">abc| ghi<div></div><div></div><div></div></div>'
: '<div contenteditable dir="ltr">abc |ghi<div></div><div></div><div></div></div>',
'8-2 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc| ghi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
isMac
? '<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>'
: '<div contenteditable dir="ltr">abc |ghi<div></div><div></div><div></div></div>',
'8-3 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc |ghi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-4 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc g|hi<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-5 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc gh|i<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-6 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-7 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div>|</div><div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-8 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div></div>|<div></div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-9 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div></div><div>|</div><div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-10 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div></div><div></div>|<div></div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-11 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div></div><div></div><div>|</div></div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-12 ltr right word');
selection_test(
'<div contenteditable dir="ltr">abc ghi<div></div><div></div><div></div>|</div>',
selection => selection.modify('move', 'right', 'word'),
'<div contenteditable dir="ltr">abc ghi|<div></div><div></div><div></div></div>',
'8-13 ltr right word');
</script>