Title: [285932] trunk/Source/WebCore
- Revision
- 285932
- Author
- [email protected]
- Date
- 2021-11-17 09:27:34 -0800 (Wed, 17 Nov 2021)
Log Message
Fix formatting and string literals in FileInputType.cpp
https://bugs.webkit.org/show_bug.cgi?id=233229
Patch by Andreu Botella <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (285931 => 285932)
--- trunk/Source/WebCore/ChangeLog 2021-11-17 16:30:20 UTC (rev 285931)
+++ trunk/Source/WebCore/ChangeLog 2021-11-17 17:27:34 UTC (rev 285932)
@@ -1,3 +1,19 @@
+2021-11-17 Andreu Botella <[email protected]>
+
+ Fix formatting and string literals in FileInputType.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=233229
+
+ 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):
+
2021-11-17 Alan Bujtas <[email protected]>
[LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/white-space-intrinsic-size-013.html
Modified: trunk/Source/WebCore/html/FileInputType.cpp (285931 => 285932)
--- trunk/Source/WebCore/html/FileInputType.cpp 2021-11-17 16:30:20 UTC (rev 285931)
+++ trunk/Source/WebCore/html/FileInputType.cpp 2021-11-17 17:27:34 UTC (rev 285932)
@@ -171,7 +171,7 @@
// 4.10.16.4 and 4.10.16.6 sections in HTML5.
if (fileList->isEmpty())
- formData.append(name, "");
+ formData.append(name, emptyString());
for (auto& file : fileList->files())
formData.append(name, file->name());
@@ -178,15 +178,11 @@
return true;
}
- // If no filename at all is entered, return successful but empty, with
- // application/octet-stream content type. Null would be more logical, but
- // Netscape posts an empty file. Argh.
+ // If no filename at all is entered, return successful but empty.
+ // Null would be more logical, but Netscape posts an empty file. Argh.
if (fileList->isEmpty()) {
auto* document = element() ? &element()->document() : nullptr;
- auto file = File::create(
- document,
- Blob::create(document, { }, "application/octet-stream"),
- emptyString());
+ auto file = File::create(document, Blob::create(document, { }, defaultMIMEType()), emptyString());
formData.append(name, file);
return true;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes