Backed out 2 changesets (bug 1148590) because dependencies haven't been uplifted first, busting Android builds a=backout
authorWes Kocher <wkocher@mozilla.com>
Wed, 22 Apr 2015 16:49:17 -0700
changeset 267182 ddebce1c80aa9f219d0002626462999e263f9790
parent 267181 532ce9f4226699ce5d70cf1da99603bb3c102489
child 267183 58cda3a03fcbe29fe58bb83971b3f4a89f867bbe
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1148590
milestone39.0a2
backs outa5eb17c5f04a38eb994063eb096ec1ce2149eeed
83dadcb2d604795774d2cac816d168a1ad987be5
Backed out 2 changesets (bug 1148590) because dependencies haven't been uplifted first, busting Android builds a=backout Backed out changeset a5eb17c5f04a (bug 1148590) Backed out changeset 83dadcb2d604 (bug 1148590)
mobile/android/chrome/content/SelectionHandler.js
widget/android/nsWindow.cpp
--- a/mobile/android/chrome/content/SelectionHandler.js
+++ b/mobile/android/chrome/content/SelectionHandler.js
@@ -380,22 +380,16 @@ var SelectionHandler = {
   startSelection: function sh_startSelection(aElement, aOptions = { mode: SelectionHandler.SELECT_ALL }) {
     // Clear out any existing active selection
     this._closeSelection();
 
     if (this._isNonTextInputElement(aElement)) {
       return this.START_ERROR_NONTEXT_INPUT;
     }
 
-    const focus = Services.focus.focusedWindow;
-    if (focus) {
-      // Make sure any previous focus is cleared.
-      Services.focus.clearFocus(focus);
-    }
-
     this._initTargetInfo(aElement, this.TYPE_SELECTION);
 
     // Perform the appropriate selection method, if we can't determine method, or it fails, return
     let selectionResult = this._performSelection(aOptions);
     if (selectionResult !== this.ERROR_NONE) {
       this._deactivate();
       return selectionResult;
     }
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -25,17 +25,16 @@ using mozilla::unused;
 
 #include "nsAppShell.h"
 #include "nsIdleService.h"
 #include "nsWindow.h"
 #include "nsIObserverService.h"
 #include "nsFocusManager.h"
 #include "nsIWidgetListener.h"
 #include "nsViewManager.h"
-#include "nsISelection.h"
 
 #include "nsIDOMSimpleGestureEvent.h"
 
 #include "nsGkAtoms.h"
 #include "nsWidgetsCID.h"
 #include "nsGfxCIID.h"
 
 #include "gfxContext.h"
@@ -2189,60 +2188,48 @@ nsWindow::PostFlushIMEChanges()
     AndroidGeckoEvent *event = AndroidGeckoEvent::MakeIMEEvent(
             AndroidGeckoEvent::IME_FLUSH_CHANGES);
     nsAppShell::gAppShell->PostEvent(event);
 }
 
 void
 nsWindow::FlushIMEChanges()
 {
-    // Only send change notifications if we are *not* masking events,
-    // i.e. if we have a focused editor,
-    NS_ENSURE_TRUE_VOID(!mIMEMaskEventsCount);
-
-    nsCOMPtr<nsISelection> imeSelection;
-    nsCOMPtr<nsIContent> imeRoot;
-
-    // If we are receiving notifications, we must have selection/root content.
-    MOZ_ALWAYS_TRUE(NS_SUCCEEDED(IMEStateManager::GetFocusSelectionAndRoot(
-            getter_AddRefs(imeSelection), getter_AddRefs(imeRoot))));
-
     nsRefPtr<nsWindow> kungFuDeathGrip(this);
-
     for (uint32_t i = 0; i < mIMETextChanges.Length(); i++) {
         IMEChange &change = mIMETextChanges[i];
 
         if (change.mStart == change.mOldEnd &&
                 change.mStart == change.mNewEnd) {
             continue;
         }
 
         WidgetQueryContentEvent event(true, NS_QUERY_TEXT_CONTENT, this);
 
         if (change.mNewEnd != change.mStart) {
             InitEvent(event, nullptr);
             event.InitForQueryTextContent(change.mStart,
                                           change.mNewEnd - change.mStart);
             DispatchEvent(&event);
-            NS_ENSURE_TRUE_VOID(event.mSucceeded);
-            NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
+            if (!event.mSucceeded)
+                return;
         }
 
         GeckoAppShell::NotifyIMEChange(event.mReply.mString, change.mStart,
                                        change.mOldEnd, change.mNewEnd);
     }
     mIMETextChanges.Clear();
 
     if (mIMESelectionChanged) {
         WidgetQueryContentEvent event(true, NS_QUERY_SELECTED_TEXT, this);
         InitEvent(event, nullptr);
 
         DispatchEvent(&event);
-        NS_ENSURE_TRUE_VOID(event.mSucceeded);
-        NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
+        if (!event.mSucceeded)
+            return;
 
         GeckoAppShell::NotifyIMEChange(EmptyString(),
                                        int32_t(event.GetSelectionStart()),
                                        int32_t(event.GetSelectionEnd()), -1);
         mIMESelectionChanged = false;
     }
 }