Bug 65497 - maxlength = 0 on input is ignored
Summary: maxlength = 0 on input is ignored
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://jsfiddle.net/nimbu/PFKcB/
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-01 16:39 PDT by Divya Manian
Modified: 2011-08-19 01:47 PDT (History)
2 users (show)

See Also:


Attachments
Patch (3.98 KB, patch)
2011-08-18 19:32 PDT, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (8.90 KB, patch)
2011-08-18 22:47 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 Divya Manian 2011-08-01 16:39:52 PDT
I have no idea why anyone would do this, but it should be possible. 

Opera's latest snapshot, FF both do abide by maxlength.
Comment 1 Kent Tamura 2011-08-01 23:56:34 PDT
Chromium bug: http://code.google.com/p/chromium/issues/detail?id=89732
Comment 2 Shinya Kawanaka 2011-08-18 19:32:54 PDT
Created attachment 104437 [details]
Patch
Comment 3 Kent Tamura 2011-08-18 19:57:19 PDT
Comment on attachment 104437 [details]
Patch

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

Thank you for fixing this.
The change looks ok.

> LayoutTests/fast/forms/input-text-paste-maxlength.html:102
> +debug("pasting too much text with maxlength=0");
> +document.getElementById("l").focus();
> +document.execCommand("InsertHTML", false, "12x̲̅45");
> +shouldBe("domValueOf('l')", "''");
> +shouldBe("visibleValueOf('l')", "''");
> +

Would you add similar test cases to fast/forms/textarea-maxlength.html please?
Comment 4 Shinya Kawanaka 2011-08-18 22:47:19 PDT
Created attachment 104463 [details]
Patch
Comment 5 Kent Tamura 2011-08-19 00:47:53 PDT
Comment on attachment 104463 [details]
Patch

Thanks!
Comment 6 WebKit Review Bot 2011-08-19 01:46:59 PDT
Comment on attachment 104463 [details]
Patch

Clearing flags on attachment: 104463

Committed r93390: <http://trac.webkit.org/changeset/93390>
Comment 7 WebKit Review Bot 2011-08-19 01:47:04 PDT
All reviewed patches have been landed.  Closing bug.