Closed Bug 1475153 Opened 3 years ago Closed 3 years ago

TSFTextStore should merge new composition to old composition if it's possible

Categories

(Core :: Widget: Win32, enhancement)

All
Windows 10
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Attachments

(1 file)

This is a part of bug 1462257.

When user removes all composition string, MS Pinyin removes last character with following odd steps:

1. commits the last character.
2. select the committed character.
3. replaces the selection with another temporary composition which commits with empty string.

Even after fix of bug 1462257, user may see selected last character when removing the last character.  Additionally, undo transaction is split.  First undo restores the last character.  Then, second undo removes the last character.

When this occurs, TSFTextStore's pending actions are:

> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions() flushing Type::eCompositionEnd={ mData="n" }
> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions(), dispatching compositioncommit event...
> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions() flushing Type::eCompositionStart={ mSelectionStart=0, mSelectionLength=1 }, mDestroyed=false
> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions() dispatching compositionstart event...
> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions() flushing Type::eCompositionEnd={ mData="" }
> D/nsTextStoreWidgets 0x000002940B80D190   TSFTextStore::FlushPendingActions(), dispatching compositioncommit event...

So, if composition is restarted immediately after composition end and the range is exactly same as previous commit string, we can merge those compositions and making the behavior in web apps simpler.
Comment on attachment 8991662 [details]
Bug 1475153 - Make TSFTextStore::RecordCompositionStartAction() merge new composition with previous composition if IME commits composition and restart composition to replace the previous commit string

https://reviewboard.mozilla.org/r/256582/#review263628
Attachment #8991662 - Flags: review?(m_kato) → review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/618089e03bd6
Make TSFTextStore::RecordCompositionStartAction() merge new composition with previous composition if IME commits composition and restart composition to replace the previous commit string r=m_kato
https://hg.mozilla.org/mozilla-central/rev/618089e03bd6
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.