Closed Bug 18284 Opened 21 years ago Closed 21 years ago

[BETA BLOCKER] Length of Text field is counted same DBCS & SBCS


(Core :: DOM: Core & HTML, defect, P3)

Windows NT





(Reporter: teruko, Assigned: mozeditor)




In the text field of form, the length of text field should be counted by single

Steps of reproduce
1. Go to URL
2. Type Japanese characters in the first text field under Costomer ID: 2667
3. You can type 30 double byte characters
The characters after 18th double byte characters cannot be seen.

MaxLength should be counted by single byte.  In this case, you can type only
15 double byte characters in this field.

Tested 110808 Mac, Linux, and Win32 build.
Assignee: ftang → bobj
bob, please find a owner for this . Thanks.
Assignee: bobj → karnaze
Component: Internationalization → Form Submission
Forms input problem.
Assignee: karnaze → kmcclusk
Reassigning to Kevin.
Assignee: kmcclusk → buster
Assignee: buster → jfrancis
This problem is in nsTextEditRules::TruncateInsertionIfNeeded.  Reassign to
Summary: Length of Text field is counted same DBCS & SBCS → [BETA BLOCKER] Length of Text field is counted same DBCS & SBCS
Target Milestone: M13
setting to m13 -- it's a blocker
accepting bug
Closed: 21 years ago
Resolution: --- → INVALID
hmmm.  I'm gonna mark this invalid.  As far as I can tell from my freindly HTML
4.0 spec, maxlength is the number of characters, not the number of bytes.  If you
only want 15 JIS characters to be the maximum for that input field, then
maxlength should be set to 15.
OK, I found the spec of maxlength for HTML 4.0 and HTML 3.2.

Both docs say that maxlength means maximum number of characters the user may
enter. Communicator 4.x handles maxlength as the number of bytes.  I do not know
which is right.

Bob, do you have any ideas?
The spec clearly says "characters."  I think Nav 4.x behavior is a bug if it
equates characters to bytes.  I hesitate to offer a "quirks mode" fix that does
this wrong on purpose. I think that will be error prone.

What does IE do?

I think we should continue to do the right thing here as per spec.
We need to follow the spec.
I thought this worked at one time in the old code base.  I wonder if it
regressed at some point?
Verified as Invalid.
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.