Bug 161644 - Add support for input.minLength / textArea.minLength
Summary: Add support for input.minLength / textArea.minLength
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
: minlength (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-06 14:13 PDT by Chris Dumez
Modified: 2016-09-29 09:57 PDT (History)
6 users (show)

See Also:


Attachments
Patch (72.63 KB, patch)
2016-09-06 14:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (73.32 KB, patch)
2016-09-06 14:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (74.61 KB, patch)
2016-09-06 15:40 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (78.88 KB, patch)
2016-09-06 16:16 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (78.88 KB, patch)
2016-09-06 16:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-09-06 14:13:23 PDT
Add support for input.minLength / textArea.minLength:
- https://html.spec.whatwg.org/#dom-input-minlength
- https://html.spec.whatwg.org/#dom-textarea-minlength

Chrome implements this, Firefox does not yet.
Comment 1 Chris Dumez 2016-09-06 14:39:45 PDT
Created attachment 288046 [details]
Patch
Comment 2 Chris Dumez 2016-09-06 14:50:48 PDT
Created attachment 288048 [details]
Patch
Comment 3 Chris Dumez 2016-09-06 15:40:06 PDT
Created attachment 288054 [details]
Patch
Comment 4 Darin Adler 2016-09-06 15:46:39 PDT
Comment on attachment 288054 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288054&action=review

> Source/WebCore/html/HTMLInputElement.cpp:297
> +        // Return false for the default value or a value set by a script even if
> +        // it is longer than maxLength.

Comment here mentions maxLength. That must be wrong.

> Source/WebCore/html/HTMLInputElement.h:408
> +    bool tooShort(const String&, NeedsToCheckDirtyFlag) const;

Seems like this should take a StringView, not a String.
Comment 5 Chris Dumez 2016-09-06 16:16:38 PDT
Created attachment 288062 [details]
Patch
Comment 6 Chris Dumez 2016-09-06 16:29:13 PDT
Created attachment 288065 [details]
Patch
Comment 7 WebKit Commit Bot 2016-09-06 17:02:11 PDT
Comment on attachment 288065 [details]
Patch

Clearing flags on attachment: 288065

Committed r205524: <http://trac.webkit.org/changeset/205524>
Comment 8 WebKit Commit Bot 2016-09-06 17:02:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Chris Rebert 2016-09-29 00:20:59 PDT
The "Assigning non-numeric to minlength sets minlength to 0" test in
http://w3c-test.org/html/semantics/forms/the-input-element/minlength.html
is still failing.
Comment 10 Chris Rebert 2016-09-29 00:22:33 PDT
*** Bug 149832 has been marked as a duplicate of this bug. ***
Comment 11 Chris Dumez 2016-09-29 08:58:41 PDT
(In reply to comment #9)
> The "Assigning non-numeric to minlength sets minlength to 0" test in
> http://w3c-test.org/html/semantics/forms/the-input-element/minlength.html
> is still failing.

Thanks for letting me know. I'll fix this soon:
https://bugs.webkit.org/show_bug.cgi?id=162727
Comment 12 Ryosuke Niwa 2016-09-29 09:57:26 PDT
We should also treat CRLF as one character per the recent spec change if we haven't done so.