-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #5841
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.
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 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?
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. |
Thanks for the nudge @danielhjacobs. This clearly got lost. I rebased this (again) and added commits to account for recent HTML refactoring efforts. At least as far as the bots are concerned this is now in a state where it can be merged, but I'll double check in the next WHATNOT call I can attend. |
@smaug---- @masayuki-nakano I think this is ready now, but happy to wait a bit so you can take a look as well before it lands. |
https://bugs.webkit.org/show_bug.cgi?id=246344 rdar://101036922 Reviewed by NOBODY (OOPS!). Align with the standardized version of the autocorrect attribute, which does not support Email, URL, and Password fields and does not treat the empty string value in a special way. For details see whatwg/html#5841 Test is upstreamed at web-platform-tests/wpt#25073 * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::shouldAutocorrect const):
<var>element</var>'s <span>form owner</span>'s <code data-x="attr-autocorrect">autocorrect</code> | ||
attribute.</p></li> | ||
|
||
<li><p>Return <span data-x="concept-autocorrection-on">on</span>.</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.
As long as looking the implementations of both Blink and WebKit, it is on
by default.
Someone may want on-by-default
like spellcheck
attribute, but it is OK for me.
For whatwg/html#5841. Co-authored-by: Anne van Kesteren <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=246344 rdar://101036922 Reviewed by NOBODY (OOPS!). Align with the standardized version of the autocorrect attribute, which does not support Email, URL, and Password fields and does not treat the empty string value in a special way. For details see whatwg/html#5841 Test is upstreamed at web-platform-tests/wpt@2767f5f * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/w3c-import.log: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::shouldAutocorrect const):
https://bugs.webkit.org/show_bug.cgi?id=246344 rdar://101036922 Reviewed by NOBODY (OOPS!). Align with the standardized version of the autocorrect attribute, which does not support Email, URL, and Password fields and does not treat the empty string value in a special way. For details see whatwg/html#5841 Test is upstreamed at web-platform-tests/wpt@2767f5f * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/w3c-import.log: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::shouldAutocorrect const):
https://bugs.webkit.org/show_bug.cgi?id=246344 rdar://101036922 Reviewed by Wenson Hsieh. Align with the standardized version of the autocorrect attribute, which does not support Email, URL, and Password fields and does not treat the empty string value in a special way. For details see whatwg/html#5841 Test is upstreamed at web-platform-tests/wpt@2767f5f * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/w3c-import.log: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/editing/editing-0/autocorrection/autocorrection-expected.txt: Added. * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::shouldAutocorrect const): Canonical link: https://commits.webkit.org/282792@main
…, a=testonly Automatic update from web-platform-tests Add tests for the autocorrect attribute For whatwg/html#5841. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: 2767f5f395242e24ed3d7c29eed464c99b06514e wpt-pr: 25073
…, a=testonly Automatic update from web-platform-tests Add tests for the autocorrect attribute For whatwg/html#5841. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: 2767f5f395242e24ed3d7c29eed464c99b06514e wpt-pr: 25073
…, a=testonly Automatic update from web-platform-tests Add tests for the autocorrect attribute For whatwg/html#5841. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: 2767f5f395242e24ed3d7c29eed464c99b06514e wpt-pr: 25073
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 )