Right now TextFieldInputType::handleBeforeTextInsertedEvent uses plainText, which triggers a synchronous layout. We shouldn't use that. Also, plainText uses render text, etc... to obtain text may collapse some whitespaces which may or may not affect the result numGraphemeClusters returns. Instead, use cached selection start & selection end to subtract the part of the inner text that has been selected.
Created attachment 224471 [details] Fixes the bug
Committed r164329: <http://trac.webkit.org/changeset/164329>