Bug 1418747 - ContentCacheInParent needs to initialize mPendingCommitLength with 0 when it's created r?m_kato
ContentCacheInParent::mPendingCommitLength is never initialized until it
receives eCompositionCommit(AsIs) event from widget or receives the latest
content from the remote process when there is a composition.
The bug is, immediately after dispatching eCompositionStart and first
eCompositionChange event, MS Pinyin tries to query the character at caret,
but ContentCacheInParent::HandleQueryContentEvent() tries to resolve
related position of an eQueryTextRect event with the uninitialized
mPendingCommitLength. Therefore, the query almost always fails and MS Pinyin
gives up to show its candidate window.
This patch just initializes the member with 0.
MozReview-Commit-ID: JyYNqi8hoTa
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -515,16 +515,17 @@ ContentCacheInChild::SetSelection(nsIWid
*****************************************************************************/
ContentCacheInParent::ContentCacheInParent(TabParent& aTabParent)
: ContentCache()
, mTabParent(aTabParent)
, mCommitStringByRequest(nullptr)
, mPendingEventsNeedingAck(0)
, mCompositionStartInChild(UINT32_MAX)
+ , mPendingCommitLength(0)
, mPendingCompositionCount(0)
, mWidgetHasComposition(false)
, mIsPendingLastCommitEvent(false)
{
}
void
ContentCacheInParent::AssignContent(const ContentCache& aOther,