Re: SpellCheck API?

2011/5/11 Aryeh Gregor <Simetrical+w3c@gmail.com>:
> Here's an alternative suggestion that addresses the issues I had
> above, while (I think) still addressing all your use-cases.  Create a
> new interface:
>
> interface SpellcheckRange {
>  readonly unsigned long start;
>  readonly unsigned long length;
>  readonly DOMStringList suggestions;
>  readonly unsigned short options = 0;
>  const unsigned short NO_ERROR = 1;
>  const unsigned short ADD_SUGGESTIONS = 2;
> }
>
> "length" could be "end" instead, whichever is more consistent.
> options is a bitfield.  NO_ERROR means that there is no error in this
> range, and the UA should not mark any words there as being errors even
> if the spellcheck attribute is enabled.  (If the author wants to
> completely disable built-in suggestions, they can set
> spellcheck=false.)  ADD_SUGGESTIONS means that the provided
> suggestions should be given in addition to the UA's suggestions,
> instead of replacing them -- by default, the UA's suggestions for that
> range are replaced.  (The default could be the other way around if
> that's better.)  These two features allow the author to control
> default UA suggestions without being able to know what they are, so
> there's no privacy violation.

With this model, i'd want the UA to provide instances for words which
are misspelled according to its standard dictionary but which are in
its user's custom dictionary. The web page can try to make
suggestions, but generally the UA will choose to ignore the words
because it knows that the user is happy with the current word.

Received on Wednesday, 11 May 2011 22:29:42 UTC