bug1524266-2.html (1064B)
1 <!doctype html> 2 <html class="reftest-wait"> 3 <title>Can delete non-selectable content in an editor</title> 4 <script src="/tests/SimpleTest/EventUtils.js"></script> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <style> 7 div:focus { 8 outline: 3px solid blue; 9 } 10 /* <select> has user-select: none in the UA sheet, but just in case */ 11 select { 12 -moz-user-select: none; 13 user-select: none; 14 } 15 </style> 16 <div contenteditable="true" spellcheck="false"> 17 xx 18 <select> 19 <option value="">Placeholder</option> 20 </select> 21 xxx 22 </div> 23 <script> 24 SimpleTest.waitForFocus(function() { 25 document.querySelector('[contenteditable="true"]').focus(); 26 requestAnimationFrame(function() { 27 // Move after the two x 28 for (let i = 0; i < 2; ++i) 29 synthesizeKey("KEY_ArrowRight"); 30 // Select whitespace + <select> + whitespace. 31 for (let i = 0; i < 3; ++i) 32 synthesizeKey("KEY_ArrowRight", { shiftKey: true }); 33 // Rip it off. 34 synthesizeKey("KEY_Delete"); 35 document.documentElement.removeAttribute("class"); 36 }); 37 }); 38 </script>