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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: the.decryptor, Assigned: mounir)

References

()

Details

Attachments

(1 file)

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.
This needs to block, I think. Mounir, please fix?
Assignee: nobody → mounir.lamouri
Status: UNCONFIRMED → NEW
blocking2.0: --- → ?
Ever confirmed: true
blocking2.0: ? → betaN+
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
Attached patch Patch v1Splinter Review
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)
Attachment #478437 - Flags: review?(Olli.Pettay) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Summary: maxlength attribute sholud not apply to all input types → maxlength attribute should not apply to all input types
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: