47 lines
872 B
HTML
47 lines
872 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../../editing/editing.js"></script>
|
|
<style>
|
|
@font-face {
|
|
font-family: Ahem;
|
|
src: url("../../resources/Ahem.ttf");
|
|
}
|
|
|
|
body {
|
|
-webkit-writing-mode: horizontal-bt;
|
|
font: 20px/1 Ahem;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
#test {
|
|
display: inline-block;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 200px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="test" contenteditable="true"></div>
|
|
<script>
|
|
if (window.internals)
|
|
internals.setContinuousSpellCheckingEnabled(true);
|
|
|
|
var test = document.getElementById("test");
|
|
|
|
typeText("a mispelled", test);
|
|
queueCommand(() => window.internals && internals.updateEditorUINowIfScheduled()); // Trigger spell checking
|
|
|
|
function typeText(text, element)
|
|
{
|
|
element.focus();
|
|
for (const c of text)
|
|
typeCharacterCommand(c);
|
|
element.blur();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|