4 function handleCopy(event)
6 event.clipboardData.setData('text/html', '');
7 event.clipboardData.setData('text/plain', '\nPASS');
8 event.preventDefault();
13 if (!window.testRunner)
15 testRunner.dumpAsText();
17 document.body.addEventListener('copy', handleCopy);
18 document.execCommand('copy');
19 var selection = window.getSelection();
20 var range = document.createRange();
21 range.selectNode(document.getElementById('description'));
22 selection.addRange(range);
23 selection.collapseToEnd();
24 document.execCommand('paste');
27 <body onload="runTest()" contenteditable="true">
28 <p id="description">This test requires DRT. It verifies that pasting in a richly editable area falls back to text if the HTML content is an empty string.