The root-cause is that when resuming the check via [`mozInlineSpellChecker::DoSpellCheck`](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellChecker.cpp#1298), the ["soft text" is rebuilt](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp#227,243,257,259,758-762). This leads to restarting the spellchecking at the previous [DOM word separator](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp#66-79). Fixing this requires a deeper understanding of `mozInlineSpellChecker`.
Bug 1687263 Comment 18 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The root-cause is that when resuming the check via [`mozInlineSpellChecker::DoSpellCheck`](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellChecker.cpp#1298), the ["soft text" is rebuilt](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp#227,243,257,259,758-762). This leads to restarting the spellchecking at the previous [DOM word separator](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp#66-79). Edit: not restarting the spellchecking in case it's [resumed](https://searchfox.org/mozilla-central/rev/31b583bbcc9cfaacd93e785c05dda0e87d7cca4e/extensions/spellcheck/src/mozInlineSpellChecker.cpp#1562) could work. I guess it would have to be ensured that the DOM didn't change meanwhile. That is, restart only if not resumed because of observing any DOM events.