blob: 4e45c4593ce39924152b56d6b8d80cea6395f250 [file] [log] [blame]
<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
const isMac = navigator.platform.indexOf('Mac') === 0;
const kBehaviors = window.internals ? ['mac', 'win'] : isMac ? ['mac'] : ['win'];
for (const behavior of kBehaviors) {
if (window.internals) {
internals.settings.setEditingBehavior(behavior);
internals.settings.setSelectTrailingWhitespaceEnabled(behavior !== 'mac');
}
selection_test(
'<div contenteditable dir="rtl">|they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-0 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">t|hey said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|t^hey said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-1 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">th|ey said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|th^ey said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-2 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">the|y said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|the^y said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-3 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they| said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|they^ said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-4 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they |said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">|they ^said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-5 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they s|aid "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they |s^aid "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-6 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they sa|id "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they |sa^id "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-7 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they sai|d "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they |sai^d "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-8 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said| "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they |said^ "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-9 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said |"\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they |said ^"\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-10 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "|\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said |"^\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-11 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202B|car \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said |"\u202B^car \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-12 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bc|ar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202B|c^ar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-13 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bca|r \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202B|ca^r \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-14 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar| \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202B|car^ \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-15 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar |\u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202B|car ^\u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-16 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3|\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar |\u05D3^\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-17 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4|\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar |\u05D3\u05D4^\u05D5 \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-18 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5| \u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar |\u05D3\u05D4\u05D5^ \u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-19 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar |\u05D3\u05D4\u05D5 ^\u05D0\u05D1\u05D2\u202C."</div>',
`${behavior} 18-20 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0|\u05D1\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0^\u05D1\u05D2\u202C."</div>',
`${behavior} 18-21 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1|\u05D2\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0\u05D1^\u05D2\u202C."</div>',
`${behavior} 18-22 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2|\u202C."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0\u05D1\u05D2^\u202C."</div>',
`${behavior} 18-23 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C|."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0\u05D1\u05D2\u202C^."</div>',
`${behavior} 18-24 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C.|"</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C|.^"</div>',
`${behavior} 18-25 rtl backward word`);
selection_test(
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 \u05D0\u05D1\u05D2\u202C|."</div>',
selection => selection.modify('extend', 'backward', 'word'),
'<div contenteditable dir="rtl">they said "\u202Bcar \u05D3\u05D4\u05D5 |\u05D0\u05D1\u05D2\u202C^."</div>',
`${behavior} 18-26 rtl backward word`);
}
</script>