Re: [w3c/editing] Chrome Desktop + Android: document.execCommand does not trigger a 'historyUndo' onbeforinput event after running document.execCommand('undo') (Issue #504)

johanneswilm left a comment (w3c/editing#504)

Call 2025-12-11:
> 08:32 <whsieh> undo/redo are in the section of commands that should not trigger beforeinput…
08:32 <ragoulik> https://www.w3.org/TR/input-events-2/#event-type-beforeinput - there is a mention about what needs to happen for before input here
08:32 <whsieh> unclear why this is the case
08:34 <whsieh> Ashish: long-standing behavior of not firing beforeinput event when handling execCommand-triggered commands
08:34 <whsieh> (in Chrome)
08:35 <whsieh> johanneswilm: isn't execCommand used to test input events?
08:37 <whsieh> Rakesh: "UA should not dispatch these events unless user-triggered"
08:38 <whsieh> johanneswilm: either the browser behavior should adjust to the execCommand spec or the spec needs to reflect what most browser engines do today
08:40 <whsieh> Rohan: intent of beforeinput is to give web authors a signal of user intent. but if they're the ones triggering it why do we need to send the event?
08:41 <whsieh> johanneswilm: LLMs might be interesting to consider — should asynchronously inserted text be treated as "user input"?
08:42 <whsieh> johanneswilm: need to be able to distinguish between human-generated text and system-generated text
08:42 <whsieh> johanneswilm: insertReplacementText vs. insertText kind of solves this
08:43 <whsieh> Michael: a button that the user clicks to trigger undo is, functionally, input triggered by the user
08:44 <whsieh> Michael: this issue came out of the other workaround to reset the DOM when undoing
08:45 <whsieh> Rakesh: if we do have use cases that are blocked for web developers due to not firing these events, let's note that
08:46 <whsieh> q+
08:46 <whsieh> johanneswilm: if it turns out execCommand gives a different result it probably is not a good test strat
08:48 <whsieh> 1. Can we add to interop?
08:48 <whsieh> Rakesh: there are interop-related points of contact on our team, I can relay
08:49 <whsieh> 2. Maybe we can consider adding a version of `execCommand` that triggers editing commands in a way that simulates user input
08:49 <whsieh> (WebKit's test runner has these primitives)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/504#issuecomment-3645609206
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/504/3645609206@github.com>

Received on Friday, 12 December 2025 09:14:39 UTC