| OLD | NEW |
| 1 <div>This test uses execCommand('insertImage') to replace the selection in a va
riety of mixed directionality text. If this doesn't crash, then the test passes
.</div> | 1 <div>This test uses execCommand('insertImage') to replace the selection in a va
riety of mixed directionality text. If this doesn't crash, then the test passes
.</div> |
| 2 <div dir='rtl' id='rtl1' style='white-space:pre' contentEditable>the </div> | 2 <div dir='rtl' id='rtl1' style='white-space:pre' contentEditable>the </div> |
| 3 <div dir='rtl' id='rtl2' style='white-space:pre' contentEditable>אחת </div> | 3 <div dir='rtl' id='rtl2' style='white-space:pre' contentEditable>אחת </div> |
| 4 <div dir='ltr' id='ltr1' style='white-space:pre' contentEditable>the </div> | 4 <div dir='ltr' id='ltr1' style='white-space:pre' contentEditable>the </div> |
| 5 <div dir='ltr' id='ltr2' style='white-space:pre' contentEditable>אחת </div> | 5 <div dir='ltr' id='ltr2' style='white-space:pre' contentEditable>אחת </div> |
| 6 <script> | 6 <script> |
| 7 if (window.testRunner) | 7 if (window.testRunner) |
| 8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
| 9 | 9 |
| 10 // Select only "the", not the space, LTR text in RTL region. | 10 // Select only "the", not the space, LTR text in RTL region. |
| 11 document.getSelection().setBaseAndExtent(rtl1.firstChild, 0, rtl1.firstChild, 3)
; | 11 document.getSelection().setBaseAndExtent(rtl1.firstChild, 0, rtl1.firstChild, 3)
; |
| 12 document.execCommand('InsertImage', false, "../resources/abe.png"); | 12 document.execCommand('InsertImage', false, "../resources/abe.png"); |
| 13 // Select only "אחת", not the space, RTL text in RTL region. | 13 // Select only "אחת", not the space, RTL text in RTL region. |
| 14 document.getSelection().setBaseAndExtent(rtl2.firstChild, 0, rtl2.firstChild, 3)
; | 14 document.getSelection().setBaseAndExtent(rtl2.firstChild, 0, rtl2.firstChild, 3)
; |
| 15 document.execCommand('InsertImage', false, "../resources/abe.png"); | 15 document.execCommand('InsertImage', false, "../resources/abe.png"); |
| 16 // Select only "the", not the space, LTR text in LTR region. | 16 // Select only "the", not the space, LTR text in LTR region. |
| 17 document.getSelection().setBaseAndExtent(ltr1.firstChild, 0, ltr1.firstChild, 3)
; | 17 document.getSelection().setBaseAndExtent(ltr1.firstChild, 0, ltr1.firstChild, 3)
; |
| 18 document.execCommand('InsertImage', false, "../resources/abe.png"); | 18 document.execCommand('InsertImage', false, "../resources/abe.png"); |
| 19 // Select only "אחת", not the space, RTL text in LTR region. | 19 // Select only "אחת", not the space, RTL text in LTR region. |
| 20 document.getSelection().setBaseAndExtent(ltr2.firstChild, 0, ltr2.firstChild, 3)
; | 20 document.getSelection().setBaseAndExtent(ltr2.firstChild, 0, ltr2.firstChild, 3)
; |
| 21 document.execCommand('InsertImage', false, "../resources/abe.png"); | 21 document.execCommand('InsertImage', false, "../resources/abe.png"); |
| 22 </script> | 22 </script> |
| OLD | NEW |