Reduce the amount of memory needed to store Options.
[WebKit-https.git] / LayoutTests / fast / events / input-events-paste-rich-datatransfer.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4     <div id="source" contenteditable onbeforeinput=beforeInput(event)><span style="color:red"><b>LayoutTests<i>are<u>fun!</i></u></b></span></div>
5     <div id="destinationHTML" contenteditable></div>
6     <div id="destinationPlain" contenteditable></div>
7     <script src="../../resources/dump-as-markup.js"></script>
8     <script>
9         Markup.description(`To manually test this, copy and paste into the first contenteditable. The following contenteditables should reflect the pasted contents.`);
10         source.focus();
11         document.execCommand("selectAll", false, null);
12
13         if (window.internals)
14             internals.settings.setInputEventsEnabled(true);
15
16         if (window.testRunner) {
17             testRunner.execCommand("Cut");
18             testRunner.execCommand("Paste");
19         }
20         source.blur();
21
22         Markup.dump("destinationHTML", "destination after pasting (text/html)");
23         Markup.dump("destinationPlain", "destination after pasting (text/plain)");
24
25         function beforeInput(event)
26         {
27             if (event.inputType !== "insertFromPaste")
28                 return;
29
30             destinationHTML.innerHTML = event.dataTransfer.getData("text/html");
31             destinationPlain.textContent = event.dataTransfer.getData("text/plain");
32             event.preventDefault();
33         }
34     </script>
35 </body>
36 </html>