Using the autocorrect="off" attribute does not seem to have any effect on desktop Safari. It works as specified here on mobile Safari: https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#//apple_ref/doc/uid/TP40008058-autocorrect STR: 1. Open http://codepen.io/anon/pen/Lpgvya on mobile Safari. 2. Type a non-word (e.g. "baz") into the text field. 3. Note that there is no autocorrection offered. 4. Open the same page on desktop Safari. 5. Type a non-word (e.g. "baz") into the text field. 6. Note that the autocorrect popup appears (assuming it has not been disabled system-wide). Tested on Safari 9.0.1 (11601.2.7.2), WebKit r192147, and iOS 9.1.
*** Bug 215198 has been marked as a duplicate of this bug. ***
Going to use this Bugzilla bug to track a fix for <rdar://problem/65061700>.
Created attachment 406056 [details] Just for EWS
Created attachment 406334 [details] Patch
Comment on attachment 406334 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406334&action=review > Source/WebCore/ChangeLog:3 > + Text input autocorrect="off" attribute ignored on Mac I have no doubt that we want this on for the Mac, but wouldn't we also want this on all WebKit platforms that have automatic spelling correction for much the same reasons?
(In reply to Darin Adler from comment #5) > Comment on attachment 406334 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=406334&action=review > > > Source/WebCore/ChangeLog:3 > > + Text input autocorrect="off" attribute ignored on Mac > > I have no doubt that we want this on for the Mac, but wouldn't we also want > this on all WebKit platforms that have automatic spelling correction for > much the same reasons? I think we do! This patch merely supports the attribute on macOS, though. We will want separate bugs for the other platforms where we don’t support this attribute yet (which, as I understand, are Windows, GTK, and WPE).
We're adding this in part because it affects Twitter for any browser that does automatic spelling correction (as Mac Safari does, following macOS platform convention). For benefit of readers of this bug, here's a description of the Twitter issue, and my analysis of why "autocorrect" attribute support will fix it: --------- Autocorrect in Twitter search field causes Twitter search to give confusingly wrong results. When you type something in the Twitter search field, a drop down menu appears with choices to click. If that something looks like a spelling or grammar error (as usernames often are), then we helpfully autocorrect it as soon as focus leaves the field. Clicking makes focus leave the field. And Twitter immediately pops off the menu when the correction is entered, and does this before processing the click, when then clicks through to a trend below. Thus, you get a random trend search instead of the user you meant to click on. ## Sample steps to reproduce: 1. Go to https://twitter.com on a Mac in Safari 2. Click in the search field in the upper right 3. Type greendog (no space) 4. Click on a search result, e.g. the third, Green Dog Films ## Results: The browser goes to a search page for a random trend. In the case of my screen recording, it goes to In-N-Out. WAT. ## Other browsers: Mac Chrome and MacFirefox don’t experience this bug because they do not seem to have autocorrect at all; they highlight what they think is a spelling error but don’t auto fix it. iPad and iPhone Safari don’t experience the bug either. Why? Twitter loads the search field with many attributes to try to suppress autocorrect: <input aria-activedescendant="typeaheadFocus-0.8970720798063739" aria-autocomplete="list" aria-label="Search query" aria-owns="typeaheadDropdown-3" autocapitalize="sentences" autocomplete="off" autocorrect="off" placeholder="Search Twitter" role="combobox" spellcheck="true" enterkeyhint="search" type="text" dir="auto" data-focusable="true" class="r-30o5oe r-1niwhzg r-17gur6a r-1yadl64 r-deolkf r-homxoj r-poiln3 r-7cikom r-1ny4l3l r-1sp51qo r-1lrr6ok r-1dz5y72 r-1ttztb7 r-13qz1uu" data-testid="SearchBox_Search_Input" value="greendog" aria-expanded="true"> I believe the one doing the trick on iOS is `autocorrect=off`. This is a nonstandard attribute that we support on iOS only. I suspect enabling it for macOS would fix this egregious Twitter bug. In addition to that, we should probably standardize autocorrect=off, as this Twitter search bug demonstrates the use case.
google.com also has "autocorrect=off" on the main search field.
Committed r265509: <https://trac.webkit.org/changeset/265509> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406334 [details].