Update my nickname.
[WebKit-https.git] / LayoutTests / fast / events / before-input-events-prevent-recomposition.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4     <input id="editable" contenteditable onbeforeinput=preventDeleteByComposition(event) value="foo"></input>
5     <script src="../../resources/dump-as-markup.js"></script>
6     <script type="text/javascript">
7         Markup.description("To manually test this, try to recompose text. The original text should not be modified.");
8         if (window.internals)
9             internals.settings.setInputEventsEnabled(true);
10
11         editable.focus();
12
13         if (window.textInputController) {
14             Markup.dump("editable", "initial composition text");
15             textInputController.setMarkedText("foo", 0, 3);
16             Markup.dump("editable", "after preventing recomposition");
17             textInputController.setMarkedText("garply", 0, 6);
18             Markup.dump("editable", "after selecting a new composition string");
19             textInputController.insertText("garply");
20             Markup.dump("editable", "after committing the new composition string");
21         }
22
23         function preventDeleteByComposition(event)
24         {
25             if (event.inputType == "deleteByComposition")
26                 event.preventDefault();
27         }
28     </script>
29 </body>
30 </html>