Bug 1051556 - Ignore invalid selection offsets; r=esawin a=ritu
authorJim Chen <nchen@mozilla.com>
Mon, 04 Jan 2016 11:39:10 -0800
changeset 305945 14659c4b4fecf8cf68f50faeb96a528f86cc9ad6
parent 305944 ab7fb0565f5aa7d89b1c7fc72d9064c4a592626e
child 305946 4c66ae0b0b91d82bf13b518f37c8c0c0c88bd141
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin, ritu
bugs1051556
milestone44.0
Bug 1051556 - Ignore invalid selection offsets; r=esawin a=ritu
mobile/android/base/GeckoEditable.java
--- a/mobile/android/base/GeckoEditable.java
+++ b/mobile/android/base/GeckoEditable.java
@@ -972,17 +972,18 @@ final class GeckoEditable extends JNIObj
         if (DEBUG) {
             // GeckoEditableListener methods should all be called from the Gecko thread
             ThreadUtils.assertOnGeckoThread();
             Log.d(LOGTAG, "onSelectionChange(" + start + ", " + end + ")");
         }
         if (start < 0 || start > mText.length() || end < 0 || end > mText.length()) {
             Log.e(LOGTAG, "invalid selection notification range: " +
                   start + " to " + end + ", length: " + mText.length());
-            throw new IllegalArgumentException("invalid selection notification range");
+            // Ignore selection offsets that are invalid because something changed from under us.
+            return;
         }
         final int seqnoWhenPosted = ++mGeckoUpdateSeqno;
 
         /* An event (keypress, etc.) has potentially changed the selection,
            synchronize the selection here. There is not a race with the IC thread
            because the IC thread should be blocked on the event action */
         final Action action = mActionQueue.peek();
         if (action != null && action.mType == Action.TYPE_EVENT) {