bug1506547-2.html (856B)
1 <!doctype html> 2 <html class="reftest-wait"> 3 <title>Moving the caret in an editor jumps over non-editable nodes.</title> 4 <script src="/tests/SimpleTest/EventUtils.js"></script> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <style> 7 * { outline: none } 8 9 div { 10 border: 1px solid red; 11 margin: 5px; 12 padding: 2px; 13 } 14 </style> 15 <div contenteditable="true"> 16 I am div number one 17 <div contenteditable="false">X X X</div> 18 However I am editable 19 </div> 20 <script> 21 SimpleTest.waitForFocus(function() { 22 const editable = document.querySelector('div[contenteditable="true"]'); 23 editable.focus(); 24 // 5 words in the first line, plus the non-editable node. 25 for (let i = 0; i < "I am div number one".length + 2; ++i) 26 synthesizeKey("KEY_ArrowRight"); 27 setTimeout(() => document.documentElement.removeAttribute("class"), 0); 28 }); 29 </script> 30 </html>