bug1524266-3.html (934B)
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 span { 11 user-select: none; 12 } 13 </style> 14 <div contenteditable="true" spellcheck="false"> 15 xx 16 <span> 17 SELECTABLE 18 </span> 19 xxx 20 </div> 21 <script> 22 SimpleTest.waitForFocus(function() { 23 document.querySelector('[contenteditable="true"]').focus(); 24 requestAnimationFrame(function() { 25 // Move after the two x 26 for (let i = 0; i < 2; ++i) 27 synthesizeKey("KEY_ArrowRight"); 28 // Select whitespace + <span> 29 for (let i = 0; i < " SELECTABLE ".length; ++i) 30 synthesizeKey("KEY_ArrowRight", { shiftKey: true }); 31 // Rip it off. 32 synthesizeKey("KEY_Delete"); 33 document.documentElement.removeAttribute("class"); 34 }); 35 }); 36 </script>