[whatwg] <input type="text" accept="">

L. David Baron wrote:
> The original use case, as I understand it, was roughly "authors want 
> to disable spell checking on some textareas".

Authors should not have such control.  Spell checking is a user agent 
feature for the *user* and the UA should allow the user to turn it on or 
off whenever they like.  Why should the author have any say about that?

> Is the reason that they want to disable spellchecking only that the 
> contents are not "text/plain"? I doubt it.  Doing what you propose, 
> especially if it is extended to other features, will just encourage 
> authors to use incorrect MIME types to get particular side-effects in 
> particular user agents.

If the MIME type is to be used for anything related to spell checking, 
it should be used in a way that improves the spell checker's logic, not 
determine whether or not to enable it.  For example, given a textarea 
with either accept="text/plain", no accept attribute (since text/plain 
should be considered the default for textarea); or any unknown or 
unsupported MIME type, then the UA can just use its ordinary spell 
checking algorithm.

If, however, it uses accept="text/html" or "application/xml", etc., the 
spell checker could be made more intelligent by ignoring elements, 
attributes and their values (except for some special cases, like 
alt="..." and title="...", where spell checking those values may still 
be useful).

For determining whether or not to provide spell checking for <input 
type="text">, browsers should generally do so by default, unless it can 
be determined that it logically wouldn't be desired by the user.

We will soon have type="email", "url", etc. which covers quite a few use 
cases where spell checking wouldn't be desired.  For other cases, 
browsers could use more intelligence to guess what the field is expecting.

e.g. Password managers in UAs already guess fairly accurately when a 
username is being entered and that's another case where spell checking 
probably wouldn't be desired.

For other unknown fields, browsers could use some Artificial 
Intelligence (AI) to learn what a user typically enables and disables 
spell checking for.  e.g. If a user constantly disables spell checking 
for fields with <input name="address1"> or a <label>Address</label> 
associated with the control (or similar variations), the AI could use 
that to determine that spell checking wouldn't be desired for similar 
fields.

Using this approach, authors have no direct control over user agent 
behaviour, like spell checking.  Instead, it is in their best interest 
to provide accurate information to enhance the user's experience.  So it 
seems less likely to be abused by authors providing incorrect 
information in the hope of achieving specific behaviour.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Sunday, 11 June 2006 06:09:28 UTC