Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <div id="src"> | |
| 5 <div>Some text.</div> | |
| 6 <div>Some other text.</div> | |
| 7 </div> | |
| 8 <div contenteditable="true" id="dest"></div> | |
| 9 <div id="log"></div> | |
| 10 <script> | |
| 11 // A repro of crbug.com/580950, which crashes in debug build. | |
| 12 document.body.onload = function() { | |
| 13 var src = document.getElementById('src'); | |
| 14 var dest = document.getElementById('dest'); | |
| 15 var sel = window.getSelection(); | |
| 16 dest.addEventListener('webkitEditableContentChanged', () => dest.innerHTML = ''); | |
|
yosin_UTC9
2016/01/27 08:40:29
nit: It is better to insert non-empty string and n
Xiaocheng
2016/01/27 08:50:56
Done.
| |
| 17 | |
| 18 test(function() { | |
| 19 sel.setBaseAndExtent(src, 0, src, src.childNodes.length); | |
| 20 document.execCommand('copy'); | |
| 21 dest.focus(); | |
| 22 document.execCommand('paste'); | |
| 23 | |
| 24 assert_equals(dest.innerHTML, ''); | |
| 25 }, 'A pasting that fires a webkitEditableContentChanged event should not cra sh.'); | |
| 26 } | |
| 27 </script> | |
| OLD | NEW |