| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | 4 <script> |
| 5 function log(str) | 5 function log(str) |
| 6 { | 6 { |
| 7 var result = document.getElementById('result'); | 7 var result = document.getElementById('result'); |
| 8 result.appendChild(document.createTextNode(str)); | 8 result.appendChild(document.createTextNode(str)); |
| 9 result.appendChild(document.createElement('br')); | 9 result.appendChild(document.createElement('br')); |
| 10 } | 10 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 testRunner.dumpAsText(); | 24 testRunner.dumpAsText(); |
| 25 | 25 |
| 26 log('Starting test...'); | 26 log('Starting test...'); |
| 27 log(window.getSelection().rangeCount + ' range(s) selected'); | 27 log(window.getSelection().rangeCount + ' range(s) selected'); |
| 28 log('Dragging image in non-editable area...'); | 28 log('Dragging image in non-editable area...'); |
| 29 dragNowhere(document.getElementById('imageOne')); | 29 dragNowhere(document.getElementById('imageOne')); |
| 30 log(window.getSelection().rangeCount + ' range(s) selected'); | 30 log(window.getSelection().rangeCount + ' range(s) selected'); |
| 31 log('Dragging image in editable area...'); | 31 log('Dragging image in editable area...'); |
| 32 dragNowhere(document.getElementById('imageTwo')); | 32 dragNowhere(document.getElementById('imageTwo')); |
| 33 log(window.getSelection().rangeCount + ' range(s) selected'); | 33 log(window.getSelection().rangeCount + ' range(s) selected'); |
| 34 if (window.getSelection().rangeCount && window.getSelection().containsNo
de(document.getElementById('imageTwo'))) | 34 if (window.getSelection().rangeCount && window.getSelection().containsNo
de(document.getElementById('imageTwo'), false)) |
| 35 log('imageTwo is selected'); | 35 log('imageTwo is selected'); |
| 36 } | 36 } |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 <body> | 39 <body> |
| 40 <div> | 40 <div> |
| 41 <h3>Non-editable area</h3> | 41 <h3>Non-editable area</h3> |
| 42 <img id="imageOne" src="resources/abe.png"> | 42 <img id="imageOne" src="resources/abe.png"> |
| 43 </div> | 43 </div> |
| 44 <div contenteditable="true"> | 44 <div contenteditable="true"> |
| 45 <h3>Editable area</h3> | 45 <h3>Editable area</h3> |
| 46 <img id="imageTwo" src="resources/onload-image.png"> | 46 <img id="imageTwo" src="resources/onload-image.png"> |
| 47 </div> | 47 </div> |
| 48 <p>This tests that images are properly left selected or unselected when an image
drag is started. | 48 <p>This tests that images are properly left selected or unselected when an image
drag is started. |
| 49 Only the image in the editable area should be selected when an image drag is sta
rted. | 49 Only the image in the editable area should be selected when an image drag is sta
rted. |
| 50 <div id="result"> | 50 <div id="result"> |
| 51 </div> | 51 </div> |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |