Trigger spell check/remove markers if spell checker gets enabled/disabled.

With this change when spell checker is turned off the misspelling markers
disappear from the document (which is what a user expects and this currently
works in chromium because UI code takes care of that - with this change it may
stop). OTOH if spell checker is turned on again one would expect misspellings
will appear right away - in the currently focused editable at least. This is how
Gecko and Presto behave and this is what this patch does. Note it's not only
about restoring old markers because content might have changed or language might
have been switched. This is why new check is requested. This change may also
come in handy if spell checking language is changed. It would require restarting
spell checker on UI side on language change, though.

Since there might be an awful lot of text in the focused editable when spell
checker gets enabled, spell checking is chunked up. If asynchronous spell
checker is enabled whole text is checked. Otherwise only one chunk is checked
(the default chunk's size is set to 16KB but it might also be slightly bigger
since all chunks are aligned to the sentence boundary).

BUG=264737

Review URL: https://chromiumcodereview.appspot.com/21130005

git-svn-id: svn://svn.chromium.org/blink/trunk@156183 bbb929c8-8fbe-4397-9dbb-9b2b20218538
10 files changed
tree: 6bbf28949e3dd3fb2d896af1043f149a3e0bb4b7
  1. third_party/