Bug 1248408 - Preserve text from previous a11y event if new event does not provide any. r=mfinkle
authorEitan Isaacson <eitan@monotonous.org>
Thu, 31 Mar 2016 13:46:14 -0700
changeset 291131 41c11b33eedb73985d93e3ca63a3bb5c20a8d8ab
parent 291130 5ba4fe816a3980fd20f3e3ffc92f6e714ce91d88
child 291132 b73ce1b4482c7d19ee44cd29ab114b14956cc75b
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1248408
milestone48.0a1
Bug 1248408 - Preserve text from previous a11y event if new event does not provide any. r=mfinkle MozReview-Commit-ID: 3hIquiKLvl7
mobile/android/base/java/org/mozilla/gecko/GeckoAccessibility.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAccessibility.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAccessibility.java
@@ -203,18 +203,18 @@ public class GeckoAccessibility {
 
             final JSONArray textArray = message.optJSONArray("text");
             StringBuilder sb = new StringBuilder();
             if (textArray != null && textArray.length() > 0) {
                 sb.append(textArray.optString(0));
                 for (int i = 1; i < textArray.length(); i++) {
                     sb.append(" ").append(textArray.optString(i));
                 }
+                sVirtualCursorNode.setText(sb.toString());
             }
-            sVirtualCursorNode.setText(sb.toString());
             sVirtualCursorNode.setContentDescription(message.optString("description"));
 
             JSONObject bounds = message.optJSONObject("bounds");
             if (bounds != null) {
                 Rect relativeBounds = new Rect(bounds.optInt("left"), bounds.optInt("top"),
                                                bounds.optInt("right"), bounds.optInt("bottom"));
                 sVirtualCursorNode.setBoundsInParent(relativeBounds);
                 int[] locationOnScreen = new int[2];