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

If one moves the caret/selection to a different element when `compoisitionstart` is triggered, browsers different on `compositionend`:

1. Chrome/Safari trigger the `compositionend` event on the element where composition takes place.

2. Firefox triggers the `compositionend` event on the element where the caret was at the time when the `compositionstart` event was triggered.

Additionally, browsers behave differently if the caret is moved to a different element when `compositionend` is triggered:

1. Chrome/Safari paste the composed characters in the place where the caret is moved to.

2. Firefox only moves the caret to a different element.

The Chrome/Safari behavior is desired for the use case where one wants to have IME character insertion into the document stream be atomic -- either by doing composition somewhere else [1] or by using a Shadow DOM during composition [2].

[1] http://jsbin.com/degubomera/1/edit?html,js,output (works in Chrome/Safari/FF)
[2] http://jsbin.com/pacisugiwu/1/edit?html,js,output (only works in Chrome/Safari)

Edge behavior is close to FF behavior and Safari close to Chrome.

See also debate about this here: https://lists.w3.org/Archives/Public/www-dom/2015JulSep/0044.html

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

Received on Tuesday, 1 September 2015 06:42:39 UTC