Web-Facing Change PSA: InputEvent types for deletion commands on non-collapsed selections

232 views
Skip to first unread message

Chromestatus

unread,
Feb 5, 2026, 12:58:33 AMFeb 5
to blin...@chromium.org, prana...@microsoft.com
Contact emails
prana...@microsoft.com

Specification
https://w3c.github.io/input-events/#interface-InputEvent-Attributes

Summary
Reports accurate inputType values for deletion keyboard shortcuts on selected text. When deletion commands like Ctrl+Backspace or Ctrl+Delete are used with selected text in contenteditable elements, the beforeinput and input events now report deleteContentBackward or deleteContentForward instead of deleteWordBackward or deleteWordForward. This enables web developers to correctly understand what editing operation occurred and implement reliable undo/redo or custom editing behaviors.

Blink component
Blink>Editing>InputEvent

Web Feature ID
input-event

Risks


Interoperability and Compatibility
No information provided

Gecko: No signal (https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType)

WebKit: Shipped/Shipping (https://webkit.org/blog/7358/enhanced-editing-with-input-events)

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No information provided


Debuggability
No information provided

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes




Tracking bug
https://issues.chromium.org/issues/41423062

Estimated milestones
Shipping on desktop145
Shipping on Android145
Shipping on iOS145


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5173317243895808

This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Feb 5, 2026, 12:11:08 PMFeb 5
to Pranav Modi, blink-dev

On 2/4/26 9:58 p.m., Chromestatus wrote:

Contact emails
prana...@microsoft.com

Specification
https://w3c.github.io/input-events/#interface-InputEvent-Attributes

Summary
Reports accurate inputType values for deletion keyboard shortcuts on selected text. When deletion commands like Ctrl+Backspace or Ctrl+Delete are used with selected text in contenteditable elements, the beforeinput and input events now report deleteContentBackward or deleteContentForward instead of deleteWordBackward or deleteWordForward. This enables web developers to correctly understand what editing operation occurred and implement reliable undo/redo or custom editing behaviors. 
Changing the attribute value here seems like it could break sites - have you done any compat analysis?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6984317b.050a0220.baa59.057d.GAE%40google.com.

Pranav Modi

unread,
Feb 11, 2026, 9:39:47 AMFeb 11
to blink-dev, Mike Taylor

Doing a compat analysis for this change does not look straightforward to me as the change that is being proposed, happens in a specific use-case where there is a modifier+key combination (Ctrl+Backspace, Ctrl+Delete, etc.) while having a non-collapsed selection.
That said, for a site to actually break from this, it would need to:

  1. Listen for beforeinput/input events,
  2. Specifically branch on inputType === "deleteWordBackward" (or similar granularity types). This condition will be impacted only in case of presence of non-collapsed selection and deletion via modifier keys.
  3. Not have a handler for deleteContentBackward/deleteContentForward — which they'd already need for plain Backspace/Delete (Any site handling input events for deletion already handles deleteContentBackward/deleteContentForward (since those are what plain Backspace/Delete produce), so receiving these types for Ctrl+Backspace with a selection will naturally fall into existing code paths.).

As this appears to be rare scenario, our motivation is to make the event spec compliant along with publishing a PSA which should be a sufficient enough mitigation. Also note that this change is behind a runtime flag (InputEventsDeleteNonCollapsedSelection ), so we can quickly disable it if any issues surface post-launch.

Daniel Bratell

unread,
Feb 11, 2026, 10:29:20 AMFeb 11
to Pranav Modi, blink-dev, Mike Taylor

Searching the HTML Archive and github can help you get an idea about how they are used and the effects of renaming or removing them.

Just looking at https://github.com/search?q=deleteWordBackward+language%3AJavaScript&type=code&l=JavaScript there is quite a bit of code. I didn't check to see if any of them would break, but hopefully such an analysis is not too hard.

/Daniel

PhistucK

unread,
Feb 11, 2026, 12:27:27 PMFeb 11
to Daniel Bratell, Pranav Modi, blink-dev, Mike Taylor

Pranav Modi

unread,
May 8, 2026, 4:33:10 AM (13 days ago) May 8
to blink-dev, PhistucK, Pranav Modi, blink-dev, Mike Taylor, Daniel Bratell

Compat analysis: Analyzed ~2,200 files across JavaScript and TypeScript on GitHub for both deleteWordBackward and deleteWordForward usage, with full source context.

Change scope: In Chromium only, when a non-collapsed selection exists and the user presses Ctrl+Backspace/Delete, inputType changes from deleteWordBackward/Forward to deleteContentBackward/Forward. Caret behavior is unchanged.

Results: Of ~2,200 files, 10 unique repos (after deduplicating forks) check deleteWord* without also handling deleteContent*. Of those:

  • 3 are typing test apps where the trigger scenario (select text → Ctrl+Backspace) doesn't arise in normal use
  • 5 have native browser fallback — selected text still gets deleted, just through the native path
  • 2 are niche tools (academic NLP tool, personal terminal emulator) with a minor behavior difference

Major frameworks (CKEditor, Lexical, Slate, Odoo, monkeytype, GNOME/evolution) all handle this correctly already. No major websites or widely-used libraries are affected.

Interestingly, I noticed that the shipped feature already has the runtime flag enabled (stable since M145), and there have been no bugs or regressions filed against it, which further confirms that the change hasn't caused any meaningful breakage.

The runtime flag (InputEventsDeleteNonCollapsedSelection) remains available as a kill-switch if needed.

Daniel Bratell

unread,
May 8, 2026, 6:29:44 AM (13 days ago) May 8
to Pranav Modi, blink-dev, PhistucK, Mike Taylor

Good analysis. It sounds like the change will be web compatible, which is good news.

/Daniel

Reply all
Reply to author
Forward
0 new messages