When I use autocomplete, the html element "textarea" with the attribute "maxLength" can insert text that is biger then a value of maxLength.
Reported by
dmitry.s...@gmail.com,
Dec 29 2017
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Steps to reproduce the problem: 1. I have got a form with <input> and <textarea> 2. I type the name in the <input> 3. Browser suggests me autocomplete 4. When I selected the name from the gropdown, textarea was autocompleted too 5. Value of textarea was bigger maxLength What is the expected behavior? Value of textarea has to be equal maxLength What went wrong? Value of textarea eas not equal maxLength Did this work before? N/A Does this work in other browsers? N/A Chrome version: 63.0.3239.84 Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version:
,
Jan 1 2018
Thanks for filing the issue @Reporter: Can you please provide the sample test file/URL to test this issue which helps us to triage it in a better way from TE end. Thanks!
,
Jan 1 2018
,
Jan 9 2018
,
Jan 9 2018
,
Jan 19 2018
tkent@ & keishi@ I looked at the code and I can't seem to find a place in particular from SetValue where it would resize the value. It seems to do it by itself. Do you know where that happens? I could maybe do the same thing for textarea. Otherwise, I think I'd add a SetAutofillValue in both HTMLInputElement and HTMLTextAreaElement and I'd do the trimming there. What do you think?
,
Jan 22 2018
In general maxlength restricts only user-input, and doesn't restrict value IDL setter. HTMLTextAreaElement::HandleBeforeTextInsertedEvent() doesn't work for Blink's setValue() functions. On autofilling <input>, maxlength is handled at https://cs.chromium.org/chromium/src/components/autofill/content/renderer/autofill_agent.cc?type=cs&sq=package:chromium&l=672 . Moving such maxlength handling to somewhere inside of WebFormControlElement::SetAutofillValue() sounds reasonable.
,
Jan 24 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/778c4369e0f70c9902b2cd7e43c63d2baf935b08 commit 778c4369e0f70c9902b2cd7e43c63d2baf935b08 Author: sebsg <sebsg@chromium.org> Date: Wed Jan 24 20:01:32 2018 [Autofill] Truncate autofill suggestions and fills to maxlength. Bug: 798079 Change-Id: I45d5bdf444d8d8d1605593afa83dfe25d68d3bb0 Reviewed-on: https://chromium-review.googlesource.com/862259 Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#531657} [modify] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/components/autofill/content/renderer/autofill_agent.cc [add] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/LayoutTests/fast/forms/autofill-respects-maxlength.html [add] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/LayoutTests/fast/forms/text/input-appearance-autocomplete-suggestion-maxlength-expected.html [add] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/LayoutTests/fast/forms/text/input-appearance-autocomplete-suggestion-maxlength.html [add] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/LayoutTests/fast/forms/text/textarea-appearance-autocomplete-suggestion-maxlength-expected.html [add] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/LayoutTests/fast/forms/text/textarea-appearance-autocomplete-suggestion-maxlength.html [modify] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/Source/core/exported/WebFormControlElement.cpp [modify] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/Source/core/html/forms/TextControlElement.cpp [modify] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/Source/core/html/forms/TextControlElement.h [modify] https://crrev.com/778c4369e0f70c9902b2cd7e43c63d2baf935b08/third_party/WebKit/Source/core/testing/Internals.cpp
,
Jan 24 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by krajshree@chromium.org
, Dec 29 2017