Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / style-keypress-events.html
blobb0d27703372a849ee539db1a08a6ff19482f2dcd
1 <body onload="setup()">
2 <p>cmd+b and cmd+i should generate a keydown event in contentEditable fields. Also, calling
3 preventDefault() in the keydown event should cancel the text styling.</p>
5 <div contentEditable id="test" style="border: 1px solid; padding: 4px;">
6 This is some sample text.<br><br><br><br>
7 </div>
8 <div>
9 <input type="checkbox" id="disable"><label for="disable">preventDefault() in keydown</label>
10 </div>
11 <div id="log"></div>
13 <script>
14 function setup()
16 var test = document.getElementById("test");
17 test.addEventListener("keydown", keydown, false);
19 var selection = window.getSelection();
20 selection.setPosition(test, 0);
21 selection.modify("extend", "forward", "sentence");
22 test.focus();
25 function log(msg)
27 var log = document.getElementById("log");
28 log.innerHTML += "<br>" + msg;
31 function keydown(event)
33 log("keydown");
34 if (document.getElementById("disable").checked)
35 event.preventDefault();
37 </script>
38 </body>