Title: [266181] trunk
- Revision
- 266181
- Author
- [email protected]
- Date
- 2020-08-26 12:44:41 -0700 (Wed, 26 Aug 2020)
Log Message
Use endings from FilePropertyBag when constructing Blob data from the File
https://bugs.webkit.org/show_bug.cgi?id=215857
Patch by Alex Christensen <[email protected]> on 2020-08-26
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
* web-platform-tests/FileAPI/file/File-constructor-endings-expected.txt:
Source/WebCore:
We had an unnecessary conversion function that converted one of the two properties of BlobPropertyBag (endings was missing).
Since FilePropertyBag inherits from BlobPropertyBag, just use the original FilePropertyBag to get both properties.
Covered by newly-passing WPT tests that Chrome and Firefox both pass.
* fileapi/File.cpp:
(WebCore::File::File):
(WebCore::convertPropertyBag): Deleted.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (266180 => 266181)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-26 19:36:45 UTC (rev 266180)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-26 19:44:41 UTC (rev 266181)
@@ -1,3 +1,12 @@
+2020-08-26 Alex Christensen <[email protected]>
+
+ Use endings from FilePropertyBag when constructing Blob data from the File
+ https://bugs.webkit.org/show_bug.cgi?id=215857
+
+ Reviewed by Darin Adler.
+
+ * web-platform-tests/FileAPI/file/File-constructor-endings-expected.txt:
+
2020-08-26 Youenn Fablet <[email protected]>
Abort pipeTo based on AbortSignal
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings-expected.txt (266180 => 266181)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings-expected.txt 2020-08-26 19:36:45 UTC (rev 266180)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings-expected.txt 2020-08-26 19:44:41 UTC (rev 266181)
@@ -15,33 +15,33 @@
PASS Input LF with endings 'native'
PASS Input CR with endings unspecified
PASS Input CR with endings 'transparent'
-FAIL Input CR with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n" but got "\r"
+PASS Input CR with endings 'native'
PASS Input CRLF with endings unspecified
PASS Input CRLF with endings 'transparent'
-FAIL Input CRLF with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n" but got "\r\n"
+PASS Input CRLF with endings 'native'
PASS Input CRCR with endings unspecified
PASS Input CRCR with endings 'transparent'
-FAIL Input CRCR with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\r\r"
+PASS Input CRCR with endings 'native'
PASS Input LFCR with endings unspecified
PASS Input LFCR with endings 'transparent'
-FAIL Input LFCR with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\n\r"
+PASS Input LFCR with endings 'native'
PASS Input LFLF with endings unspecified
PASS Input LFLF with endings 'transparent'
PASS Input LFLF with endings 'native'
PASS Input CRCRLF with endings unspecified
PASS Input CRCRLF with endings 'transparent'
-FAIL Input CRCRLF with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\r\r\n"
+PASS Input CRCRLF with endings 'native'
PASS Input CRLFLF with endings unspecified
PASS Input CRLFLF with endings 'transparent'
-FAIL Input CRLFLF with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\r\n\n"
+PASS Input CRLFLF with endings 'native'
PASS Input CRLFCR with endings unspecified
PASS Input CRLFCR with endings 'transparent'
-FAIL Input CRLFCR with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\r\n\r\n"
+PASS Input CRLFCR with endings 'native'
PASS Input CRLFCRLF with endings unspecified
PASS Input CRLFCRLF with endings 'transparent'
-FAIL Input CRLFCRLF with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n" but got "\r\n\r\n"
+PASS Input CRLFCRLF with endings 'native'
PASS Input LFCRLFCR with endings unspecified
PASS Input LFCRLFCR with endings 'transparent'
-FAIL Input LFCRLFCR with endings 'native' assert_equals: Newlines should match the platform with endings "native" expected "\n\n\n" but got "\n\r\n\r"
-FAIL CR/LF in adjacent input strings assert_equals: CR/LF in adjacent strings should be converted to two platform newlines expected "\n\n" but got "\r\n"
+PASS Input LFCRLFCR with endings 'native'
+PASS CR/LF in adjacent input strings
Modified: trunk/Source/WebCore/ChangeLog (266180 => 266181)
--- trunk/Source/WebCore/ChangeLog 2020-08-26 19:36:45 UTC (rev 266180)
+++ trunk/Source/WebCore/ChangeLog 2020-08-26 19:44:41 UTC (rev 266181)
@@ -1,3 +1,19 @@
+2020-08-26 Alex Christensen <[email protected]>
+
+ Use endings from FilePropertyBag when constructing Blob data from the File
+ https://bugs.webkit.org/show_bug.cgi?id=215857
+
+ Reviewed by Darin Adler.
+
+ We had an unnecessary conversion function that converted one of the two properties of BlobPropertyBag (endings was missing).
+ Since FilePropertyBag inherits from BlobPropertyBag, just use the original FilePropertyBag to get both properties.
+
+ Covered by newly-passing WPT tests that Chrome and Firefox both pass.
+
+ * fileapi/File.cpp:
+ (WebCore::File::File):
+ (WebCore::convertPropertyBag): Deleted.
+
2020-08-26 Youenn Fablet <[email protected]>
Abort pipeTo based on AbortSignal
Modified: trunk/Source/WebCore/fileapi/File.cpp (266180 => 266181)
--- trunk/Source/WebCore/fileapi/File.cpp 2020-08-26 19:36:45 UTC (rev 266180)
+++ trunk/Source/WebCore/fileapi/File.cpp 2020-08-26 19:44:41 UTC (rev 266181)
@@ -76,15 +76,8 @@
{
}
-static BlobPropertyBag convertPropertyBag(const File::PropertyBag& initialBag)
-{
- BlobPropertyBag bag;
- bag.type = initialBag.type;
- return bag;
-}
-
File::File(ScriptExecutionContext& context, Vector<BlobPartVariant>&& blobPartVariants, const String& filename, const PropertyBag& propertyBag)
- : Blob(context, WTFMove(blobPartVariants), convertPropertyBag(propertyBag))
+ : Blob(context, WTFMove(blobPartVariants), propertyBag)
, m_name(filename)
, m_lastModifiedDateOverride(propertyBag.lastModified.valueOr(WallTime::now().secondsSinceEpoch().milliseconds()))
{
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes