- From: Johannes Wilm <notifications@github.com>
- Date: Thu, 08 Oct 2026 02:04:18 -0700
- To: w3c/editing <editing@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/editing/issues/551/6056483959@github.com>
johanneswilm left a comment (w3c/editing#551) Ok, I've done that now. In Wordgard, the resulting HTML looks like this: ```js <p>The <em><span style="color: rgb(20, 22, 26)">sluggish</span></em> brown fox jumps over the <em>lazy</em> dog.</p> ``` This is what it looks like if you do a synthetic paste instead: ```js <p>The <em>sluggish</em> brown fox jumps over the <em>lazy</em> dog.</p> ``` Wordgard is a modern editor (the successor of ProseMirror) and it (apparently) no longer includes the kind of cleanup code that editors have kept for execCommand for a long time. Otherwise, all other editors would show similar artifacts. `execCommand` is finally about to be gone from the web, so that code may not be necessary anymore. I really don't see any advantage of using `execCommand` for this as it's only causing headaches for JavaScript developers, and there are much better alternatives available. As a JavaScript editor developer myself, I really urge to not use execCommand unless absolutely necessary as it leaves artifacts everywhere and generally makes a mess that is difficult to deal with for JavaScript developers. None of the editors I found checked for `isTrusted`. Even Google Docs and Microsoft office online let you change content through their (undocumented) APIs from untrusted events. I think the way forward is first to add those notes to the Input Events spec to make it easier for JS editor developers to make their editors compatible with extensions. Beyond that, an untrusted synthetic paste event seems to cover the other JS editors we looked at here. Wordgard is covered by the beforeinput events, but it showed that it is possible to have a requirement for a wait between selection + synthetic paste. Maybe there are editors out that that require that. That only leaves the last category of editors: Those that don't want to accept input from an extension and that check for `isTrusted`. This is not any of the editors I tested, but I'm sure those editors will be out there. Maybe we could look at them in a second round to see when it makes sense for the extensions to override their requests and how to best do that. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/editing/issues/551#issuecomment-6056483959 You are receiving this because you are subscribed to this thread. Message ID: <w3c/editing/issues/551/6056483959@github.com>
Received on Thursday, 8 October 2026 09:04:22 UTC