Changeset 45987 in webkit


Ignore:
Timestamp:
Jul 16, 2009 3:02:37 PM (15 years ago)
Author:
abarth@webkit.org
Message:

2009-07-16 Kent Tamura <tkent@chromium.org>

Reviewed by Eric Seidel.

A test for for non-multipart file upload form submission.
<https://bugs.webkit.org/show_bug.cgi?id=26505>

  • fast/forms/get-file-upload-expected.txt: Added.
  • fast/forms/get-file-upload.html: Added.

2009-07-16 Kent Tamura <tkent@chromium.org>

Reviewed by Eric Seidel.

Sends the basename of a selected file for non-multipart form submission.
<https://bugs.webkit.org/show_bug.cgi?id=26505>

Test: fast/forms/get-file-upload.html

  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::appendFormData):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r45983 r45987  
     12009-07-16  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        A test for for non-multipart file upload form submission.
     6        <https://bugs.webkit.org/show_bug.cgi?id=26505>
     7
     8        * fast/forms/get-file-upload-expected.txt: Added.
     9        * fast/forms/get-file-upload.html: Added.
     10
    1112009-07-15  Adam Barth  <abarth@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r45986 r45987  
     12009-07-16  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Sends the basename of a selected file for non-multipart form submission.
     6        <https://bugs.webkit.org/show_bug.cgi?id=26505>
     7
     8        Test: fast/forms/get-file-upload.html
     9
     10        * html/HTMLInputElement.cpp:
     11        (WebCore::HTMLInputElement::appendFormData):
     12
    1132009-07-16  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/WebCore/html/HTMLInputElement.cpp

    r45747 r45987  
    839839
    840840        case FILE: {
    841             // Can't submit file on GET.
    842             if (!multipart)
    843                 return false;
     841            unsigned numFiles = m_fileList->length();
     842            if (!multipart) {
     843                // Send only the basenames.
     844                // 4.10.16.4 and 4.10.16.6 sections in HTML5.
     845
     846                // Unlike the multipart case, we have no special
     847                // handling for the empty fileList because Netscape
     848                // doesn't support for non-multipart submission of
     849                // file inputs, and Firefox doesn't add "name=" query
     850                // parameter.
     851
     852                for (unsigned i = 0; i < numFiles; ++i) {
     853                    encoding.appendData(name(), m_fileList->item(i)->fileName());
     854                }
     855                return true;
     856            }
    844857
    845858            // If no filename at all is entered, return successful but empty.
    846859            // Null would be more logical, but Netscape posts an empty file. Argh.
    847             unsigned numFiles = m_fileList->length();
    848860            if (!numFiles) {
    849861                encoding.appendFile(name(), File::create(""));
Note: See TracChangeset for help on using the changeset viewer.