Re: [uievents] specify how compositionend works if the caret has been moved to a different element (#5)

Thank you for having this deep explanation, I didn't mean to ask you to do this much work, but having these models clearly help our discussions so much.

IIUC, model 3 is a future thing, so let's focus on model 1/2.

If your document model in JS does not want to incorporate composition strings, I understand the JS editor can import your polyfill to suppress DOM change events until composition is committed.

On the other hand, if the JS editor wants the same effect without the polyfill, having a filter in the event handler should do.

By using the polyfill, the filter may go down to 1 line, but the JS editor must still handle:

1. Browsers without Shadow DOM support. This may go zero in years though.
2. You can't create Shadow DOM against text nodes, so if the caret is in `<span>|text<b>bold</b></span>` either the polyfill or the JS editor must change DOM before composition starts.
3. And as we discuss here, you need browsers to have a mode for this to work.

Isn't having a filter in the event handler much easier?

There are other things the JS editor must do to support IME for collaborative editing support. Suppressing composition event is one part. Another likely part is after OT (in your term) was received by other users, how to properly replay it on the other users' browser while s/he is typing compositions. If the editor moves selections to replay (I suppose all editors do this today,) it'll break typing experiences either by committing the composition or moving composition. This is probably larger issue than suppressing events. I guess save and restore may solve, but I'd like to hear from the real developers doing the work.

And probably there are more that neither you nor I are aware of today.

So my point is that, if an JS collaborative editor has to spend, say, 1 month of dev work to support IME in several functions of the editor anyway, having a filter in the event handler looks more reasonable to me than the Shadow DOM, especially when the polyfill is not perfect as mentioned above.

But for the higher level of discussions, I'm not a JS developer, so which looks more reasonable to me isn't really the decision factor. If you and many others are really using it, I'm ok with your proposal. Only that the behavior you described could be harmful for other cases that we'll need a mode.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/5#issuecomment-138910178

Received on Wednesday, 9 September 2015 13:33:52 UTC