REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection...
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitCocoa / contenteditable-and-textarea.html
1 <head>
2     <meta name="viewport" content="width=device-width">
3         <style>
4         body {
5             width: 100%;
6             height: 100%;
7             margin: 0;
8         }
9
10         #source, #editor {
11             width: 100%;
12             height: 200px;
13             font-size: 200px;
14             white-space: nowrap;
15         }
16
17         #source {
18             overflow: hidden;
19         }
20
21         #editor {
22             border: black 1px solid;
23         }
24         </style>
25 </head>
26
27 <body>
28     <div contenteditable id="source">Hello world</div>
29     <textarea contenteditable id="editor"></textarea>
30     <script>
31     function postEventType(event) {
32        webkit.messageHandlers.testHandler.postMessage(event.type);
33     }
34
35     editor.addEventListener("drop", postEventType);
36     editor.addEventListener("dragenter", postEventType);
37     editor.addEventListener("dragover", postEventType);
38     editor.addEventListener("dragleave", postEventType);
39     editor.addEventListener("dragstart", postEventType);
40
41     let text = source.childNodes[0];
42     getSelection().setBaseAndExtent(text, 0, text, text.data.length);
43     </script>
44 </body>