blob: 1826793ec675d3446ea5bc6cf82dbc0888841154 [file] [log] [blame]
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<title>Undo Autocorrection Test</title>
</head>
<body>
<div><p>This test verifies the behavior of undoing autocorrection.</p>
<p>Type "the ". Set font to bold, then type "me". Set font to regular, then type "sage". After seeing the correction panel, type whitespace to accept the correction (automated). Undo the autocorrection. You should see the second word being reverted to "message" with "me" in bold font.</p>
<p style="color:green">Note, this test can fail due to user specific spell checking data. If the user has previously frequently revert 'message' to 'mesage'. To fix this, remove all files in ~/Library/Spelling, then kill AppleSpell.service process.</p>
<div contenteditable id="root2" class="editing">
<span id="test"></span>
</div>
<script>
document.getElementById('root2').focus();
document.execCommand('insertText', false, 'the ');
document.execCommand('bold', false, null);
document.execCommand('insertText', false, 'me');
document.execCommand('bold', false, null);
document.execCommand('insertText', false, 'sage');
setTimeout(function () {
document.execCommand('insertText', false, ' ');
}, 500);
</script>
</body>
</html>