Bug 1177011 - Ignore restarting the same content observer in EventStateManager; r=masayuki
authorJim Chen <nchen@mozilla.com>
Mon, 06 Jul 2015 09:54:04 -0400
changeset 275874 95af75ab24cd66e1e4ae654f170f05c9197bf0de
parent 275873 8539750f5444e2cea69791fbea5bd61550743dba
child 275875 7c9a34b615aa22b31a5b4efdb81704566e951f08
push id3246
push usergijskruitbosch@gmail.com
push dateTue, 07 Jul 2015 09:06:38 +0000
reviewersmasayuki
bugs1177011
milestone42.0a1
Bug 1177011 - Ignore restarting the same content observer in EventStateManager; r=masayuki
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -450,16 +450,19 @@ EventStateManager::ReleaseCurrentIMECont
   }
   mIMEContentObserver = nullptr;
 }
 
 void
 EventStateManager::OnStartToObserveContent(
                      IMEContentObserver* aIMEContentObserver)
 {
+  if (mIMEContentObserver == aIMEContentObserver) {
+    return;
+  }
   ReleaseCurrentIMEContentObserver();
   mIMEContentObserver = aIMEContentObserver;
 }
 
 void
 EventStateManager::OnStopObservingContent(
                      IMEContentObserver* aIMEContentObserver)
 {