Title: [276677] trunk
Revision
276677
Author
[email protected]
Date
2021-04-27 16:01:41 -0700 (Tue, 27 Apr 2021)

Log Message

charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
https://bugs.webkit.org/show_bug.cgi?id=225057

Patch by Alex Christensen <[email protected]> on 2021-04-27
Reviewed by Chris Dumez.

Source/WebCore:

When calling Blob.slice, use the content type from the call, not from the sliced-from blob.
This matches Chrome and Firefox.

When no content type is given, browsers disagree on what happens, so keep existing behavior in that case.

Test: fast/files/blob-content-type.html

* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
* fileapi/ThreadableBlobRegistry.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURLForSlice):
* platform/network/BlobRegistryImpl.h:

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
* WebProcess/FileAPI/BlobRegistryProxy.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.mm:

Source/WebKitLegacy/win:

* WebCoreSupport/WebPlatformStrategies.cpp:

LayoutTests:

* fast/files/blob-content-type-expected.txt: Added.
* fast/files/blob-content-type.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (276676 => 276677)


--- trunk/LayoutTests/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/LayoutTests/ChangeLog	2021-04-27 23:01:41 UTC (rev 276677)
@@ -1,3 +1,13 @@
+2021-04-27  Alex Christensen  <[email protected]>
+
+        charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
+        https://bugs.webkit.org/show_bug.cgi?id=225057
+
+        Reviewed by Chris Dumez.
+
+        * fast/files/blob-content-type-expected.txt: Added.
+        * fast/files/blob-content-type.html: Added.
+
 2021-04-27  Aditya Keerthi  <[email protected]>
 
         REGRESSION (r273154): fast/forms/ios/scroll-to-reveal-focused-select.html is timing out

Added: trunk/LayoutTests/fast/files/blob-content-type-expected.txt (0 => 276677)


--- trunk/LayoutTests/fast/files/blob-content-type-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/files/blob-content-type-expected.txt	2021-04-27 23:01:41 UTC (rev 276677)
@@ -0,0 +1,5 @@
+
+PASS blob.slice content type used
+PASS sliced-from content type used when none specified in blob.slice
+PASS sliced-from content type used when empty string content type specified in blob.slice
+

Added: trunk/LayoutTests/fast/files/blob-content-type.html (0 => 276677)


--- trunk/LayoutTests/fast/files/blob-content-type.html	                        (rev 0)
+++ trunk/LayoutTests/fast/files/blob-content-type.html	2021-04-27 23:01:41 UTC (rev 276677)
@@ -0,0 +1,28 @@
+<script src=""
+<script src=""
+<script>
+
+    const blob = new Blob(['<style></style>'], { type: 'text/original-blob-content-type;' });
+
+    promise_test(async () => {
+        const slice = blob.slice(0, blob.size, 'text/html2;charset=utf-8');
+        const url = ""
+        const response = await fetch(url);
+        assert_equals(response.headers.get('content-type'), 'text/html2;charset=utf-8')
+    }, 'blob.slice content type used')
+
+    promise_test(async () => {
+        const slice = blob.slice(0, blob.size);
+        const url = ""
+        const response = await fetch(url);
+        assert_equals(response.headers.get('content-type'), 'text/original-blob-content-type;')
+    }, 'sliced-from content type used when none specified in blob.slice')
+
+    promise_test(async () => {
+        const slice = blob.slice(0, blob.size, "");
+        const url = ""
+        const response = await fetch(url);
+        assert_equals(response.headers.get('content-type'), 'text/original-blob-content-type;')
+    }, 'sliced-from content type used when empty string content type specified in blob.slice')
+
+</script>

Modified: trunk/Source/WebCore/ChangeLog (276676 => 276677)


