Setting innerText to an empty string on editable div loses focus
[WebKit-https.git] / LayoutTests / platform / mac / editing / pasteboard / paste-and-match-style-selector-event.html
1 <html>
2     <head>
3         <script>
4             var onPasteEventFired = false;
5
6             function test() {
7                 if (window.layoutTestController)
8                     layoutTestController.dumpAsText();
9
10                 var result = document.getElementById("result");
11                 window.getSelection().setBaseAndExtent(result, 0, result, 7);
12                 document.execCommand("Cut");
13                 if (window.textInputController) {
14                     textInputController.doCommand("pasteAsPlainText:");
15                     if (onPasteEventFired)
16                         result.innerText = "SUCCESS";
17                 }
18             }
19             function onpastehandler(event) {
20                 onPasteEventFired = true;
21             }
22         </script>
23     </head>
24     <body onload="test()" onpaste="onpastehandler(event)" contenteditable>
25         This tests that sending the pasteAsPlainText selector, which is what happens when you paste and match style, fires the onpaste event.
26         <div id="result">FAILURE</div>
27     </body>
28 </html>