Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3a699a9eda3a9a5744da1dd4ea8ef862ad56b1e2
      
https://github.com/WebKit/WebKit/commit/3a699a9eda3a9a5744da1dd4ea8ef862ad56b1e2
  Author: Fujii Hironori <hironori.fu...@sony.com>
  Date:   2023-10-31 (Tue, 31 Oct 2023)

  Changed paths:
    A LayoutTests/http/tests/multipart/images-expected.html
    A LayoutTests/http/tests/multipart/images.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/wincairo/TestExpectations
    M 
LayoutTests/platform/wincairo/http/tests/multipart/invalid-image-data-expected.txt
    M Source/WebCore/loader/SubresourceLoader.cpp
    M Source/WebCore/loader/SubresourceLoader.h

  Log Message:
  -----------
  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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to