--- trunk/Source/WebCore/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/ChangeLog	2021-04-27 23:01:41 UTC (rev 276677)
@@ -1,3 +1,27 @@
+2021-04-27  Alex Christensen  <[email protected]>
+
+        charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
+        https://bugs.webkit.org/show_bug.cgi?id=225057
+
+        Reviewed by Chris Dumez.
+
+        When calling Blob.slice, use the content type from the call, not from the sliced-from blob.
+        This matches Chrome and Firefox.
+
+        When no content type is given, browsers disagree on what happens, so keep existing behavior in that case.
+
+        Test: fast/files/blob-content-type.html
+
+        * fileapi/Blob.cpp:
+        (WebCore::Blob::Blob):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
+        * fileapi/ThreadableBlobRegistry.h:
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
+        * platform/network/BlobRegistryImpl.h:
+
 2021-04-27  Alexey Shvayka  <[email protected]>
 
         [JSC] Remove defaultValue() from the method table

Modified: trunk/Source/WebCore/fileapi/Blob.cpp (276676 => 276677)


--- trunk/Source/WebCore/fileapi/Blob.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/fileapi/Blob.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -160,7 +160,7 @@
     // m_size is not necessarily equal to end - start so we do not initialize it here.
 {
     m_internalURL = BlobURL::createInternalURL();
-    ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end);
+    ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end, m_type);
 }
 
 Blob::~Blob()

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (276676 => 276677)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -126,15 +126,15 @@
     });
 }
 
-void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end)
+void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end, const String& contentType)
 {
     if (isMainThread()) {
-        blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end);
+        blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end, contentType);
         return;
     }
 
-    callOnMainThread([newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end] {
-        blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end);
+    callOnMainThread([newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end, contentType = contentType.isolatedCopy()] {
+        blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end, contentType);
     });
 }
 

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (276676 => 276677)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h	2021-04-27 23:01:41 UTC (rev 276677)
@@ -44,7 +44,7 @@
     static void registerBlobURL(const URL&, Vector<BlobPart>&& blobParts, const String& contentType);
     static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
     static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end);
+    static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end, const String& contentType);
     static void unregisterBlobURL(const URL&);
 
     static unsigned long long blobSize(const URL&);

Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (276676 => 276677)


--- trunk/Source/WebCore/platform/network/BlobRegistry.h	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h	2021-04-27 23:01:41 UTC (rev 276677)
@@ -59,7 +59,7 @@
     virtual void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
 
     // Negative start and end values select from the end.
-    virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) = 0;
+    virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) = 0;
 
     virtual void unregisterBlobURL(const URL&) = 0;
 

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (276676 => 276677)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -178,7 +178,7 @@
     m_blobs.set(url.string(), WTFMove(backingFile));
 }
 
-void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
+void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType)
 {
     ASSERT(isMainThread());
     BlobData* originalData = getBlobDataFromURL(srcURL);
@@ -207,7 +207,7 @@
         end = originalSize;
 
     unsigned long long newLength = end - start;
-    auto newData = BlobData::create(originalData->contentType());
+    auto newData = BlobData::create(contentType.isEmpty() ? originalData->contentType() : contentType);
 
     appendStorageItems(newData.ptr(), originalData->items(), start, newLength);
 

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (276676 => 276677)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2021-04-27 23:01:41 UTC (rev 276677)
@@ -62,7 +62,7 @@
     void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType);
     void registerBlobURL(const URL&, const URL& srcURL);
     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType);
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end);
+    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType);
     void unregisterBlobURL(const URL&);
 
     unsigned long long blobSize(const URL&);

Modified: trunk/Source/WebKit/ChangeLog (276676 => 276677)


--- trunk/Source/WebKit/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/ChangeLog	2021-04-27 23:01:41 UTC (rev 276677)
@@ -1,3 +1,20 @@
+2021-04-27  Alex Christensen  <[email protected]>
+
+        charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
+        https://bugs.webkit.org/show_bug.cgi?id=225057
+
+        Reviewed by Chris Dumez.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
+        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
 2021-04-27  Fujii Hironori  <[email protected]>
 
         HashTableConstIterator's consistency assertion fails while closing m_webIDBServers in NetworkProcess::didClose since r275846

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (276676 => 276677)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -838,13 +838,13 @@
     session->blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath), contentType);
 }
 
