Re: [w3c/editing] Should execCommand dispatch beforeinput or not? (#200)

> Broadly speaking, I think there are really four general classes of content editable editors.

I think your list covers the current state quite well. And each of those 4 has issues, although 2, 3 and 4 will hopefully have fewer issues. With the input events spec we made it possible to create editors of type 3, but that was not to create an ever larger list of different ways of making good editors. Moving forward we should keep in mind that we cannot remove some functionality because there are old editors of type 1 out there, and there are current editors of type 2 out there that will not go away so we need to make sure to keep it in mind. At the same time, looking forward we should make it possible to create a good editor without too much effort using 3 and a perfect editor with a bit more effort using 4.

So on the one hand your perspective - we need to provide something that should work without too many hiccups, as far as possible, at least for 2, 3 and 4 (1 is so buggy so it's difficult to guarantee anything). At the same time that should not mean that we make editors of type 3 compromise because if that happens then JavaScript developers won't have any advantage to move from 2 to 3, and beforeinput becomes just yet another event that combined with all the old stuff can be used to create an editor of type 2, and creating such an editor will get even more complex than what it already is.

So I would say:

* Add the `beforeinput` event to the `execCommand` spec draft. It's the closest thing we have to a real spec of `execCommand` so that's where that should live.
* Add an empty string as an `inputType` for `execCommand`s that cannot be mapped to an existing `inputType` from the `Input Events` spec. Specify this in the `execCommand` draft spec.
* On the question on whether or not to add a `beforeinput` event only to `execCommand` if they come from a browser plugin or not, I do not have a strong opinion, but it would seem that for consistency it would be simpler to just add it every time.
* Come up with a way to allow triggering a beforeinput/dom manipulation/input event-chain by JavaScript with any of the `inputType`s so that it can be used for editor 3, but also makes it work with editors of type 2 and 4.

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

Received on Wednesday, 8 January 2020 16:33:14 UTC