Bug 1187351 TSFTextStore should forget modified range at notifying TSF of layout change since GetTextExt() shouldn't return TS_E_NOLAYOUT after that r=emk
authorMasayuki Nakano <masayuki@d-toybox.com>
Sun, 26 Jul 2015 12:29:47 +0900
changeset 254610 7ef4f6f01e9e7feca71a0a43a7c24019a1f7670e
parent 254609 e7549c25cfcd77273abd493fa923183367fbfc40
child 254611 649e039d21193095219c6a4fdd54f6fc624fe039
push id29108
push userryanvm@gmail.com
push dateMon, 27 Jul 2015 14:12:01 +0000
treeherdermozilla-central@27ae736ef960 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1187351
milestone42.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 1187351 TSFTextStore should forget modified range at notifying TSF of layout change since GetTextExt() shouldn't return TS_E_NOLAYOUT after that r=emk
widget/windows/TSFTextStore.cpp
widget/windows/TSFTextStore.h
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -4550,16 +4550,22 @@ TSFTextStore::OnLayoutChangeInternal()
   return rv;
 }
 
 bool
 TSFTextStore::NotifyTSFOfLayoutChange(bool aFlush)
 {
   mPendingOnLayoutChange = false;
 
+  // Now, layout has been computed.  We should notify mLockedContent for
+  // making GetTextExt() and GetACPFromPoint() not return TS_E_NOLAYOUT.
+  if (mLockedContent.IsInitialized()) {
+    mLockedContent.OnLayoutChanged();
+  }
+
   // This method should return true if either way succeeds.
   bool ret = false;
 
   if (mSink) {
     MOZ_LOG(sTextStoreLog, LogLevel::Info,
            ("TSF: 0x%p   TSFTextStore::NotifyTSFOfLayoutChange(), "
             "calling ITextStoreACPSink::OnLayoutChange()...",
             this));
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -619,16 +619,21 @@ protected:
       mText = aText;
       if (mComposition.IsComposing()) {
         mLastCompositionString = mComposition.mString;
       }
       mMinTextModifiedOffset = NOT_MODIFIED;
       mInitialized = true;
     }
 
+    void OnLayoutChanged()
+    {
+      mMinTextModifiedOffset = NOT_MODIFIED;
+    }
+
     const nsDependentSubstring GetSelectedText() const;
     const nsDependentSubstring GetSubstring(uint32_t aStart,
                                             uint32_t aLength) const;
     void ReplaceSelectedTextWith(const nsAString& aString);
     void ReplaceTextWith(LONG aStart, LONG aLength, const nsAString& aString);
 
     void StartComposition(ITfCompositionView* aCompositionView,
                           const PendingAction& aCompStart,