author | Masayuki Nakano <masayuki@d-toybox.com> |
Sat, 19 Sep 2015 22:22:40 +0900 | |
changeset 263401 | dec41eaf2fedc00d0fe809e83fe2985c17426371 |
parent 263400 | 255824a521c1f7b7cb2b01a6302cdb95523cfb89 |
child 263402 | d29fef133d8a0960a57031f71b299fa58aa4d74d |
push id | 65298 |
push user | masayuki@d-toybox.com |
push date | Sat, 19 Sep 2015 13:22:48 +0000 |
treeherder | mozilla-inbound@dec41eaf2fed [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | emk |
bugs | 1187583 |
milestone | 43.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -3518,43 +3518,52 @@ TSFTextStore::GetTextExt(TsViewCookie vc // NOTE: TSF (at least on Win 8.1) doesn't return TS_E_NOLAYOUT to the // caller even if we return it. It's converted to just E_FAIL. // However, this is fixed on Win 10. const TSFStaticSink* kSink = TSFStaticSink::GetInstance(); if (mComposition.IsComposing() && mComposition.mStart < acpEnd && mLockedContent.IsLayoutChangedAfter(acpEnd)) { const Selection& currentSel = CurrentSelection(); - if ((sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtFirstChar || - sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtCaret) && - kSink->IsMSJapaneseIMEActive()) { + // The bug of Microsoft Office IME 2010 for Japanese is similar to + // MS-IME for Win 8.1 and Win 10. Newer version of MS Office IME is not + // released yet. So, we can hack it without prefs because there must be + // no developers who want to disable this hack for tests. + const bool kIsMSOfficeJapaneseIME2010 = + kSink->IsMSOfficeJapaneseIME2010Active(); + if (kIsMSOfficeJapaneseIME2010 || + ((sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtFirstChar || + sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtCaret) && + kSink->IsMSJapaneseIMEActive())) { // MS IME for Japanese doesn't support asynchronous handling at deciding // its suggest list window position. The feature was implemented // starting from Windows 8. - if (IsWin8OrLater()) { + if (IsWin8OrLater() || kIsMSOfficeJapaneseIME2010) { // Basically, MS-IME tries to retrieve whole composition string rect // at deciding suggest window immediately after unlocking the document. // However, in e10s mode, the content hasn't updated yet in most cases. // Therefore, if the first character at the retrieving range rect is // available, we should use it as the result. - if (sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtFirstChar && + if ((kIsMSOfficeJapaneseIME2010 || + sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtFirstChar) && !mLockedContent.IsLayoutChangedAfter(acpStart) && acpStart < acpEnd) { acpEnd = acpStart; MOZ_LOG(sTextStoreLog, LogLevel::Debug, ("TSF: 0x%p TSFTextStore::GetTextExt() hacked the offsets " "of the first character of changing range of the composition " "string for TIP acpStart=%d, acpEnd=%d", this, acpStart, acpEnd)); } // Although, the condition is not clear, MS-IME sometimes retrieves the // caret rect immediately after modifying the composition string but // before unlocking the document. In such case, we should return the // nearest character rect. - else if (sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtCaret && + else if ((kIsMSOfficeJapaneseIME2010 || + sDoNotReturnNoLayoutErrorToMSJapaneseIMEAtCaret) && acpStart == acpEnd && currentSel.IsCollapsed() && currentSel.EndOffset() == acpEnd) { acpEnd = acpStart = mLockedContent.MinOffsetOfLayoutChanged(); MOZ_LOG(sTextStoreLog, LogLevel::Debug, ("TSF: 0x%p TSFTextStore::GetTextExt() hacked the offsets " "of the caret of the composition string for TIP acpStart=%d, " "acpEnd=%d", this, acpStart, acpEnd)); }