WebKit Bugzilla
Attachment 349800 Details for
Bug 189627
: XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189627-20180914225159.patch (text/plain), 5.43 KB, created by
Rob Buis
on 2018-09-14 13:51:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-09-14 13:51:59 PDT
Size:
5.43 KB
patch
obsolete
>Subversion Revision: 236009 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a59cd8c73f1f0a8f4334faf05a08ae68ab1f7341..7c51f8cc15c551363fc257211466626217de8c66 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-14 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response >+ https://bugs.webkit.org/show_bug.cgi?id=189627 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Right now we return an empty Blob without type when the response is empty, but >+ it should always include the type [1]. >+ >+ Test: web-platform-tests/xhr/overridemimetype-blob.html >+ >+ [1] https://xhr.spec.whatwg.org/#blob-response >+ >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::createResponseBlob): >+ > 2018-09-14 Devin Rousso <webkit@devinrousso.com> > > Web Inspector: Record actions performed on ImageBitmapRenderingContext >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index 8d8f83d04c55ad6b7286ef78bbf8b6449ad577e8..631ba78b74cc4a8bf3dfa9ba81de98317c4621f9 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -220,12 +220,10 @@ Ref<Blob> XMLHttpRequest::createResponseBlob() > ASSERT(responseType() == ResponseType::Blob); > ASSERT(doneWithoutErrors()); > >- if (!m_binaryResponseBuilder) >- return Blob::create(); >- > // FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient. > Vector<uint8_t> data; >- data.append(m_binaryResponseBuilder->data(), m_binaryResponseBuilder->size()); >+ if (m_binaryResponseBuilder) >+ data.append(m_binaryResponseBuilder->data(), m_binaryResponseBuilder->size()); > m_binaryResponseBuilder = nullptr; > String normalizedContentType = Blob::normalizedContentType(responseMIMEType()); // responseMIMEType defaults to text/xml which may be incorrect. > return Blob::create(WTFMove(data), normalizedContentType); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2babe41ea7bccaf66d782bbdae6e2769bf763159..a6ebc354481acb7b68cc886116b32aa0345000ef 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-09-14 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response >+ https://bugs.webkit.org/show_bug.cgi?id=189627 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/files/xhr-response-blob-expected.txt: >+ * fast/files/xhr-response-blob.html: >+ > 2018-09-14 Devin Rousso <webkit@devinrousso.com> > > Web Inspector: Record actions performed on ImageBitmapRenderingContext >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 8f13dc4b14bf4ca9805cbb1e2826e14a0c2178f7..4ba8e329071e685de53529018d15dfe67ac4c17c 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,12 @@ >+2018-09-14 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response >+ https://bugs.webkit.org/show_bug.cgi?id=189627 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/xhr/overridemimetype-blob-expected.txt: >+ > 2018-09-14 Ms2ger <Ms2ger@igalia.com> > > Remove some obsolete XHR tests >diff --git a/LayoutTests/fast/files/xhr-response-blob-expected.txt b/LayoutTests/fast/files/xhr-response-blob-expected.txt >index e698fafb3dd84accf931688e5c218a9ae5b43cc2..7a830172bfaf58981612895765279e87ceca7d2f 100644 >--- a/LayoutTests/fast/files/xhr-response-blob-expected.txt >+++ b/LayoutTests/fast/files/xhr-response-blob-expected.txt >@@ -16,5 +16,5 @@ PASS xhr.response is null > PASS xhr.responseType is "blob" > PASS xhr.response is null > PASS xhr.response instanceof Blob is true >-PASS xhr.response.type is "" >+PASS xhr.response.type is "application/octet-stream" > >diff --git a/LayoutTests/fast/files/xhr-response-blob.html b/LayoutTests/fast/files/xhr-response-blob.html >index 2a22cf093f6145b4e77757185f9f5b4b7c5ffb31..18b353989498c95b05eb590d3c05cab086c1aa3d 100644 >--- a/LayoutTests/fast/files/xhr-response-blob.html >+++ b/LayoutTests/fast/files/xhr-response-blob.html >@@ -34,7 +34,7 @@ function testBlob(blobURL, blobType, doneFunction) { > > testBlob("resources/UTF8.txt", "text/plain", function() { > testBlob("resources/does_not_exist.txt", "", function() { >- testBlob("resources/empty-file", "", function() { >+ testBlob("resources/empty-file", "application/octet-stream", function() { > if (window.testRunner) > testRunner.notifyDone(); > }) >diff --git a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >index 4be74486caadb42834dd4a073ad46e2d36cc54c9..97330b7e99d3cbee6cd31552cb2e2bacccaae13b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >@@ -1,5 +1,5 @@ > >-FAIL Use text/xml as fallback MIME type assert_equals: expected "text/xml" but got "" >+PASS Use text/xml as fallback MIME type > PASS Use text/xml as fallback MIME type, 2 > FAIL Loading data⦠promise_test: Unhandled rejection with value: object "TypeError: undefined is not a function (near '...tests.forEach...')" >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ap
:
review+
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189627
:
349791
| 349800