327f2eb588
*Please note:* I'm totally fine with this patch being rejected, and the issue closed as WONTFIX; however these changes should address the issue if that's desired. From a conceptual point of view, reporting loading progress doesn't really make a lot of sense for PDF files opened by passing raw binary data directly to `getDocument` (since obviously *all* data was loaded). This is compared to PDF files loaded via e.g. `XMLHttpRequest` or the Fetch API, where the entire PDF file isn't available from the start and knowing the loading progress makes total sense. However I can certainly see why the current API could be considered inconsistent, which isn't great, since a registered `onProgress` callback will never be called for certain `getDocument` calls. The simplest solution to this inconsistency thus seem to be to ensure that `onProgress` is always called when handling the `DataLoaded` message, since that will *always* be dispatched[1] from the worker-thread. --- [1] Note that this isn't guaranteed to happen, since setting `disableAutoFetch = true` often prevents the *entire* file from ever loading. However, this isn't relevant for the issue at hand, and is a well-known consequence of using `disableAutoFetch = true`; note how the default viewer even has a specialized code-path for hiding the loadingBar. |
||
---|---|---|
.. | ||
chromium | ||
features | ||
font | ||
pdfs | ||
resources | ||
stats | ||
ttx | ||
unit | ||
.eslintrc | ||
.gitignore | ||
add_test.js | ||
annotation_layer_builder_overrides.css | ||
downloadutils.js | ||
driver.js | ||
test_manifest.json | ||
test_slave.html | ||
test.js | ||
testutils.js | ||
text_layer_test.css | ||
webbrowser.js | ||
webserver.js |