Bug 154342
Summary: | Textarea does not count newlines properly against maxlength | ||
---|---|---|---|
Product: | WebKit | Reporter: | Aaron Nance <aaron.nance> |
Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | cdumez, hi+webkit, rniwa |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Mac | ||
OS: | OS X 10.10 |
Aaron Nance
Hard carriage returns are being counted as 2 characters against the maxlength attribute. For example, if you have a textarea with a maxlength="20" and type "0123" and press enter, copy all, and paste as much as you can you'd expect the field to contain:
0123(newline)
0123(newline)
0123(newline)
0123(newline)
But what you get is
0123(newline)
0123(newline)
0123(newline)
01
I've added the (newline) to clarify the newline characters.
Each newline is being treated as a CR+LF instead of just a LF in the DOM.
This seems to be the same as ID 74686, which is marked as fixed, but still appears to be broken.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Sam Sneddon [:gsnedders]
this recently came up in https://github.com/mdn/browser-compat-data/issues/11988
re bug 74686, as the last comment there shows, the spec here changed in 2016: https://github.com/whatwg/html/commit/163703186794c21daa92cc2718218afa44f26071
(no WPT tests for this, far as I can tell)
mxdvl
This may be a duplicate of https://bugs.webkit.org/show_bug.cgi?id=249916 and may have been fixed by https://github.com/WebKit/WebKit/commit/2252898e2468994720be25176170e00bc7b26ca3
Ryosuke Niwa
This is indeed addressed by the bug 249916.
*** This bug has been marked as a duplicate of bug 249916 ***