[whatwg] Spellchecking mark III
mikko.rantalainen at peda.net
Tue Jan 20 02:16:10 PST 2009
Křištof Želechovski wrote:
> Spell checking of regions of text should be governed by the lang attribute,
> if any, and browser preferences; it would be switched off for language tags
> the spell-checking engine does not support, including custom ones.
> It is extremely annoying how Safari, although (supposedly) localized to
> Polish, wants all input to be in English.
I agree. I think that specifying the spellcheck attribute would be a
mistake. It allows only forcing the automatic spell checking on or off
but it doesn't help a bit to allow mixing different languages on a
Robert O'Callahan wrote:
> The browser can't know ahead of time that a text field is not supposed to
> contain natural-language text.
Yes it can, the lang attribute contains the required information. If the
page lies about its language, then there's abviously nothing the browser
can do to fix it.
Just specify that spell checking must follow the content language.
This way any already existing page that correctly specifies the content
language would turn automatic spell checking on/off as required. There's
no point trying to automatically spell check an unknown language so
there's no need to explictly turn off the spellchecking (assuming that
the content language is correctly specified).
As the lang attribute can be used in inner elements, too, it allows
mixing different languages on a single page and it allows UA to apply
different spell checkers to different parts.
At least the following use cases have been discussed in this thread:
- email subject field (e.g. lang="en" according to UI language perhaps?)
- email address field (lang="x-email-to, can be spellchecked against the
user's address book)
- web site address (lang="x-url", perhaps also follow type="url"?)
- product id (lang="x-proprietary")
- license plate (lang="x-proprietary")
- captcha (lang="x-proprietary")
- program code (lang="x-program-c++" perhaps?)
If the page does not specify any language, allow the UA to decide the
best method for its spell checking (leave the behavior explicitly
I used "x-proprietary" for a custom/special language above. RFC 3066
specifies UND (undefined) language code that could be used instead.
However, I think that the whatwg should specify that UND language code
is used to turn on the undefined (UA dependant heuristics) behavior for
selected inner elements.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 254 bytes
Desc: OpenPGP digital signature
More information about the whatwg