Re: composition events and focus changes

I agree with all the points made by Ojan/Florian. As long as we can move
the caret during compositionstart/end, not being able to do preventDefault
is not a big problem and can be something we don't get until the point when
we get low level access to everything else related to IMEs in JavaScript.

This should as far as I can tell be enough to handle IMEs that only create
new content.

However, we still need some more things to handle IMEs that change existing
texts.

I assume here that such IMEs look for words across DOM element boundaries,
but that they produce only strings that will go inside of single elements.
At some stage during composition they therefore move all characters to be
within just one element. That's what iOS and Android seem to be doing.


1. At compositionstart, we need to know about what range covers the word
that the IME will be working on.

2. If the IME is to change the DOM structure, this has to happen after
compositionstart (or we need a new event before that happens), so that we
can move copies of all the relevant DOM elements somewhere else and let the
DOM changes take place in that controlled enviironment.

3. If the IME has produced such a changed node, I am not sure how useful it
is that it pastes the created string at compositionend, and that this
pasting cannot be canceled. If the DOM structure of the word is more
complex than just part of a single string, the JavaScript may want to try
to recreate some of this structure.


-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.org

Received on Monday, 19 October 2015 06:39:49 UTC