Bug 5196 - input type=file fields with style=display:none do not post their values
Summary: input type=file fields with style=display:none do not post their values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL: http://www.designsolution.co.uk/safar...
Keywords: InRadar
: 8584 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-30 07:04 PDT by Glen Scott
Modified: 2007-04-22 16:34 PDT (History)
4 users (show)

See Also:


Attachments
Source code for test case (1.61 KB, text/php)
2006-02-07 05:47 PST, Glen Scott
no flags Details
patch with manual test and change log (8.63 KB, patch)
2007-04-22 10:51 PDT, Darin Adler
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Scott 2005-09-30 07:04:01 PDT
According the the HTML 4 specification:

Hidden controls and controls that are not rendered because of style sheet settings may still be successful.
http://www.w3.org/TR/REC-html40/interact/forms.html#successful-controls

Safari does not submit hidden file input elements.
Comment 1 Glen Scott 2006-02-07 01:59:22 PST
Updated URL to show a working example of the bug.
Comment 2 David Kilzer (:ddkilzer) 2006-02-07 05:17:56 PST
Confirmed.  Firefox 1.5 behaves as noted (it submits the element even though it's hidden via style).  Test on Webkit nightly r12619.

This bug may be related to Bug 6926 and Bug 3581 (other hidden-by-style issues).
Comment 3 David Kilzer (:ddkilzer) 2006-02-07 05:39:30 PST
This is not a regression from Safari 2.0.3 (417.8) on 10.4.4 as it behaves the same way.

Glen, could you attach the current index.php source from your web site to this bug as a test case?  Thanks!
Comment 4 Glen Scott 2006-02-07 05:47:29 PST
Created attachment 6327 [details]
Source code for test case
Comment 5 Barry Kaplan 2006-04-07 10:12:59 PDT
Curretnly I am using this bug to foil bug http://bugzilla.opendarwin.org/show_bug.cgi?id=8248
Comment 6 Alexey Proskuryakov 2006-04-25 21:44:55 PDT
*** Bug 8584 has been marked as a duplicate of this bug. ***
Comment 7 Alice Liu 2006-06-06 11:16:40 PDT
<rdar://problem/4537384>
Comment 8 Mark Malone 2006-07-12 08:46:35 PDT
and rdar://4537384
Comment 9 Mark Malone 2006-07-18 13:53:34 PDT
that is rdar://4573998
Comment 10 Darin Adler 2007-04-22 09:42:18 PDT
(In reply to comment #9)
> that is rdar://4573998

There's nothing in that bug report (Radar 4573998 ) that mentions hidden file input elements. Mark, if you know that this is indeed what's going on in that bug, then please add some clarification in Radar.
Comment 11 Darin Adler 2007-04-22 09:44:02 PDT
There are multiple ways to be "hidden" by style. I've retitled this to specifically talk about "display:none" as opposed to, say, "visibility:hidden".
Comment 12 Darin Adler 2007-04-22 10:51:58 PDT
Created attachment 14138 [details]
patch with manual test and change log
Comment 13 Maciej Stachowiak 2007-04-22 16:31:41 PDT
r=me

Reading this patch makes me wish we had classes that encapsulated the behavior of different Input types, instead of switch statements all over HTMLInputElement. This will likely become more important as we add support for more kinds of form controls, as suggested by Web Forms 2.
Comment 14 Darin Adler 2007-04-22 16:34:46 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/html/HTMLInputElement.cpp
Adding         WebCore/manual-tests/clear-input-file.html
Sending        WebCore/platform/FileChooser.cpp
Sending        WebCore/platform/FileChooser.h
Sending        WebCore/rendering/RenderFileUploadControl.cpp
Transmitting file data ......
Committed revision 21010.