Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / pasting-empty-html-falls-back-to-text.html
blobe3478490f3bc6b165d20a33a3e83884a0da8a106
1 <html>
2 <head>
3 <script>
4 function handleCopy(event)
6 event.clipboardData.setData('text/html', '');
7 event.clipboardData.setData('text/plain', '\nPASS');
8 event.preventDefault();
11 function runTest()
13 if (!window.testRunner)
14 return;
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');
26 </script>
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.
29 </body>
30 </html>