Bug 1468917 - part 2: TSFTextStore::GetTextExt() shouldn't return TS_E_NOLAYOUT when ATOK retrieves text rects *in* the composition string r?m_kato
Currently, TSFTextStore::GetTextExt() won't return TS_E_NOLAYOUT error when
ATOK retrieves text rect of all of the composition string.
However, if user converts 2nd or later clause, ATOK retrieves text rect after
start of the character of selected clause. Returning TS_E_NOLAYOUT in this
case causes candidate window being positioned temporarily below first character
of the composition string.
For avoiding the flicker of the candidate window, TSFTextStore::GetTextExt()
shouldn't return TS_E_NOLAYOUT when ATOK retrieves text rects *in* the
composition string.
MozReview-Commit-ID: Cp17HmP2QGK
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -4532,18 +4532,20 @@ TSFTextStore::GetTextExt(TsViewCookie vc
// refers native caret rect on windows whose window class is one of
// Mozilla window classes and we stop creating native caret for ATOK
// because creating native caret causes ATOK refers caret position
// when GetTextExt() returns TS_E_NOLAYOUT.
else if (TSFPrefs::DoNotReturnNoLayoutErrorToATOKOfCompositionString() &&
TSFStaticSink::IsATOKActive() &&
(!TSFStaticSink::IsATOKReferringNativeCaretActive() ||
!TSFPrefs::NeedToCreateNativeCaretForLegacyATOK()) &&
- mContentForTSF.LatestCompositionStartOffset() == acpStart &&
- mContentForTSF.LatestCompositionEndOffset() == acpEnd) {
+ acpStart >= mContentForTSF.LatestCompositionStartOffset() &&
+ acpStart <= mContentForTSF.LatestCompositionEndOffset() &&
+ acpEnd >= mContentForTSF.LatestCompositionStartOffset() &&
+ acpEnd <= mContentForTSF.LatestCompositionEndOffset()) {
dontReturnNoLayoutError = true;
}
// Japanist 10 fails to handle TS_E_NOLAYOUT when it decides the position of
// candidate window. In such case, Japanist shows candidate window at
// top-left of the screen. So, we should return the nearest caret rect
// where we know.
else if (
TSFPrefs::DoNotReturnNoLayoutErrorToJapanist10OfCompositionString() &&