Repro case as a layout test:
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>
<input id=input>
<textarea id=textarea></textarea>
<script>
spellcheck_test(
'<input>',
document => {
const input = document.querySelector('input');
document.getSelection().setClipboardData('zz.');
input.focus();
document.execCommand('paste');
document.execCommand('paste');
input.blur();
},
'<input value="zz.zz.">',
'Markers should not be added to INPUT without focus.');
</script>
The current implementation prevents adding marker to blurred <input> by calling SpellCheckerRequester::cancelCheck when <input> is blurred, which, however, only cancels the current request being handled. If the current request is not in the <input>, or the <input> has multiple pending requests, markers will still be added.
Comment 1 by bugdroid1@chromium.org
, Feb 25 2017