Closed Bug 871884 Opened 11 years ago Closed 11 years ago

Auto-capitalization bug in Firefox for Android

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 28

People

(Reporter: trenzterra, Assigned: intrepid)

Details

(Whiteboard: [mentor=jchen][lang=java])

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

I have recently started using Firefox for Android, on my Samsung Galaxy S4 running Android 4.2.2.

I notice that in text boxes and such, no matter what keyboard I use (I tried stock, Swype and SwiftKey), despite turning on the auto-capitalisation feature, the first word of every sentence is somehow not capitalised in Firefox. There are no issues with other web browsers like Chrome. For the stock keyboard, it seems that only certain words are capitalised.


Actual results:

The first word of each sentence was not capitalised.


Expected results:

The first word of each sentence should be capitalised, which is the normal behaviour in most other Android apps.
OS: Windows 8 → Android
Hardware: x86_64 → ARM
Component: General → Keyboards and IME
Flags: needinfo?(nchen)
Summary: Auto-capitalisation bug in Firefox for Android → Auto-capitalization bug in Firefox for Android
I have an S4 (GT-I9505) and running Firefox Beta (22.0). I went to http://m.ncix.com and entered a variety of keywords in the search field and none of them were capitalized too.

I also tried Chrome and it didn't honour the system settings too (also tried on my Nexus 4).

Jim, in which cases do we honour auto-capitalization defined by the current IME keyboard and or system? Certain types of fields?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Same question for Chris; I guess either of you can answer
Flags: needinfo?(cpeterson)
In the search field mine is not auto-capitalised but textarea fields are capitalised for me in Chrome.
(In reply to Aaron Train [:aaronmt] from comment #1)
> Jim, in which cases do we honour auto-capitalization defined by the current
> IME keyboard and or system? Certain types of fields?

AaronMT, AFAIK this problem affects only our textarea elements. I think we just need to update the text attributes for our textarea elements.
Flags: needinfo?(cpeterson)
(In reply to Aaron Train [:aaronmt] from comment #1)
> Jim, in which cases do we honour auto-capitalization defined by the current
> IME keyboard and or system? Certain types of fields?

We default to lowercase, unless the page specifies one of the input modes, e.g. <textarea inputmode="autocapitalized">

But maybe we should default to autocapitalize
Flags: needinfo?(nchen)
Hello, I'm looking for a first bug to work on. Is anyone working on this bug or can I take this up and work on it? I have pulled the source code form mercurial and have successfully built and installed fennec. Is there a mentor for this bug?
I do not believe this bug is being worked on. It would be great if you could help out!
Jim, do you want to help mentor this bug?
Flags: needinfo?(nchen)
Yup; this is a good first bug.

Danielle, I've assigned the bug to you. Let me know if you have any questions.

The relevant code is at http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoInputConnection.java#618

We want to make "autocapitalized" the default option.
Assignee: nobody → icatchcows
Flags: needinfo?(nchen)
Whiteboard: [mentor=jchen][lang=java]
Hello, I am new to the Mozilla development community and am also looking for a first bug to work on.  I see that this bug has already been assigned, but can I also take a stab at it, or is that frowned upon?
Jacob: no one has updated this bug in two months, so I think you can safely work on it without upsetting anyone. :)

jchen can help you here or in Mozilla's #mobile IRC channel.
Assignee: icatchcows → jliebert90
Version: Firefox 24 → Trunk
Thanks a ton!
I tested this patch against a release version of Firefox Mobile, and the behavior was as expected.  Please let me know if there are any formatting mistakes I made, as this is my first contribution!
Attachment #8335694 - Flags: review?(nchen)
Please ignore the above patch, as I apparently submitted a blank patch file.  I'll fix it momentarily
Sorry for the first attachment, this one should have all the correct data.
Attachment #8335709 - Flags: review?(nchen)
Attachment #8335694 - Attachment is obsolete: true
Attachment #8335694 - Flags: review?(nchen)
Comment on attachment 8335709 [details] [diff] [review]
Changes default input mode for textviews to autocapitalize the first character in a sentence.

Review of attachment 8335709 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch! I have some comments about your patch, so I set it to feedback+. Feedback+ means the patch is going in the right direction, but it still needs some more work. Once you change your patch to address these comments, you should upload the new patch and ask for review again. Good work so far!

::: mobile/android/base/GeckoInputConnection.java
@@ +611,5 @@
>                  // empty mIMETypeHint indicates contentEditable/designMode documents
>                  outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_MULTI_LINE;
>              }
> +            if (mIMEModeHint.equalsIgnoreCase("lowercase"))
> +                outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_NORMAL;

I think we should keep the "uppercase" check. We still want TYPE_TEXT_FLAG_CAP_CHARACTERS for uppercase mode.

@@ +616,3 @@
>              else if (mIMEModeHint.equalsIgnoreCase("titlecase"))
>                  outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
> +            else 

Instead, we can check (!mIMEModeHint.equalsIgnoreCase("lowercase")) here.

@@ +619,2 @@
>                  outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
> +            // uppercase mode is the default

Should be "autocapitalized mode"
Attachment #8335709 - Flags: review?(nchen) → feedback+
Resubmitting according to feedback, behaves as expected when built and run on my Android device.  Thanks for the feedback!
Attachment #8335821 - Flags: review?(nchen)
Comment on attachment 8335821 [details] [diff] [review]
rev 2: Makes auto-capitalize the default text input mode for text views

Review of attachment 8335821 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great! Thanks!

It's good to put the bug number in front of the patch message, for example "Bug 871884 - Changed text input...". And we usually mark previous patches as obsolete when uploading new patches. Just a couple things to keep in mind for your next bug. :)
Attachment #8335821 - Flags: review?(nchen) → review+
Attachment #8335709 - Attachment is obsolete: true
I committed the patch here,

https://hg.mozilla.org/integration/mozilla-inbound/rev/f36dd96feee0

Nice work!
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/f36dd96feee0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
In my website, I have set the following in both the parent FORM element as well as in the text INPUT elements within the form:
autocomplete='off' autocapitalize='off' autocorrect='off' spellcheck='false'

All browsers in all operating systems, mobile and desktop, work perfectly EXCEPT for the combination of Firefox and Android (tested in an LG Nexus 4).

Firefox in Android insists on auto-capitalizing the first letter of the input field, and nothing seems able to stop it. Clearly a bug, and very frustrating.

Firefox in Android must respect autocapitalize='off', as it does in Windows.
(In reply to Alastair Gordon from comment #21)
> In my website, I have set the following in both the parent FORM element as
> well as in the text INPUT elements within the form:
> autocomplete='off' autocapitalize='off' autocorrect='off' spellcheck='false'
> 
> All browsers in all operating systems, mobile and desktop, work perfectly
> EXCEPT for the combination of Firefox and Android (tested in an LG Nexus 4).
> 
> Firefox in Android insists on auto-capitalizing the first letter of the
> input field, and nothing seems able to stop it. Clearly a bug, and very
> frustrating.
> 
> Firefox in Android must respect autocapitalize='off', as it does in Windows.

I believe we reverted this behaviour in bug 1092471, which has a fix in Firefox 37 which is going to Firefox Beta very soon.
That's good news, Aaron. Let's hear it for Open Source! I will likely await the stable version of Firefox 37. At least there are no changes I need to make to my site for Firefox in Android (which, in any case, is likely a rare combo).
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: