[Webkit-unassigned] [Bug 120030] input/textarea: Count text length for maxLength check with the standard way

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 20 09:29:22 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=120030





--- Comment #4 from Darin Adler <darin at apple.com>  2013-08-20 09:28:51 PST ---
(In reply to comment #1)
> Darin, do you know why we do what we currently do? (i.e. count grapheme clusters).

The original reason was that I understood maxlength as trying to limit to number of characters that fit physically into a fixed size text field. When a font was fixed width or nearly so, it made sense to count the U character and umlaut character that combined with it as a single one rather than letting the internal representation affect the length. It’s particularly bad because decomposed and precomposed strings that look identical have different lengths! And it seems super silly to have non-BMP characters count as two characters!

If maxlength is instead present to try to avoid violating a server protocol, then I could understand it being limit on the number of UTF-16 units instead. But then why not UTF-8 units?

Maybe wide characters are a concern too. Anyway, we should match the standard, but it’s nuts that the standard does not consider actual end user concepts of string length and instead concentrates on internals in this way.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list