[webkit-changes] [WebKit/WebKit] 44ecdd: Fix http/tests/pdf/linearized-pdf-in-iframe to act...
Simon Fraser
noreply at github.com
Fri Feb 9 22:17:43 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 44ecdd4e8ee1c31d2e2c85cd5665c965199a8857
https://github.com/WebKit/WebKit/commit/44ecdd4e8ee1c31d2e2c85cd5665c965199a8857
Author: Simon Fraser <simon.fraser at apple.com>
Date: 2024-02-09 (Fri, 09 Feb 2024)
Changed paths:
M LayoutTests/http/tests/pdf/linearized-pdf-in-iframe-expected.html
M LayoutTests/http/tests/pdf/linearized-pdf-in-iframe.html
M LayoutTests/http/tests/resources/network-simulator.py
M Source/WebKit/WebProcess/Plugins/PDF/PDFIncrementalLoader.mm
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm
Log Message:
-----------
Fix http/tests/pdf/linearized-pdf-in-iframe to actually test incremental PDF loading
https://bugs.webkit.org/show_bug.cgi?id=269102
rdar://122672100
Reviewed by Tim Horton.
Triggering the incremental PDF loading code path requires a fairly exact set of conditions
that need to be satisfied by the HTTP server:
1. Support for byte-range requests
2. Multithreading (handle a byte-range request while the main request is also being served)
3. Slow enough that a couple of initial byte-range requests complete before the main resource request
This PR enhances network-simulator.py to support byte-range requests, and tweaks the laoding speed
in the test.
With UnifiedPDF enabled, we hit a couple of `ASSERT(documentFinishedLoading())` in the data
provider callbacks on the main thread, under a painting callstack. This happens because UnifiedPDF
currently paints on the main thread, so relax those assertions (with some logging).
* LayoutTests/http/tests/pdf/linearized-pdf-in-iframe-expected.html:
* LayoutTests/http/tests/pdf/linearized-pdf-in-iframe.html:
* LayoutTests/http/tests/resources/network-simulator.py:
(generate_response):
(file_to_stdout):
(range_of_file_to_stdout):
(chunked_file_to_stdout):
(parse_byte_range):
(temp_path_base):
* Source/WebKit/WebProcess/Plugins/PDF/PDFIncrementalLoader.mm:
(WebKit::PDFPluginStreamLoaderClient::didReceiveResponse):
(WebKit::PDFIncrementalLoader::dataProviderGetBytesAtPosition):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::copyDataAtPosition const):
(WebKit::PDFPluginBase::streamDidReceiveData):
(WebKit::PDFPluginBase::streamDidFinishLoading):
Canonical link: https://commits.webkit.org/274412@main
More information about the webkit-changes
mailing list