Bug 1286730 - IMEStateManager::NotifyIME() should treat NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED same as the other notifications because all of them are notified by IMEContentObserver asynchronously. r=smaug, a=gchang
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 14 Jul 2016 12:11:56 +0900
changeset 342184 4468d257b7959904445ef697aa3ba59889b16fa0
parent 342183 7a7e5f80e25ee0922485c64b806650c8209edc3d
child 342185 899a01cd98bdbd6e695ed3c46c918c27ac060736
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, gchang
bugs1286730
milestone49.0a2
Bug 1286730 - IMEStateManager::NotifyIME() should treat NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED same as the other notifications because all of them are notified by IMEContentObserver asynchronously. r=smaug, a=gchang MozReview-Commit-ID: 1GJk9bfOqjS
dom/events/IMEStateManager.cpp
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -1399,16 +1399,17 @@ IMEStateManager::NotifyIME(const IMENoti
       sFocusedIMEWidget = nullptr;
       sRemoteHasFocus = false;
       return focusedIMEWidget->NotifyIME(IMENotification(NOTIFY_IME_OF_BLUR));
     }
     case NOTIFY_IME_OF_SELECTION_CHANGE:
     case NOTIFY_IME_OF_TEXT_CHANGE:
     case NOTIFY_IME_OF_POSITION_CHANGE:
     case NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
+    case NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED:
       if (!sRemoteHasFocus && aOriginIsRemote) {
         MOZ_LOG(sISMLog, LogLevel::Info,
           ("ISM:   IMEStateManager::NotifyIME(), received content change "
            "notification from the remote but it's already lost focus"));
         return NS_OK;
       }
       if (NS_WARN_IF(sRemoteHasFocus && !aOriginIsRemote)) {
         MOZ_LOG(sISMLog, LogLevel::Error,
@@ -1452,30 +1453,16 @@ IMEStateManager::NotifyIME(const IMENoti
 
   switch (aNotification.mMessage) {
     case REQUEST_TO_COMMIT_COMPOSITION:
       return composition ?
         composition->RequestToCommit(aWidget, false) : NS_OK;
     case REQUEST_TO_CANCEL_COMPOSITION:
       return composition ?
         composition->RequestToCommit(aWidget, true) : NS_OK;
-    case NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED:
-      if (!aOriginIsRemote && (!composition || isSynthesizedForTests)) {
-        MOZ_LOG(sISMLog, LogLevel::Info,
-          ("ISM:   IMEStateManager::NotifyIME(), FAILED, received content "
-           "change notification from this process but there is no compostion"));
-        return NS_OK;
-      }
-      if (!sRemoteHasFocus && aOriginIsRemote) {
-        MOZ_LOG(sISMLog, LogLevel::Info,
-          ("ISM:   IMEStateManager::NotifyIME(), received content change "
-           "notification from the remote but it's already lost focus"));
-        return NS_OK;
-      }
-      return aWidget->NotifyIME(aNotification);
     default:
       MOZ_CRASH("Unsupported notification");
   }
   MOZ_CRASH(
     "Failed to handle the notification for non-synthesized composition");
   return NS_ERROR_FAILURE;
 }