Bug 128953 - TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText
Summary: TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 127832
  Show dependency treegraph
 
Reported: 2014-02-17 22:02 PST by Ryosuke Niwa
Modified: 2014-02-18 15:59 PST (History)
5 users (show)

See Also:


Attachments
Fixes the bug (2.42 KB, patch)
2014-02-17 22:04 PST, Ryosuke Niwa
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>