зеркало из https://github.com/mozilla/pjs.git
Bug 718546. (Av1) bug389321-1.html: Use EventUtils sendChar() to send char, not sendKey(). r=ehsan.
This commit is contained in:
Родитель
bf839e7a9c
Коммит
4dfec4a5a9
|
@ -4,12 +4,14 @@
|
|||
<body>
|
||||
<span contenteditable id="t" style="border: 1px dashed green; min-height: 2px; padding-right: 20px;"> </span></body>
|
||||
<script>
|
||||
// Only focus the span to put the caret at its beginning
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
|
||||
// Focus the span to put the caret at its beginning.
|
||||
var area = document.getElementById('t');
|
||||
area.focus();
|
||||
|
||||
// Do nothing else.
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,14 +4,15 @@
|
|||
<body>
|
||||
<span contenteditable id="t" style="border: 1px dashed green; min-height: 2px; padding-right: 20px;"> </span></body>
|
||||
<script>
|
||||
// Enter a character in the span and delete it
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
|
||||
// Focus the span to put the caret at its beginning.
|
||||
var area = document.getElementById('t');
|
||||
area.focus();
|
||||
|
||||
sendKey("W"); // enter a character
|
||||
// Enter a character in the span then delete it.
|
||||
sendChar("W");
|
||||
sendKey("BACK_SPACE");
|
||||
</script>
|
||||
</body>
|
||||
|
|
Загрузка…
Ссылка в новой задаче