[w3c/editing] beforeinput: Should we fire `replaceContent` during IME composition? (#122)

>From my understanding `replaceContent` should be fired when the existing text will be changed, for example:
1. Type "abc" in an input field (`insertText` should be fired for each letter)
2. Select "bc" (no `beforeinput` event)
3. Press "d" (`replaceContent` should be fired instead of `insertText`)

But for an [IME composition](https://w3c.github.io/uievents/#example-91064bc0) text will usually keep changing while typing, and after composition the marked text will be replaced by the final text once again.
So should the browser use the logic like:
1. If the old composition text is a prefix of the new one, send `insertText`
2. Otherwise send `replaceContent`?

Also I'm not sure why do we need `replaceContent` instead of using `insertText` with a `targetRanges`? (I could't find `replace*` in https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#Commands, they only got `insertText` I guess?)

---
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/122

Received on Tuesday, 12 April 2016 18:18:59 UTC