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
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
Created attachment 478437 [details] [diff] [review] Patch v1 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
Last Resolved: 9 years ago
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.