-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the autocorrect attribute to the HTML spec. #5841
base: main
Are you sure you want to change the base?
Conversation
@whsieh to pass the participation check, you need to make your membership in https://github.com/apple-whatwg publicly visible. |
Done, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is difficult that all user agents support autocorrection of all natural language.
Because autocorrection interfere with input or editing on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good; thanks so much for working on this!
Most comments are editorial, but there's one potentially substantial issue in the processing model, related to presence/absence of the attribute vs. its on/off state.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
… due to the inheriting category changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source
Outdated
<li><p>If the <code data-x="attr-autocorrect">autocorrect</code> content attribute is present on | ||
<var>element</var>, and its value is not the empty string, then return the <span>autocorrection | ||
state</span> of the attribute.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whsieh one more question. Why does this specifically check for the empty string? Is that not handled by the missing value default? Is the intent here that <input autocorrect form=x><form id=x autocorrect=no></form>
results in no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whsieh one more question. Why does this specifically check for the empty string? Is that not handled by the missing value default? Is the intent here that
<input autocorrect form=x><form id=x autocorrect=no></form>
results in no?
...that's a good question. I think I was just trying to be consistent with the behavior of the autocapitalize
attribute (and state), though for autocorrect
it probably makes more sense to default to "on"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I guess I don't care too strongly.
Another oddity I noticed is that autocapitalize
doesn't return the used concept, but autocorrect
does. That seems more useful so I suggest we keep that. Perhaps it's worth a note over in autocapitalize
or someone more ambitious than me could try to clean it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be sure that the case @annevk mentioned is tested? The tests do look pretty comprehensive, so maybe it is already :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are tested as far as I can tell and match the current text.
Should autocorrection be language-dependent? How does the browser know which dictionary to use to look up words, and does it alter its triggers for lookup for a script that doesn't use spaces, such as Chinese or Japanese or Thai (the latter has spaces but for phrase separation, rather than word), or for scripts that use different punctuation marks than English? Is it able to tell which language a user is using when they fill in form fields if that user fills in forms in more than one language? |
Much like with autocapitalization, this does not attempt to define how autocorrection works. It merely acknowledges that it's a feature of input methods such as virtual keyboards that at times is useful to disable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this back up! What's the reason for not using the same behavior of inheriting from the editing host as autocapitalize does?
|
||
<dl> | ||
<dt><dfn data-x="concept-autocorrection-on">on</dfn> | ||
<dd>The user agent is permitted to automatically correct spelling errors while the user types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use "may" and "must not"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used should not as this is about UI.
source
Outdated
<li><p>If the <code data-x="attr-autocorrect">autocorrect</code> content attribute is present on | ||
<var>element</var>, and its value is not the empty string, then return the <span>autocorrection | ||
state</span> of the attribute.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be sure that the case @annevk mentioned is tested? The tests do look pretty comprehensive, so maybe it is already :)
I'm not sure, but note that @whsieh thoughts? |
How would a webpage know whether autocorrection is supported by the UA or not? Site might provide its own correction as a fallback. |
Yeah that would apply to spellchecking and autocapitalization as well. I could see two options:
I'm not sure we should do either until it becomes a concrete problem for someone though as there's also a question to what extent web developers would care about less common OSes. |
Issue: #3595
/acknowledgements.html ( diff )
/dom.html ( diff )
/form-elements.html ( diff )
/forms.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/input.html ( diff )
/interaction.html ( diff )