<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
// This tests for a bug moving down by a line from a line just above a table,
// and moving up by a line from just below a table.
selection_test(
[
'<div contenteditable>',
'<div>|above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
],
selection => selection.modify('move', 'forward', 'line'),
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>|cd</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
], 'start of "above"');
selection_test(
[
'<div contenteditable>',
'<div>above|</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
],
selection => selection.modify('move', 'forward', 'line'),
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd|</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
], 'end of "above"');
selection_test(
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd</span> ef</td>',
'</tr></tbody></table>',
'<div>below|</div>',
'</div>',
],
selection => selection.modify('move', 'backward', 'line'),
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd|</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
], 'start of "below"');
selection_test(
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd</span> ef</td>',
'</tr></tbody></table>',
'<div>below|</div>',
'</div>',
],
selection => selection.modify('move', 'backward', 'line'),
[
'<div contenteditable>',
'<div>above</div>',
'<table border="1" contenteditable="false"><tbody><tr>',
'<td>ab <span contenteditable>cd|</span> ef</td>',
'</tr></tbody></table>',
'<div>below</div>',
'</div>',
], 'end of "below"');
</script>