-void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)
+void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end, const String& contentType)
 {
     auto* session = networkSession();
     if (!session)
         return;
 
-    session->blobRegistry().registerBlobURLForSlice(url, srcURL, start, end);
+    session->blobRegistry().registerBlobURLForSlice(url, srcURL, start, end, contentType);
 }
 
 void NetworkConnectionToWebProcess::unregisterBlobURL(const URL& url)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (276676 => 276677)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2021-04-27 23:01:41 UTC (rev 276677)
@@ -233,7 +233,7 @@
     void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
     void registerBlobURLFromURL(const URL&, const URL& srcURL);
     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end);
+    void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end, const String& contentType);
     void blobSize(const URL&, CompletionHandler<void(uint64_t)>&&);
     void unregisterBlobURL(const URL&);
     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (276676 => 276677)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2021-04-27 23:01:41 UTC (rev 276677)
@@ -52,7 +52,7 @@
     RegisterBlobURL(URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
     RegisterBlobURLFromURL(URL url, URL srcURL)
     RegisterBlobURLOptionallyFileBacked(URL url, URL srcURL, String fileBackedPath, String contentType)
-    RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end)
+    RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end, String contentType)
     UnregisterBlobURL(URL url)
     BlobSize(URL url) -> (uint64_t resultSize) Synchronous
     WriteBlobsToTemporaryFiles(Vector<String> blobURLs) -> (Vector<String> fileNames) Async

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp (276676 => 276677)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -61,7 +61,7 @@
         void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
         void registerBlobURL(const URL&, const URL& srcURL) final { ASSERT_NOT_REACHED(); }
         void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
-        void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) final { ASSERT_NOT_REACHED(); }
+        void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final { ASSERT_NOT_REACHED(); }
         void unregisterBlobURL(const URL&) final { ASSERT_NOT_REACHED(); }
         unsigned long long blobSize(const URL&) final { ASSERT_NOT_REACHED(); return 0; }
         void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final { ASSERT_NOT_REACHED(); }

Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (276676 => 276677)


--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -69,9 +69,9 @@
     WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
 }
 
-void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
+void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType)
 {
-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end, contentType), 0);
 }
 
 unsigned long long BlobRegistryProxy::blobSize(const URL& url)

Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h (276676 => 276677)


--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h	2021-04-27 23:01:41 UTC (rev 276677)
@@ -36,7 +36,7 @@
     void registerBlobURL(const URL&, const URL& srcURL) final;
     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) final;
     void unregisterBlobURL(const URL&) final;
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) final;
+    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final;
     unsigned long long blobSize(const URL&) final;
     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final;
 };

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (276676 => 276677)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2021-04-27 23:01:41 UTC (rev 276677)
@@ -1,5 +1,14 @@
 2021-04-27  Alex Christensen  <[email protected]>
 
+        charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
+        https://bugs.webkit.org/show_bug.cgi?id=225057
+
+        Reviewed by Chris Dumez.
+
+        * WebCoreSupport/WebPlatformStrategies.mm:
+
+2021-04-27  Alex Christensen  <[email protected]>
+
         Unreviewed, reverting r275912.
         rdar://77179042
 

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm (276676 => 276677)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm	2021-04-27 23:01:41 UTC (rev 276677)
@@ -87,7 +87,7 @@
     void registerBlobURL(const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
     void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
     void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
-    void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
+    void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); }
     void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
     unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (276676 => 276677)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2021-04-27 23:01:41 UTC (rev 276677)
@@ -1,3 +1,12 @@
+2021-04-27  Alex Christensen  <[email protected]>
+
+        charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost
+        https://bugs.webkit.org/show_bug.cgi?id=225057
+
+        Reviewed by Chris Dumez.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+
 2021-04-22  Chris Dumez  <[email protected]>
 
         Disable prefixed WebAudio on WebKitLegacy-Windows

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp (276676 => 276677)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp	2021-04-27 22:52:55 UTC (rev 276676)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp	2021-04-27 23:01:41 UTC (rev 276677)
@@ -84,7 +84,7 @@
     void registerBlobURL(const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
     void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
     void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
-    void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
+    void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); }
     void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
     unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to