Bug 841036 - Set default composition color to text field color; r=cpeterson
authorJim Chen <nchen@mozilla.com>
Mon, 18 Feb 2013 14:00:47 -0500
changeset 122250 2eec9cb2be86a86473208b8f74ff88ddb7af99ae
parent 122249 cf0437ccd0136992937c757773c157da1ff11169
child 122251 3bd8f038263de01b208f4e320634c4b71e7ac965
push id24327
push usergszorc@mozilla.com
push dateTue, 19 Feb 2013 05:22:32 +0000
treeherdermozilla-central@e8f8a3f6f1f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs841036
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841036 - Set default composition color to text field color; r=cpeterson
mobile/android/base/GeckoEditable.java
--- a/mobile/android/base/GeckoEditable.java
+++ b/mobile/android/base/GeckoEditable.java
@@ -379,16 +379,19 @@ final class GeckoEditable
         if (selEnd >= composingStart && selEnd <= composingEnd) {
             GeckoAppShell.sendEventToGecko(GeckoEvent.createIMERangeEvent(
                     selEnd - composingStart, selEnd - composingStart,
                     GeckoEvent.IME_RANGE_CARETPOSITION, 0, 0, false, 0, 0, 0));
         }
         int rangeStart = composingStart;
         TextPaint tp = new TextPaint();
         TextPaint emptyTp = new TextPaint();
+        // set initial foreground color to 0, because we check for tp.getColor() == 0
+        // below to decide whether to pass a foreground color to Gecko
+        emptyTp.setColor(0);
         do {
             int rangeType, rangeStyles = 0, rangeLineStyle = GeckoEvent.IME_RANGE_LINE_NONE;
             boolean rangeBoldLine = false;
             int rangeForeColor = 0, rangeBackColor = 0, rangeLineColor = 0;
             int rangeEnd = mText.nextSpanTransition(rangeStart, composingEnd, Object.class);
 
             if (selStart > rangeStart && selStart < rangeEnd) {
                 rangeEnd = selStart;