Closed Bug 1725806 Opened 3 years ago Closed 1 month ago

Implement autocorrect attribute

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

Unspecified
All
enhancement

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete)

Attachments

(6 files)

From https://phabricator.services.mozilla.com/D118945

It would be nice to get that HTML autocorrect PR landed before we ship, but I don't see a problem enabling it on Nightly/early Beta. And we should send an intent to ship. Hope that helps!

WHATWG issue: https://github.com/whatwg/html/issues/3595
WHATWG PR: https://github.com/whatwg/html/pull/5841

Ok, so the PR isn't in the spec yet.

Severity: -- → N/A
Priority: -- → P3
Blocks: 1881783
Duplicate of this bug: 1794629

Simon, do you know current status of https://github.com/whatwg/html/pull/5841? I would like to support 'autocorrect' attribute for MacOS's "text replacement" feature. I don't know whether I have to wait until its PR is merged.

Flags: needinfo?(zcorpan)

It seems to me it's ready to land (checkboxes are checked, spec PR and wpt PR are reviewed), modulo open discussion threads. I've pinged domenic and annevk in https://whatwg.org/chat

Flags: needinfo?(zcorpan)

FWIW, the pr is on WHAT WG meeting agenda, so I guess it might get landed quite soon.

makoto, do you think you could take a look at the pr and see if it looks ok to you, and report any issues in the pr?

Flags: needinfo?(m_kato)

I will look it this week.

Thanks. Looks like the pr was updated
https://github.com/whatwg/html/pull/5841

Flags: needinfo?(m_kato)
Assignee: nobody → m_kato

Add autocorrect flag to InputContext to handle this by widget.

Since autocorrect is on-by-default, mAutocorrect is true by constructor.

But, I would like off-by-default in Chrome. Since Chrome UI may not want to
enable autocorrect by default such as bug 1881783.

If autocorrect is turned on (this is default), we turn on text replacement.

And, autocorrect attribute is on-by-default, and it is different for
spellcheck, so I would like to remove ui.autocorrectDefault preference.

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/312b21ee0a22 Part 1. Add autocorrect attribute in html parser. r=dom-core,hsivonen https://hg.mozilla.org/integration/autoland/rev/4eadad314e19 Part 2. Implement autocorrect attribute. r=dom-core,webidl,saschanaz,hsivonen https://hg.mozilla.org/integration/autoland/rev/ddef034c455e Part 3. Autocorrect support in InputContext. r=masayuki https://hg.mozilla.org/integration/autoland/rev/ab6098fafbbd Part 4. Support autocorrect on macOS backend. r=masayuki https://hg.mozilla.org/integration/autoland/rev/cdf733bf2fb2 Part 5. Support autocorrect on GeckoView backend. r=geckoview-reviewers,owlish https://hg.mozilla.org/integration/autoland/rev/b98daff2809a Part 6. Support autocorrect on UIKit backend. r=masayuki
Regressions: 1927785
Blocks: 1927977

FF134 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/36919

I just tried this on the FF134 nightly build - checking dom.forms.autocorrect is indeed enabled. The MDN autocorrect example code shows when the property is defined but does not appear to autocorrect (i.e. if I enter "carot" in the vegetable box I expect it to correct).
Note that this code does work on Safari, which while not fully compliant with the spec should work in the same way for attribute being set like this.

  1. Is the implementation complete? If not, what is missing
  2. Is there anything else special I have to do to get this to work?
Flags: needinfo?(m_kato)

(In reply to Hamish Willee from comment #19)

FF134 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/36919

I just tried this on the FF134 nightly build - checking dom.forms.autocorrect is indeed enabled. The MDN autocorrect example code shows when the property is defined but does not appear to autocorrect (i.e. if I enter "carot" in the vegetable box I expect it to correct).
Note that this code does work on Safari, which while not fully compliant with the spec should work in the same way for attribute being set like this.

  1. Is the implementation complete? If not, what is missing

Although I don't know who write this sample, this autocorrect doesn't fix a word automatically. If using Firefox/macOS, you have to register the word in text substitution (see https://support.apple.com/en-vn/guide/mac-help/mh35735/mac). If Fenix, it depends on virtual keyboard implementation (Gecko only gives a hint to keyboard.)

Flags: needinfo?(m_kato)

I wrote that sample - it worked on Safari on macOS on browserstack. Thanks for the answer though. It indicates something I may not have captured sufficiently in the docs - that this enables autocorrection using native methods - and those methods may have other requirements.

Note, though, I'm still a bit unconvinced of this in Windows desktop. If I enable autocorrection and incorrect-text on the device (Settings > Devices> Typing) and try the sample then the word carot is highlighted as an error - i.e. the system knows this is incorrect. However it is not autocorrected on the input where autocorrection is enabled.

(In reply to Hamish Willee from comment #22)

Note, though, I'm still a bit unconvinced of this in Windows desktop. If I enable autocorrection and incorrect-text on the device (Settings > Devices> Typing) and try the sample then the word carot is highlighted as an error - i.e. the system knows this is incorrect. However it is not autocorrected on the input where autocorrection is enabled.

There is no API to provide a hint whether autocorrect or not on Windows. Each software keyboard type seems to have the register value whether showing autocorrect widget.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: