Bug 67015 - REGRESSION(r93390): Invalid maxlength attribute causes input to allow no text
Summary: REGRESSION(r93390): Invalid maxlength attribute causes input to allow no text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Nobody
URL: http://code.google.com/p/chromium/iss...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 20:53 PDT by Shinya Kawanaka
Modified: 2011-08-26 02:59 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.24 KB, patch)
2011-08-25 21:22 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (6.22 KB, patch)
2011-08-26 00:39 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (6.20 KB, patch)
2011-08-26 00:57 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2011-08-25 20:53:29 PDT
input having empty or invalid maxlength does not allow inserting text. Such a attribute should be ignored.
Comment 1 Shinya Kawanaka 2011-08-25 21:22:25 PDT
Created attachment 105302 [details]
Patch
Comment 2 Kent Tamura 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
Comment 3 Shinya Kawanaka 2011-08-26 00:39:21 PDT
Created attachment 105321 [details]
Patch
Comment 4 Kent Tamura 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.
Comment 5 Shinya Kawanaka 2011-08-26 00:57:09 PDT
Created attachment 105326 [details]
Patch
Comment 6 Kent Tamura 2011-08-26 00:58:14 PDT
Comment on attachment 105326 [details]
Patch

ok.  Thank you for the quick fix!
Comment 7 WebKit Review Bot 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>
Comment 8 WebKit Review Bot 2011-08-26 01:59:18 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Ilya Sherman 2011-08-26 02:59:03 PDT
Indeed, the quick fix is much appreciated.  Thank you!