Html: Add autocorrect content attribute to HTMLElement

Created on 28 Mar 2018  路  17Comments  路  Source: whatwg/html

Like autocapitalize, autocorrect would turn on/off autocorrection on iOS. It would be good to have this iOS feature standardized.

additioproposal document conformance i18n-tracker impacts documentation

Most helpful comment

Someone from the WebKit team is looking at putting together a PR along the lines Domenic suggested, and I let them know that tests will also be expected for the PR to be approved,

All 17 comments

@dtapuska any interest in helping with this?

+1, I'm interested in this in Blink. /cc @yosinch

I recommend also adding "no-punctuate" option, bringing options to off|on|no-punctuate.

No-punctuate would imply that autocorrect is on, but removes the sometimes tedious problem of removing punctuation whenever two spaces are pressed.

Currently, to disable this behavior, it's all or nothing at the OS level (detailed here: http://osxdaily.com/2012/07/03/stop-the-period-automatically-typing-in-ios/)

Blink supports this on HTMLElement although the value isn't in the IDL; it is queried on the focused element.. See https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp?type=cs&l=1342

I support getting this spec'd. "on" and "off" are the only attribute values Blink supports (which appears to be case sensitive so there are likely some changes to Blink)

Anyone know if an autoselect attr - selects input, textarea value upon focus, deselects on blur, probably applies to contenteditable elements as well...? Has this been considered?

Ready to get started if there isn't already work being done.

@jfbrennan that's probably best discussed in a separate issue. There's nothing on file that I know of.

@annevk yes, will do. Thanks

https://github.com/whatwg/html/issues/3627, would appreciate feedback and sorry @rniwa for intruding here ;)

Autocorrect was working in blink (android) some time ago https://bugs.chromium.org/p/chromium/issues/detail?id=303883, but not now https://bugs.chromium.org/p/chromium/issues/detail?id=901839.
Maybe it was accidentally broken

We are about to add autocorrect to Mac Safari, since we found it is required for compatibility with Twitter for any browser that does autocorrection. Mac Safari might be the only browser to currently do so by default (following macOS platform convention).

We're interested in getting this attribute into the spec if there is still multi-implementer interest. What is specifically needed for a concrete proposal?

A spec PR would be ideal. spellcheck might be a useful precedent to align with, especially given how it has default states. autocapitalize is more recent and simpler in some ways (despite its many states), so probably also worth looking at.

The other thing that's needed is tests, as per https://whatwg.org/working-mode#changes. (Suspect Maciej is aware of this, but others might not be.)

Someone from the WebKit team is looking at putting together a PR along the lines Domenic suggested, and I let them know that tests will also be expected for the PR to be approved,

It's probably useful for content authors to turn off autocorrection for certain contexts, but iiuc the spec also will allow them to turn it on.

In that case, how is the relationship between language/orthography and autocorrection handled? For example, i wouldn't want my input of centre to be corrected to center, and as someone who works with more than one language i often struggle with search and text autocorrectors that don't even give me a choice to confirm a correction.

Should the HTML spec have any text to indicate that autocorrection, if turned on, must take into consideration the language of the text around the form element? Would it make sense to go further, like CSS does for hyphenation, to say that it only works if a language is declared?

Also, on a slightly different tack, should the spec allow or allude to a need for users to override the settings of the content author (eg. turn off AC if it is producing problems)?

It's probably useful for content authors to turn off autocorrection for certain contexts, but iiuc the spec also will allow them to turn it on.

In that case, how is the relationship between language/orthography and autocorrection handled? For example, i wouldn't want my input of centre to be corrected to center, and as someone who works with more than one language i often struggle with search and text autocorrectors that don't even give me a choice to confirm a correction.

Should the HTML spec have any text to indicate that autocorrection, if turned on, must take into consideration the language of the text around the form element? Would it make sense to go further, like CSS does for hyphenation, to say that it only works if a language is declared?

Also, on a slightly different tack, should the spec allow or allude to a need for users to override the settings of the content author (eg. turn off AC if it is producing problems)?

FWIW, iOS implementation doesn't turn off autocorrection if the user had manually turned it off. See the proposed spec text at https://github.com/whsieh/html/commit/3214ff25ef00aec1ca5bba7abe0a53c47df602f7#diff-36cd38f49b9afa08222c0dc9ebfe35ebR74483:

The user agent is permitted to automatically correct spelling errors while the user types. Whether spelling is automatically corrected while typing left for the user agent to decide, and may depend on the element as well as the user's preferences.

There's a concrete proposal now in https://github.com/whatwg/html/pull/5841 , so removing the needs concrete proposal label.

Adding document conformance since this addition will need implementation in conformance checkers (@sideshowbarker) and impacts documentation (@whatwg/documentation).

Was this page helpful?
0 / 5 - 0 ratings