Bug 1278084 part.3 TextComposition shouldn't decide composition string which is only an ideographic space as a placeholder r=m_kato

Currently, when TextComposition tries to forcibly commit composition synchronously, it cancels the composition if there is only an ideographic space since legacy Chinese IMEs for Windows were used an ideographic space as a placeholder and shows actual composition string in its owning window (called reading window).

However, Japanese TIPs basically use composition to input an ideographic space. Unfortunately, this intentional input of an ideographic space is always canceled if an editor commits to composition at every input event in TSF mode because TSF cannot commit during a call of ITextStore::RequestLock().  Additionally, we will enable e10s mode, then, on all platforms, requesting commit composition is handled asynchronously.

Therefore, we should make the hack disabled in default settings now. If we'll find a way to distinguish if an ideographic space is a placeholder, we should recover this hack. Note that such input fields cannot handle such legacy IMEs, so, disabling the hack in default settings must be fine.

MozReview-Commit-ID: IdBcfBxeJum

--HG--
extra : rebase_source : 18ca5cd1083ade8813703cec05c020dc03f09f63
This commit is contained in:
Masayuki Nakano 2016-06-07 21:25:24 +09:00
Родитель c3611a1825
Коммит 77f6ee4369
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -267,10 +267,13 @@ TextComposition::DispatchCompositionEvent(
aCompositionEvent->mRanges = nullptr;
NS_ASSERTION(aCompositionEvent->mData.IsEmpty(),
"mData of eCompositionCommitAsIs should be empty string");
if (mLastData == IDEOGRAPHIC_SPACE) {
// If the last data is an ideographic space (FullWidth space), it must be
bool removePlaceholderCharacter =
Preferences::GetBool("intl.ime.remove_placeholder_character_at_commit",
false);
if (removePlaceholderCharacter && mLastData == IDEOGRAPHIC_SPACE) {
// If the last data is an ideographic space (FullWidth space), it might be
// a placeholder character of some Chinese IME. So, committing with
// this data must not be expected by users. Let's use empty string.
// this data might not be expected by users. Let's use empty string.
aCompositionEvent->mData.Truncate();
} else {
aCompositionEvent->mData = mLastData;

Просмотреть файл

@ -1980,6 +1980,12 @@ pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", true);
pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false);
#endif
// If you use legacy Chinese IME which puts an ideographic space to composition
// string as placeholder, this pref might be useful. If this is true and when
// web contents forcibly commits composition (e.g., moving focus), the
// ideographic space will be ignored (i.e., commits with empty string).
pref("intl.ime.remove_placeholder_character_at_commit", false);
// these locales have right-to-left UI
pref("intl.uidirection.ar", "rtl");
pref("intl.uidirection.he", "rtl");