Bug 1172219 part.2 Notify TSF of layout creation and destruction r=emk
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 17 Jun 2015 14:00:34 +0900
changeset 249310 3446822f321b648665036df3a2a7cbbeaab67b8f
parent 249309 46a99800e86a10bc3c77d84cccf18e0c38ee6270
child 249311 842c06221e6a1b2a3db5059aeed92a2703c5f625
push id28923
push userryanvm@gmail.com
push dateWed, 17 Jun 2015 18:57:11 +0000
treeherdermozilla-central@099d6cd6725e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1172219
milestone41.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
Bug 1172219 part.2 Notify TSF of layout creation and destruction r=emk
widget/windows/nsTextStore.cpp
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -1323,16 +1323,24 @@ nsTextStore::Destroy()
 
   // If there is composition, TSF keeps the composition even after the text
   // store destroyed.  So, we should clear the composition here.
   if (mComposition.IsComposing()) {
     NS_WARNING("Composition is still alive at destroying the text store");
     CommitCompositionInternal(false);
   }
 
+  if (mSink) {
+    MOZ_LOG(sTextStoreLog, LogLevel::Debug,
+      ("TSF: 0x%p   nsTextStore::Destroy(), calling "
+       "ITextStoreACPSink::OnLayoutChange(TS_LC_DESTROY)...",
+       this));
+    mSink->OnLayoutChange(TS_LC_DESTROY, TEXTSTORE_DEFAULT_VIEW);
+  }
+
   mLockedContent.Clear();
   mSelection.MarkDirty();
 
   mContext = nullptr;
   if (mDocumentMgr) {
     mDocumentMgr->Pop(TF_POPF_ALL);
     mDocumentMgr = nullptr;
   }
@@ -4260,16 +4268,25 @@ nsTextStore::CreateAndSetFocus(nsWindowB
                                   getter_AddRefs(prevFocusedDocumentMgr));
   if (NS_WARN_IF(FAILED(hr))) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF:   nsTextStore::CreateAndSetFocus() FAILED due to "
             "ITfTheadMgr::AssociateFocus() failure"));
     return false;
   }
   sEnabledTextStore->SetInputScope(aContext.mHTMLInputType);
+
+  if (sEnabledTextStore->mSink) {
+    MOZ_LOG(sTextStoreLog, LogLevel::Info,
+      ("TSF:   nsTextStore::CreateAndSetFocus(), calling "
+       "ITextStoreACPSink::OnLayoutChange(TS_LC_CREATE) for 0x%p...",
+       sEnabledTextStore.get()));
+    sEnabledTextStore->mSink->OnLayoutChange(TS_LC_CREATE,
+                                             TEXTSTORE_DEFAULT_VIEW);
+  }
   return true;
 }
 
 // static
 nsIMEUpdatePreference
 nsTextStore::GetIMEUpdatePreference()
 {
   if (sThreadMgr && sEnabledTextStore && sEnabledTextStore->mDocumentMgr) {