Closed Bug 2021128 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 58264 - [Editing] Respect autocorrect="off" for Windows touch keyboard

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 58264 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/58264
Details from upstream follow.

Pranav Modi <pranavmodi@microsoft.com> wrote:

[Editing] Respect autocorrect="off" for Windows touch keyboard

The HTML autocorrect attribute (part of the WHATWG HTML standard) lets
web authors disable autocorrect on \<input> and \<textarea> elements by
setting autocorrect="off". The Windows touch keyboard ignores this and
still autocorrects words. For example, typing "truf" + space yields
"true " instead of preserving "truf ".

To reproduce:

  1. On a Windows touch-enabled device, open a page with
    \<input autocorrect="off">.
  2. Tap the field to bring up the touch keyboard. 3. Type a misspelled
    word (e.g. "truf") then tap space. 4. Observe: the touch keyboard
    replaces "truf" with "true".

TSF's InputScope has no autocorrect field, so the touch keyboard is
unaware of the page's preference and always autocorrects.

Fix: snapshot the document buffer in TSFTextStore::RequestLock() before
granting the lock. After the lock, if autocorrect="off" and committed
text was replaced (not appended) without an active IME composition,
revert the buffer and skip the commit. Normal typing and IME composition
are unaffected.

Bug: 487613498
Change-Id: Idcb07ce307a945d8f20250ca6c35d47e2bd8bbaf
Reviewed-on: https://chromium-review.googlesource.com/7609541
WPT-Export-Revision: 586bae7e2236151304cb256aac1bb3072b1be29c

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e873b281aad7 https://hg.mozilla.org/integration/autoland/rev/3cd92260ea0d [wpt PR 58264] - [Editing] Respect autocorrect="off" for Windows touch keyboard, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
You need to log in before you can comment on or make changes to this bug.