Bug 128953

Summary: TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: FormsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, darin, enrica, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 127832    
Attachments:
Description Flags
Fixes the bug ap: review+

Description Ryosuke Niwa 2014-02-17 22:02:23 PST
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.
Comment 1 Ryosuke Niwa 2014-02-17 22:04:04 PST
Created attachment 224471 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2014-02-18 15:59:05 PST
Committed r164329: <http://trac.webkit.org/changeset/164329>