Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1376407 - part2: Emulate selection when committing composition as…
… collapsed to the end of composition r=m_kato When you start new composition during converting with Mozc in e10s mode, the following things occur: 1. Mozc commits previous composition. 2. Gecko dispatches eCompositionCommit event. 3. Mozc sets new composition string (skipping composition start signal). 4. Gecko dispatches eCompositionStart and eCompositionChange event. 5. Selection is changed asynchronously. 6. Gecko sets position of IME windows. At mozilla#4, Gecko stores start of composition as selection start, then, trying to adjust it at mozilla#5. However, new selection is caret position in new composition string. Therefore, it's not used for the adjustment. This causes that stored composition start offset is always the start of the previous composition (if the previous patch didn't change EnsureToCacheSelection() behavior). So, IMContextWrapper needs to compute proper composition start offset in this case. The simplest fix is, modifying selection at mozilla#2 as which will be occurred in focused editor. So, this patch makes the selection cache collapsed to the end of committing string. Note that actual selection may be different if JS changes selection and/or the text in the focused editor. However, it doesn't matter. IMContextWrapper should behave as expected while current composition is active. MozReview-Commit-ID: 221mDUd8yRP
- Loading branch information