While typing in a rich text editor, the DOM may change while we type due to JS running. If the DOM changes, we seem to terminate the composition (which may seem like the best choice) - but 1) Somehow we don't terminate it "cleanly" so certain characters are duplicated. Thus typing "testing mozilla firefox" into the given test case tends to come out as "testing mmozilla ffirefox" 2) Chrome is able to not terminate composition when this script runs - giving the impression that you continue typing the same string/word even though the JS just replaced the DOM and restored the selection/cursor to (sort of) the same place. This is a nicer user experience because it works better with things like spellcheck, autocomplete. Test case: https://bugzilla.mozilla.org/attachment.cgi?id=8741331 Spun off from bug 1258803. As this affects Facebook if you run Firefox on a tablet (getting the FB desktop site) it might be important. I have no idea if Firefox on tablets is a product we're pushing. If it is, we should make this bug really high pri..