⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285932 in webkit


Ignore:
Timestamp:
Nov 17, 2021, 9:27:34 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Fix formatting and string literals in FileInputType.cpp
https://bugs.webkit.org/show_bug.cgi?id=233229

Patch by Andreu Botella <andreu@andreubotella.com> on 2021-11-17
Reviewed by Darin Adler.

This change uses the emptyString() and defaultMIMEType() functions rather than using string
literals, fixes the coding style, and reverts an unnecessary change in the comments.

This fixes code review suggestions from https://bugs.webkit.org/show_bug.cgi?id=185416 and
https://bugs.webkit.org/show_bug.cgi?id=221549

  • html/FileInputType.cpp:

(WebCore::FileInputType::appendFormData const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r285931 r285932  
     12021-11-17  Andreu Botella  <andreu@andreubotella.com>
     2
     3        Fix formatting and string literals in FileInputType.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=233229
     5
     6        Reviewed by Darin Adler.
     7
     8        This change uses the emptyString() and defaultMIMEType() functions rather than using string
     9        literals, fixes the coding style, and reverts an unnecessary change in the comments.
     10
     11        This fixes code review suggestions from https://bugs.webkit.org/show_bug.cgi?id=185416 and
     12        https://bugs.webkit.org/show_bug.cgi?id=221549
     13
     14        * html/FileInputType.cpp:
     15        (WebCore::FileInputType::appendFormData const):
     16
    1172021-11-17  Alan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/html/FileInputType.cpp

    r285861 r285932  
    172172
    173173        if (fileList->isEmpty())
    174             formData.append(name, "");
     174            formData.append(name, emptyString());
    175175
    176176        for (auto& file : fileList->files())
     
    179179    }
    180180
    181     // If no filename at all is entered, return successful but empty, with
    182     // application/octet-stream content type. Null would be more logical, but
    183     // Netscape posts an empty file. Argh.
     181    // If no filename at all is entered, return successful but empty.
     182    // Null would be more logical, but Netscape posts an empty file. Argh.
    184183    if (fileList->isEmpty()) {
    185184        auto* document = element() ? &element()->document() : nullptr;
    186         auto file = File::create(
    187             document,
    188             Blob::create(document, { }, "application/octet-stream"),
    189             emptyString());
     185        auto file = File::create(document, Blob::create(document, { }, defaultMIMEType()), emptyString());
    190186        formData.append(name, file);
    191187        return true;
Note: See TracChangeset for help on using the changeset viewer.