-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SubresourceLoader should keep a ResourceResponse of the previous part…
… of multipart/x-mixed-replace https://bugs.webkit.org/show_bug.cgi?id=263423 Reviewed by Chris Dumez. multipart/x-mixed-replace resources don't load progressively because it keeps showing the previous part content while loading the next part. Thus, SubresourceLoader finishes loading the current part content when the next resource responce comes in. SubresourceLoader::didReceiveResponse does the trick. It synthetically calls CachedResource::finishLoading for the previous part content. However, when CachedResource::finishLoading is called with the previous part content, CachedResource::responseReceived is already called with the next part resource responce. So, for example, if a multipart/x-mixed-replace resource contains two parts, CachedResource methods were called in the following sequence: CachedResource::responseReceived with multipart/x-mixed-replace CachedResource::responseReceived with the first part response CachedResource::responseReceived with the second part response CachedResource::finishLoading with the first part content CachedResource::finishLoading with the second part content As the result, the last part doesn't show as expected. <https://webkit.org/b/36536> SubresourceLoader has to keep the previous ResourceResponse and synthetically call CachedResource::responseReceived with it just before synthetically calling CachedResource::finishLoading. Also, this fixes another problem that debug build of Windows port was failing an assertion for http/tests/multipart/invalid-image-data.html test. The Image object wasn't recreated for the second part. CachedImage::responseReceived clears the previous Image object. But, it wasn't called for the second part just before finishLoading of the second part. * LayoutTests/platform/wincairo/TestExpectations: * LayoutTests/platform/wincairo/http/tests/multipart/invalid-image-data-expected.txt: * Source/WebCore/loader/SubresourceLoader.cpp: * Source/WebCore/loader/SubresourceLoader.h: * LayoutTests/http/tests/multipart/images-expected.html: Added. * LayoutTests/http/tests/multipart/images.html: Added. * LayoutTests/platform/glib/TestExpectations: Canonical link: https://commits.webkit.org/270023@main
- Loading branch information
Showing
7 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<img src="resources/abe.png"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.waitUntilDone(); | ||
setTimeout(() => { testRunner.notifyDone() }, 1000); | ||
} | ||
</script> | ||
<img src="resources/multipart.py?interval=0&img1=green-100x100.png&img2=abe.png"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters