WebKit's new Spellcheck API

A simple spellcheck API landed in WebKit on June 8, 2011, based on Aryeh Gregor's proposal in Hironori Bono's SpellCheck API thread on the public-webapps mailinglist. It allows you to manually supply suggestions for misspelled words, or, stricly seen, ranges of text.

The following two methods have been added to <textarea>, <input> and editable elements.

  1. void addSpellcheckRange (unsigned long start, unsigned long length, DOMStringList suggestions[, unsigned short options]);
  2. void removeSpellcheckRange (SpellcheckRange range);

Example (right-click the word "Chromiuum")

You need a Chromium Nightly to use this feature.

var inputElement = document.getElementById ('api-example'); inputElement.addSpellcheckRange ( 4, 9, ['Chrome', 'Firefox', 'Opera', 'Internet Explorer'] );

-