Re: Should we use BeforeInputEvent instead of CommandEvent?

To your list of arguments against BeforeInputEvent I would add one more.
AFAIK, the InputEvent does not contain an information about the intention
at all, so it's kind of a different family. On the other hand, my team was
struggling recently with implementing an undo manager, because there's no
single "after" event on which we can listen and reason on its basis. If
both events -  BeforeInputEvent and InputEvent - contained information
about intention that problem would be solved. On the third hand, in
contenteditable=minimal an app will make a DOM changes by itself, so it
does not need an "after" event.

If we want to design a pair of events to improve the situation on
contenteditable=true, then choosing BeforeInputEvent and extending
InputEvent may be a better choice. Adding BeforeInputEvent and not
improving InputEvent at the same time in my opinion would look bad. In such
case I would choose CommandEvent, because it will be easier to define.


On Wed, Jul 16, 2014 at 2:39 AM, Julie Parent <jparent@google.com> wrote:

> In order to move forward with specifying Command Events [1] in the
> Commands Explainer , we need to resolve issue 5: using BeforeInput vs
> adding a different CommandEvent.
>
> This has been discussed on earlier threads without any consensus.
>
> Arguments for using BeforeInput: InputEvent already exists and tracks
> input. BeforeInputEvent has been discussed already by DOM spec and the HTML
> spec, although not implemented by any browsers yet.  It doesn't make sense
> to add an additional event if BeforeInput will be moving forward.
>
> Argument against: With contenteditable="minimal", nothing is actually
> going to be inserted, so BeforeInputEvent is not correctly named.
> BeforeInputEvent fires after other Intention Events like ClipboardEvent, so
> it will be double-handled. And it's not a clear corollary to the invoke
> side, which is currently execCommand.
>
> Julie
>
> [1]
> http://w3c.github.io/editing-explainer/commands-explainer.html#command-events
>



-- 
Piotrek Koszuliński
CKEditor JavaScript Lead Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter <http://twitter.com/ckeditor> | Facebook
<http://www.facebook.com/ckeditor> | Google+
<https://plus.google.com/107736718646302128806> | LinkedIn
<http://www.linkedin.com/company/cksource>

Received on Wednesday, 16 July 2014 07:08:42 UTC