Closed
Bug 598643
Opened 14 years ago
Closed 14 years ago
maxlength attribute should not apply to all input types
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: the.decryptor, Assigned: mounir)
References
()
Details
Attachments
(1 file)
6.17 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20100922 Firefox/4.0b7pre
Build Identifier:
The maxlength attribute applies to <input type="file"> fields, causing them to block the form they are associated with from being submitted.
From the reading the spec, I gather this isn't supposed to happen (it's supposed to be ignored), the documentation on the MDC also says this.
https://developer.mozilla.org/en/HTML/Element/input#attr-maxlength
Reproducible: Always
Steps to Reproduce:
1. Open data:text/html,<input type="file" maxlength="1">
2. Select a random file
3. Notice it gets the red box-shadow specifying it's "invalid"
Actual Results:
maxlength attribute is ignored, control isn't marked invalid.
Comment 1•14 years ago
|
||
This needs to block, I think. Mounir, please fix?
Assignee: nobody → mounir.lamouri
Status: UNCONFIRMED → NEW
blocking2.0: --- → ?
Ever confirmed: true
Updated•14 years ago
|
blocking2.0: ? → betaN+
Assignee | ||
Comment 2•14 years ago
|
||
Ok, the problem is maxlength should only apply to some types and we are checking maxlength whatever the type is, which is wrong.
Status: NEW → ASSIGNED
Component: HTML: Form Submission → DOM: Core & HTML
OS: Windows 7 → All
QA Contact: form-submission → general
Hardware: x86 → All
Summary: maxlength attribute applies to file input fields, interacts badly with HTML5 form validation. → maxlength attribute sholud not apply to all input types
Version: unspecified → Trunk
Assignee | ||
Comment 3•14 years ago
|
||
This was also applying to other input types in some cases like:
<input type='text' id='i' maxlength='1'>
<script>
document.getElementById('i').value = "foo";
document.getElementById('i').type = "radio";
</script>
Attachment #478437 -
Flags: review?(Olli.Pettay)
Updated•14 years ago
|
Attachment #478437 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 4•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Summary: maxlength attribute sholud not apply to all input types → maxlength attribute should not apply to all input types
Updated•14 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in
before you can comment on or make changes to this bug.
Description
•