Closed
Bug 524421
Opened 15 years ago
Closed 15 years ago
input[type=file] has a file even if empty
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | final-fixed |
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file, 2 obsolete files)
5.57 KB,
patch
|
sicking
:
review+
smaug
:
superreview+
|
Details | Diff | Splinter Review |
A file input control contains one file, even if none have been chosen. Presumably this was to clear the textbox of the control, but it's unnecessary. It also results in: * (javascript) target.files.length = 1 * an empty file being sent over HTTP (although IE and Webkit also do this)
Attachment #408333 -
Flags: review?(jonas)
Comment on attachment 408333 [details] [diff] [review] proposed fix >+ void ClearFileNames() { >+ nsAutoTArray<nsString, 0> fileNames; >+ SetFileNames(fileNames); >+ } Simply use |nsTArray<nsString> fileNames| instead. And can you add DEBUG-only code to SetFileNames that asserts that none of the file names is an empty string. Also, can you add a testcase as well? Like modify test_bug523771.html to test that input.files.length == 0 before any files are filled, and after .value is set to "".
Assignee | ||
Comment 2•15 years ago
|
||
Attachment #408333 -
Attachment is obsolete: true
Attachment #408350 -
Flags: review?(jonas)
Attachment #408333 -
Flags: review?(jonas)
Attachment #408350 -
Flags: review?(jonas) → review+
Comment on attachment 408350 [details] [diff] [review] v2 Awesome, thanks!
Assignee | ||
Updated•15 years ago
|
Attachment #408350 -
Flags: superreview?(Olli.Pettay)
Updated•15 years ago
|
Attachment #408350 -
Flags: superreview?(Olli.Pettay) → superreview+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Landed on trunk. Thanks for the patch! http://hg.mozilla.org/mozilla-central/rev/c9bf888d5fd7
Branch-patch also containing fix for bug 524421
Assignee: geoff → jonas
Attachment #408724 -
Flags: approval1.9.2?
Comment on attachment 408724 [details] [diff] [review] Branch patch Oops, wrong bug
Attachment #408724 -
Attachment is obsolete: true
Attachment #408724 -
Flags: approval1.9.2?
Attachment #408350 -
Flags: approval1.9.2?
Oh, crap, yes! I thought it already had landed there
Flags: wanted1.9.2? → wanted1.9.2+
Comment on attachment 408350 [details] [diff] [review] v2 Nevermind, this is fixed on 1.9.2. I think I included it in the initial landing of the multiple feature there.
Attachment #408350 -
Flags: approval1.9.2?
Comment 10•15 years ago
|
||
So I'll just set the status flag to final-fixed. This will help verify that this was indeed fixed on 1.9.2.
status1.9.2:
--- → final-fixed
Keywords: verifyme
Updated•5 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•