Bug 975383 part.8 Remove unnecesary handler of compositionupdate r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 03 Oct 2014 15:33:49 +0900
changeset 208532 e730625ff9e11bf232b0b9f46ed1e1583e8c84c8
parent 208531 d4b4cca22c1970a9918b026045cb7d36c33e98f6
child 208533 3ec43ac8b65c6a87b5e983ac3ae86ada3a3fb83d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug
bugs975383
milestone35.0a1
Bug 975383 part.8 Remove unnecesary handler of compositionupdate r=smaug
dom/events/EventStateManager.cpp
dom/events/IMEStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -815,17 +815,16 @@ EventStateManager::PreHandleEvent(nsPres
       WidgetCompositionEvent* compositionEvent = aEvent->AsCompositionEvent();
       WidgetQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT,
                                            compositionEvent->widget);
       DoQuerySelectedText(&selectedText);
       NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
       compositionEvent->data = selectedText.mReply.mString;
     }
     // through to compositionend handling
-  case NS_COMPOSITION_UPDATE:
   case NS_COMPOSITION_END:
     {
       WidgetCompositionEvent* compositionEvent = aEvent->AsCompositionEvent();
       if (IsTargetCrossProcess(compositionEvent)) {
         // Will not be handled locally, remote the event
         if (GetCrossProcessTarget()->SendCompositionEvent(*compositionEvent)) {
           // Cancel local dispatching
           aEvent->mFlags.mPropagationStopped = true;
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -903,20 +903,18 @@ IMEStateManager::DispatchCompositionEven
      GetBoolName(aIsSynthesized)));
 
   MOZ_ASSERT(aEvent->mClass == eCompositionEventClass ||
              aEvent->mClass == eTextEventClass);
   if (!aEvent->mFlags.mIsTrusted || aEvent->mFlags.mPropagationStopped) {
     return;
   }
 
-  // Temporarily, let's ignore compositionupdate event from widget.
-  if (aEvent->message == NS_COMPOSITION_UPDATE) {
-    return;
-  }
+  MOZ_ASSERT(aEvent->message != NS_COMPOSITION_UPDATE,
+             "compositionupdate event shouldn't be dispatched manually");
 
   EnsureTextCompositionArray();
 
   WidgetGUIEvent* GUIEvent = aEvent->AsGUIEvent();
 
   nsRefPtr<TextComposition> composition =
     sTextCompositions->GetCompositionFor(GUIEvent->widget);
   if (!composition) {