[whatwg] Spellchecking mark III

Mikko Rantalainen 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
single page.

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
undefined).

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.

-- 
Mikko


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090120/87b4e2aa/attachment.pgp>


More information about the whatwg mailing list