OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 5 <script> |
| 6 // Win does not support the 'moveCaretToBoundary' editing behavior. |
| 7 if (window.internals) |
| 8 internals.settings.setEditingBehavior('win'); |
| 9 |
| 10 test(() => { |
| 11 // Test continuations across a block when not hitting the margin. |
| 12 assert_selection( |
| 13 '<font color="blue" id="font">|AAAAA<div>BLOCK</div><p>BBBBB</p><p id="s
econdP">CCCCC</p></font>', |
| 14 selection => { |
| 15 var document = selection.document; |
| 16 var font = document.getElementById('font'); |
| 17 var secondP = document.getElementById('secondP'); |
| 18 |
| 19 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 20 eventSender.mouseDown(); |
| 21 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop + 5); |
| 22 eventSender.mouseUp(); |
| 23 }, |
| 24 '<font color="blue" id="font">^AAAAA<div>BLOCK</div><p>BBBBB</p><p id="s
econdP">CC|CCC</p></font>'); |
| 25 |
| 26 // Test continuation margin. |
| 27 assert_selection( |
| 28 '<font color="blue" id="font">|AAAAA<p>BBBBB</p><p id="secondP">CCCCC</p
></font>', |
| 29 selection => { |
| 30 var document = selection.document; |
| 31 var font = document.getElementById('font'); |
| 32 var secondP = document.getElementById('secondP'); |
| 33 |
| 34 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 35 eventSender.mouseDown(); |
| 36 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop - 5); |
| 37 eventSender.mouseUp(); |
| 38 }, |
| 39 '<font color="blue" id="font">^AAAAA<p>BBBBB</p><p id="secondP">CC|CCC</
p></font>'); |
| 40 |
| 41 // Test continuation margin across a block. |
| 42 assert_selection( |
| 43 '<font color="blue" id="font">|AAAAA<div>BLOCK</div><p>BBBBB</p><p id="s
econdP">CCCCC</p></font>', |
| 44 selection => { |
| 45 var document = selection.document; |
| 46 var font = document.getElementById('font'); |
| 47 var secondP = document.getElementById('secondP'); |
| 48 |
| 49 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 50 eventSender.mouseDown(); |
| 51 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop - 5); |
| 52 eventSender.mouseUp(); |
| 53 }, |
| 54 '<font color="blue" id="font">^AAAAA<div>BLOCK</div><p>BBBBB</p><p id="s
econdP">CC|CCC</p></font>'); |
| 55 |
| 56 // Test continuation margin across a block. |
| 57 assert_selection( |
| 58 '<font color="blue" id="font">|AAAAA<p>BBBBB</p><div>BLOCK</div><p id="s
econdP">CCCCC</p></font>', |
| 59 selection => { |
| 60 var document = selection.document; |
| 61 var font = document.getElementById('font'); |
| 62 var secondP = document.getElementById('secondP'); |
| 63 |
| 64 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 65 eventSender.mouseDown(); |
| 66 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop - 5); |
| 67 eventSender.mouseUp(); |
| 68 }, |
| 69 '<font color="blue" id="font">^AAAAA<p>BBBBB</p><div>BLOCK</div><p id="s
econdP">CC|CCC</p></font>'); |
| 70 |
| 71 // Test continuation margin across a relative block. |
| 72 assert_selection( |
| 73 '<font color="blue" id="font">|AAAAA<div style="position: relative; marg
in-top: 50px;">BLOCK</div><p>BBBBB</p><p id="secondP">CCCCC</p></font>', |
| 74 selection => { |
| 75 var document = selection.document; |
| 76 var font = document.getElementById('font'); |
| 77 var secondP = document.getElementById('secondP'); |
| 78 |
| 79 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 80 eventSender.mouseDown(); |
| 81 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop - 5); |
| 82 eventSender.mouseUp(); |
| 83 }, |
| 84 '<font color="blue" id="font">^AAAAA<div style="position: relative; marg
in-top: 50px;">BLOCK</div><p>BBBBB</p><p id="secondP">CC|CCC</p></font>'); |
| 85 |
| 86 // Test continuation margin across a relative block. |
| 87 assert_selection( |
| 88 '<font color="blue" id="font">|AAAAA<p>BBBBB</p><div style="position: re
lative; margin-top: 50px;">BLOCK</div><p id="secondP">CCCCC</p></font>', |
| 89 selection => { |
| 90 var document = selection.document; |
| 91 var font = document.getElementById('font'); |
| 92 var secondP = document.getElementById('secondP'); |
| 93 |
| 94 eventSender.mouseMoveTo(document.offsetLeft + font.offsetLeft, docum
ent.offsetTop + font.offsetTop + 5); |
| 95 eventSender.mouseDown(); |
| 96 eventSender.mouseMoveTo(document.offsetLeft + secondP.offsetLeft + 2
0, document.offsetTop + secondP.offsetTop - 5); |
| 97 eventSender.mouseUp(); |
| 98 }, |
| 99 '<font color="blue" id="font">^AAAAA<p>BBBBB</p><div style="position: re
lative; margin-top: 50px;">BLOCK</div><p id="secondP">CC|CCC</p></font>'); |
| 100 }); |
| 101 </script> |
OLD | NEW |