Line break and characters count while copy-pasting in a maxlength field
Reported by
miclo.th...@gmail.com,
Mar 7 2016
|
|||||
Issue description
Chrome Version : 48.0.2564.116 (Official Build) m (32-bit)
What steps will reproduce the problem?
1. Open test.html which has a maxlength="200"
2. try to past this text:
"För att ta dig till Saltoluokta med kollektivtrafik tar du tåg eller flyg till Gällivare, därefter buss 93 mot Ritsem. Kliv av i Kebnats, därefter båt på sommaren eller markerad isled på vintern.
Sommar"
It is 205 characters (counting line breaks) so it gets shortened.
3. Try to submit the form
What is the expected result?
Since if I remove a character, I cannot write more, I think the expected result is that it should be shortened the same way characters are counted on form submit/textarea change.
What happens instead?
It must be counting the Javascript basic way textareaValue.length so it allows me to copy-paste more than I should be able to do.
Other browsers tested:
Firefox: Stops me at 202 characters but doesn't care at submit anyway
EDGE: Same
,
Mar 31 2016
,
Mar 31 2016
maxlength doesn't restrict textarea.value.length, but form submitted value length. So, the validation message is correct. The cutting behavior on paste looks to have a bug.
,
Apr 1 2016
,
Apr 1 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ddcf7881eed02133eac48444d0dec01eeae86438 commit ddcf7881eed02133eac48444d0dec01eeae86438 Author: tkent <tkent@chromium.org> Date: Fri Apr 01 07:11:59 2016 Newline characters in pasted text are not counted correctly for textarea[maxlength]. HTMLTextAreaElement::sanitizeUserInputValue didn't take care of LF->CRLF conversion. BUG= 592448 Review URL: https://codereview.chromium.org/1846913005 Cr-Commit-Position: refs/heads/master@{#384508} [modify] https://crrev.com/ddcf7881eed02133eac48444d0dec01eeae86438/third_party/WebKit/Source/core/core.gypi [modify] https://crrev.com/ddcf7881eed02133eac48444d0dec01eeae86438/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp [modify] https://crrev.com/ddcf7881eed02133eac48444d0dec01eeae86438/third_party/WebKit/Source/core/html/HTMLTextAreaElement.h [add] https://crrev.com/ddcf7881eed02133eac48444d0dec01eeae86438/third_party/WebKit/Source/core/html/HTMLTextAreaElementTest.cpp
,
Apr 1 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Mar 31 2016