RESOLVED FIXED67015
REGRESSION(r93390): Invalid maxlength attribute causes input to allow no text
https://bugs.webkit.org/show_bug.cgi?id=67015
Summary REGRESSION(r93390): Invalid maxlength attribute causes input to allow no text
Shinya Kawanaka
Reported 2011-08-25 20:53:29 PDT
input having empty or invalid maxlength does not allow inserting text. Such a attribute should be ignored.
Attachments
Patch (6.24 KB, patch)
2011-08-25 21:22 PDT, Shinya Kawanaka
no flags
Patch (6.22 KB, patch)
2011-08-26 00:39 PDT, Shinya Kawanaka
no flags
Patch (6.20 KB, patch)
2011-08-26 00:57 PDT, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2011-08-25 21:22:25 PDT
Kent Tamura
Comment 2 2011-08-25 22:27:47 PDT
Comment on attachment 105302 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105302&action=review > LayoutTests/ChangeLog:3 > + Empty or invalid maxlength of an input tag should be ignored. Please prepend "REGRESSION(r93390): " to the summary. It's a WebKit idiom for a regression. > Source/WebCore/ChangeLog:3 > + Empty or invalid maxlength of an input tag should be ignored. ditto. > Source/WebCore/html/HTMLInputElement.cpp:1926 > + bool ok = true; > + int maxLength = attribute->isNull() ? maximumLength : attribute->value().toInt(&ok); > + if (!ok || maxLength < 0 || maxLength > maximumLength) Please use parseHTMLInteger() in WebCore/html/parser/HTMLParserIdioms.h
Shinya Kawanaka
Comment 3 2011-08-26 00:39:21 PDT
Kent Tamura
Comment 4 2011-08-26 00:45:36 PDT
Comment on attachment 105321 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105321&action=review > Source/WebCore/html/HTMLInputElement.cpp:1925 > + if (attribute->isNull() || !parseHTMLInteger(attribute->value(), maxLength)) I think attribute->isNull()|| is not needed.
Shinya Kawanaka
Comment 5 2011-08-26 00:57:09 PDT
Kent Tamura
Comment 6 2011-08-26 00:58:14 PDT
Comment on attachment 105326 [details] Patch ok. Thank you for the quick fix!
WebKit Review Bot
Comment 7 2011-08-26 01:59:14 PDT
Comment on attachment 105326 [details] Patch Clearing flags on attachment: 105326 Committed r93858: <http://trac.webkit.org/changeset/93858>
WebKit Review Bot
Comment 8 2011-08-26 01:59:18 PDT
All reviewed patches have been landed. Closing bug.
Ilya Sherman
Comment 9 2011-08-26 02:59:03 PDT
Indeed, the quick fix is much appreciated. Thank you!
Note You need to log in before you can comment on or make changes to this bug.