Closed Bug 717600 Opened 9 years ago Closed 4 years ago

Maxlength attribute is ignored for typed characters with the vkb (even when composition string is committed)

Categories

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

ARM
Android
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
fennec + ---

People

(Reporter: martijn.martijn, Unassigned, Mentored)

References

()

Details

(Keywords: inputmethod)

Attachments

(1 file)

See first text input on http://miketaylr.com/pres/html5/forms2.html

Steps to reproduce:
- Tap on first text input, vkb comes up
- Type more than 6 characters in the text input

Expected result:
- No more text should appear than the first 6 characters

Actual result:
- All the text shows up that has been typed, even after the 6th character

With the context menu, the pasted text is cut off to 6 characters, so there it is not ignored.
I believe this is related to the editor.
Though, we are going to make that behavior the normal behavior with bug 613016.
Depends on: 613016
This is not a bug. The composition string must not be cut off by maxlength attribute because Japanese IME needs to be able to convert longer unconverted text to shorter converted text. (bug 98434) nsEditor cuts off when the composition string is committed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Not happening on the LG Optimus Black. The committed composition string is longer than 6 characters here.
Attached image Screenshot of bug
Isn't the *committed* string shrunk to the maxlength? If so, it's a bug, but I'm not sure why I cannot reproduce it on desktop Fx. nsEditor does handle the maxlength attribute.
Okay, I confirmed it. The committed string isn't shrunk to the maxlength on Android.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: Maxlength attribute is ignored for typed characters with the vkb → Maxlength attribute is ignored for typed characters with the vkb (even when composition string is committed)
Hmm, that's strange, if typing without IME, maxlength does work fine.
So, IsIMEComposing() return true here, right? <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/text/nsTextEditRules.cpp#1195>  No wonder we don't truncate insertion then!

I don't see the code responsible for doing the truncation when committing...
cc'ing Alexp.  Maybe he might be able to get some input.
I'm not sure if I understand comment 11.  What I was trying to say in comment 9 is that I think we should look at the maxlength property and truncate the insertion if needed when committing an IME transaction.  Do you agree?
Assignee: nobody → alexp
tracking-fennec: --- → +
Priority: -- → P4
Assignee: alex.mozilla → cpeterson
Component: General → IME
Assignee: cpeterson → nobody
Status: REOPENED → NEW
Whiteboard: [mentor=jchen]
Mentor: nchen
Whiteboard: [mentor=jchen]
latest build seems cannot reproduce.
Status: NEW → RESOLVED
Closed: 9 years ago4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.