Bug 207936:[trunk] JA IME: cursor position is off before and after text is committed

r=sfraser sr=kin


git-svn-id: svn://10.0.0.236/trunk@143568 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
leon.zhang%sun.com
2003-06-11 03:29:59 +00:00
parent 51ac421798
commit fb5047f80e
2 changed files with 16 additions and 2 deletions

View File

@@ -5366,6 +5366,12 @@ nsTypedSelection::SetCanCacheFrameOffset(PRBool aCanCacheFrameOffset)
mCachedOffsetForFrame->mCanCacheFrameOffset = aCanCacheFrameOffset;
// clean up cached frame when turn off cache
// fix bug 207936
if (!aCanCacheFrameOffset) {
mCachedOffsetForFrame->mLastCaretFrame = nsnull;
}
return NS_OK;
}
@@ -5376,7 +5382,8 @@ nsTypedSelection::GetCachedFrameOffset(nsIFrame *aFrame, PRInt32 inOffset, nsPoi
mCachedOffsetForFrame = new CachedOffsetForFrame;
}
if (mCachedOffsetForFrame->mCanCacheFrameOffset &&
if (mCachedOffsetForFrame->mCanCacheFrameOffset &&
mCachedOffsetForFrame->mLastCaretFrame &&
(aFrame == mCachedOffsetForFrame->mLastCaretFrame) &&
(inOffset == mCachedOffsetForFrame->mLastContentOffset))
{