Bug 1418747 - ContentCacheInParent needs to initialize mPendingCommitLength with 0 when it's created r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 27 Nov 2017 18:51:01 +0900
changeset 703674 26e7e9577bda6c4431ae9d13587c0690c534c42c
parent 703584 07e1f1c00bc5ea625344b9826bb0582434949152
child 703968 a22b38d0666866bc7c834f51780287dc26ffade6
push id90917
push usermasayuki@d-toybox.com
push dateMon, 27 Nov 2017 12:57:18 +0000
reviewersm_kato
bugs1418747
milestone59.0a1
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
widget/ContentCache.cpp
--- 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,