Title: [270269] trunk
Revision
270269
Author
[email protected]
Date
2020-11-30 15:15:10 -0800 (Mon, 30 Nov 2020)

Log Message

Allow blob URLs with fragments
https://bugs.webkit.org/show_bug.cgi?id=219361

Patch by Alex Christensen <[email protected]> on 2020-11-30
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt:
* web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt:
* web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt:
* web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt:

Source/WebCore:

When fetching blob content, we use the whole blob URL.
In order to match Chrome and Firefox, we need to remove the fragment if there is one.

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (270268 => 270269)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,3 +1,15 @@
+2020-11-30  Alex Christensen  <[email protected]>
+
+        Allow blob URLs with fragments
+        https://bugs.webkit.org/show_bug.cgi?id=219361
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt:
+        * web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt:
+        * web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt:
+        * web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt:
+
 2020-11-30  Youenn Fablet  <[email protected]>
 
         Update WPT WebRTC tests

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt (270268 => 270269)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in fetch
-FAIL fetch with a fragment should succeed promise_test: Unhandled rejection with value: object "TypeError: The operation couldn’t be completed. (WebKitBlobResource error 1.)"
+PASS fetch with a fragment should succeed
 PASS fetch of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using fetch
 PASS Appending a query string should cause fetch to fail

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt (270268 => 270269)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in fetch
-FAIL fetch with a fragment should succeed promise_test: Unhandled rejection with value: object "TypeError: The operation couldn’t be completed. (WebKitBlobResource error 1.)"
+PASS fetch with a fragment should succeed
 PASS fetch of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using fetch
 PASS Appending a query string should cause fetch to fail

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt (270268 => 270269)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in XHR
-FAIL XHR with a fragment should succeed promise_test: Unhandled rejection with value: "Got unexpected error event"
+PASS XHR with a fragment should succeed
 PASS XHR of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using XHR
 PASS Appending a query string should cause XHR to fail

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt (270268 => 270269)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-xhr.any.worker-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in XHR
-FAIL XHR with a fragment should succeed promise_test: Unhandled rejection with value: "Got unexpected error event"
+PASS XHR with a fragment should succeed
 PASS XHR of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using XHR
 PASS Appending a query string should cause XHR to fail

Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt (270268 => 270269)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in fetch
-FAIL fetch with a fragment should succeed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS fetch with a fragment should succeed
 PASS fetch of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using fetch
 PASS Appending a query string should cause fetch to fail

Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt (270268 => 270269)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,6 +1,6 @@
 
 PASS Blob URLs can be used in fetch
-FAIL fetch with a fragment should succeed promise_test: Unhandled rejection with value: object "TypeError: Type error"
+PASS fetch with a fragment should succeed
 PASS fetch of a revoked URL should fail
 PASS Only exact matches should revoke URLs, using fetch
 PASS Appending a query string should cause fetch to fail

Modified: trunk/Source/WebCore/ChangeLog (270268 => 270269)


--- trunk/Source/WebCore/ChangeLog	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/Source/WebCore/ChangeLog	2020-11-30 23:15:10 UTC (rev 270269)
@@ -1,3 +1,16 @@
+2020-11-30  Alex Christensen  <[email protected]>
+
+        Allow blob URLs with fragments
+        https://bugs.webkit.org/show_bug.cgi?id=219361
+
+        Reviewed by Darin Adler.
+
+        When fetching blob content, we use the whole blob URL.
+        In order to match Chrome and Firefox, we need to remove the fragment if there is one.
+
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::getBlobDataFromURL const):
+
 2020-11-30  James Darpinian  <[email protected]>
 
         Support KHR_parallel_shader_compile

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (270268 => 270269)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2020-11-30 23:05:05 UTC (rev 270268)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2020-11-30 23:15:10 UTC (rev 270269)
@@ -223,6 +223,8 @@
 BlobData* BlobRegistryImpl::getBlobDataFromURL(const URL& url) const
 {
     ASSERT(isMainThread());
+    if (url.hasFragmentIdentifier())
+        return m_blobs.get(url.stringWithoutFragmentIdentifier().toStringWithoutCopying());
     return m_blobs.get(url.string());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to