Update PDF.js to new version e0b4f473cf6bc0aff8a35632c8ecec60776af543 from 2026-10-11 21:21:57
Categories
(Firefox :: PDF Viewer, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: update-bot, Assigned: calixte)
References
(Blocks 1 open bug)
Details
(Whiteboard: [3pl-filed][task_id: e-dtnJNYS-ShKx-iSYkknA])
Attachments
(1 external file)
This update covers 22 commits. Here are the overall diff statistics, and then the commit information.
toolkit/components/pdfjs/content/PdfJsVersion.sys.mjs | 2 +-
toolkit/components/pdfjs/content/build/pdf.mjs | 2508 ++++++------
toolkit/components/pdfjs/content/build/pdf.renderer.mjs | 866 +---
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 24 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 226 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 9 +-
toolkit/components/pdfjs/content/web/viewer.css | 5 +
toolkit/components/pdfjs/content/web/viewer.mjs | 58 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
9 files changed, 1672 insertions(+), 2030 deletions(-)
579c46b4331b36ab83417f07e2af3fe223e00efd by calixteman <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/579c46b4331b36ab83417f07e2af3fe223e00efd
Authored: 2026-10-11 21:16:23 +0200
Committed: 2026-10-11 21:54:13 +0200
Run OpenAction once on document open (PR #15822 follow-up)
PR #15822 added an OpenAction call in _initActions while retaining the
call in _dispatchDocEvent, causing it to run twice on document open.
Remove the initialization call so OpenAction runs once, after formatting.
Files Modified:
- src/scripting_api/doc.js
- test/unit/scripting_spec.js
3f745c0452e231ca49571ab96c92916fe2145b08 by calixteman <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/3f745c0452e231ca49571ab96c92916fe2145b08
Authored: 2026-10-11 21:15:52 +0200
Committed: 2026-10-11 21:45:33 +0200
Fix initial radio button selection (PR 12637 follow-up)
Compare export values with data.value because _value is still null during
construction. This fixes isBoxChecked and action selection when a later
widget is initially selected, plus the "Off" toggle in two-button groups.
Files Modified:
- src/scripting_api/field.js
- test/unit/scripting_spec.js
d069cfd7f5d88d689e4984018e2dec5608d11933 by calixteman <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/d069cfd7f5d88d689e4984018e2dec5608d11933
Authored: 2026-10-11 21:15:22 +0200
Committed: 2026-10-11 21:31:33 +0200
Fix choice-field currentValueIndices (PR 12826 follow-up)
Keep the first sorted index for single selection, sort numerically,
and use export values, matching the value setter.
Files Modified:
- src/scripting_api/field.js
- test/unit/scripting_spec.js
635454a37f33ef7157886c3ae02739f7443c4309 by calixteman <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/635454a37f33ef7157886c3ae02739f7443c4309
Authored: 2026-10-11 21:14:36 +0200
Committed: 2026-10-11 21:25:55 +0200
Fix repeated util.scand calls (PR 21681 follow-up)
Remove the cached regex's global flag so repeated calls with the same
format don't fall back to date guessing after a successful match.
Files Modified:
- src/scripting_api/util.js
- test/unit/scripting_spec.js
e4c2a6d18ccdca482c2538b26576209c5f257d6d by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/e4c2a6d18ccdca482c2538b26576209c5f257d6d
Authored: 2026-10-09 21:37:47 +0200
Committed: 2026-10-11 15:35:23 +0200
Cache operator lists in the renderer worker (PR 21860 follow-up)
Keep operator lists and their Path2D caches until page cleanup to avoid
resending operators and rebuilding paths on subsequent renders.
Limit each task to its requested list length during concurrent rendering.
Files Modified:
- src/display/api.js
- src/display/renderer_worker.js
- src/display/renderer_worker_proxy.js
- test/unit/api_spec.js
4d9d17e0f7754a2d3ba4ee94b7a89a968dbdf016 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/4d9d17e0f7754a2d3ba4ee94b7a89a968dbdf016
Authored: 2026-10-09 21:44:41 +0200
Committed: 2026-10-09 21:51:07 +0200
Keep scripting internals out of the global scope (issue 22121)
Files Modified:
- gulpfile.mjs
- test/unit/scripting_spec.js
5ad398d1aeadad6198759533c5198a7decdc58be by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/5ad398d1aeadad6198759533c5198a7decdc58be
Authored: 2026-10-09 21:00:19 +0200
Committed: 2026-10-09 21:10:54 +0200
Use the main-thread pixel ratio for worker image smoothing
Without devicePixelRatio, the renderer worker defaults to a ratio of 1.
Pass the main-thread ratio to match image smoothing on HiDPI displays.
Files Modified:
- src/display/canvas.js
- src/display/renderer_worker.js
- src/display/renderer_worker_proxy.js
- test/unit/api_spec.js
584a48e898588c79c54493fda1c39466568ca232 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/584a48e898588c79c54493fda1c39466568ca232
Authored: 2026-10-09 19:39:01 +0200
Committed: 2026-10-09 20:15:06 +0200
Update the thumbnail status label and controls together (bug 2080269)
Format the status label before updating it with the deselect button
and "new" badge. Ignore stale translation results.
Files Modified:
- test/integration/reorganize_pages_spec.mjs
- web/app.js
- web/pdf_thumbnail_viewer.js
6baeb63bdcf11daa7a3ce9c60a4e86b905cb2105 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/6baeb63bdcf11daa7a3ce9c60a4e86b905cb2105
Authored: 2026-10-08 17:52:11 +0200
Committed: 2026-10-09 17:01:33 +0200
Cache decoded page images in the worker in Firefox (PR 22105 follow-up)
In Firefox, retain decoded page images as VideoFrames in the parsing
worker and reuse them when they enter the global image cache. Release
retained frames on page or document cleanup.
Other browsers keep the CopyLocalImage round trip. Send the main-thread
copy directly to the renderer worker instead of requesting another copy.
Test that a paused page can still draw a shared image twice after another
page reuses it.
Files Modified:
- src/core/evaluator.js
- src/core/image_utils.js
- src/core/primitives.js
- src/core/worker.js
- src/display/api.js
- src/display/object_handler.js
- src/display/renderer_worker_proxy.js
- src/shared/util.js
- test/unit/api_spec.js
- test/unit/image_utils_spec.js
- test/unit/primitives_spec.js
3ec7a20d646c20071482a1215c73c2fbfda70e25 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/3ec7a20d646c20071482a1215c73c2fbfda70e25
Authored: 2026-10-09 12:57:46 +0200
Committed: 2026-10-09 16:53:48 +0200
Add a method in BaseCanvasFactory for getting a no-alpha canvas context
In the API code we currently pass around the enableHWA option to a bunch of different classes, just so that the InternalRenderTask.prototype.initializeGraphics method can access it when getting a canvas context.
To avoid that this patch suggests that we instead add a new method in BaseCanvasFactory, that takes a canvas and returns a suitable context, since such an instance must be available there anyway.
As a bonus the same method can be re-used in the renderer-worker, since the "InitializeGraphics" handler in RendererMessageHandler needs the same kind of canvas context.
Files Modified:
- src/display/api.js
- src/display/canvas_factory.js
- src/display/renderer_worker.js
89b3bee99581ed4e7551d53ccdaf9e758ba93d6c by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/89b3bee99581ed4e7551d53ccdaf9e758ba93d6c
Authored: 2026-10-09 15:44:23 +0200
Committed: 2026-10-09 16:34:58 +0200
Fit the Nova zoom select in the compact toolbar (bug 2075731)
In compact density the toolbar shrinks to 32px but the select kept its 32px
min-height, so its border overflowed and was clipped. Use the small button
size there, like the 24px toolbar buttons.
Files Modified:
- external/stylelint/mozcentral-tokens.css
- web/viewer.css
c6d9c1463090d2aff08760416ee1f5ead0f40a37 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/c6d9c1463090d2aff08760416ee1f5ead0f40a37
Authored: 2026-10-09 15:13:37 +0200
Committed: 2026-10-09 15:21:58 +0200
Initialize the WebGPU as soon as possible in RendererMessageHandler
After a previous patch we now send the enableWebGPU option with the "configure" message, which means that we can start WebGPU initialization sooner.
This way we reduce the delay before rendering of the first page starts, and in the development viewer the difference is very significant. Quick console.time/timeEnd measurements show WebGPU initialization delaying first page rendering around 250-300 ms on master, whereas with this patch that drops to only 15-25 ms.
Files Modified:
- src/display/renderer_worker.js
d7e2cfa020820c644b163a86ee50d061e4f7f42d by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/d7e2cfa020820c644b163a86ee50d061e4f7f42d
Authored: 2026-10-09 14:56:25 +0200
Committed: 2026-10-09 14:56:25 +0200
Destroy the renderer-worker WorkerFilterFactory instance on cleanup
Currently this won't matter, since the WorkerFilterFactory is just a "dummy" implementation.
Files Modified:
- src/display/renderer_worker.js
23859120306dbfc023ea56e4ca1d0c4b3a16887d by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/23859120306dbfc023ea56e4ca1d0c4b3a16887d
Authored: 2026-10-09 08:42:21 +0200
Committed: 2026-10-09 12:01:29 +0200
Parse structure trees without a ParentTree
Cache structure elements by page and identify annotations from /Annots.
Files Added:
- test/pdfs/structure_no_parent_tree.pdf
Files Modified:
- src/core/struct_tree.js
- test/pdfs/.gitignore
- test/unit/struct_tree_spec.js
cfa57b7c742a8b6f1ebc2dea813c6f2ffb8b103f by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/cfa57b7c742a8b6f1ebc2dea813c6f2ffb8b103f
Authored: 2026-10-09 11:13:51 +0200
Committed: 2026-10-09 11:20:25 +0200
Send the enableHWA and enableWebGPU options just once to the RendererMessageHandler (PR 21860 follow-up)
Currently these options are sent for every render-operation, which seems completely superfluous when they are set just once for each document.
Instead we include these options in the "configure" message, since that's the first thing that RendererWorker sends.
Given that the RendererWorker can only, currently, be used for a single document there shouldn't be any problem sending these options one time.
Files Modified:
- src/display/renderer_worker.js
- src/display/renderer_worker_proxy.js
fb326c42a71653ab1da9a1a75b66735446c93bbd by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/fb326c42a71653ab1da9a1a75b66735446c93bbd
Authored: 2026-10-09 10:53:21 +0200
Committed: 2026-10-09 10:53:21 +0200
Create canvasFactory and filterFactory just once in the RendererMessageHandler (PR 21860 follow-up)
In the main-thread we use just a single canvasFactory respectively filterFactory per document, but for some reason the RendererMessageHandler creates a new one for every render-operation.
For long PDF documents, or at higher zoom-levels where "detail" canvases are used, this can lead to a lot of pointless duplicate object creation.
Given that the RendererWorker can only, currently, be used for a single document there shouldn't be any problem caching and re-using these factories.
Files Modified:
- src/display/renderer_worker.js
a50766dee299835ae37f325c736f3a5dc65e6037 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/a50766dee299835ae37f325c736f3a5dc65e6037
Authored: 2026-10-09 00:07:10 +0200
Committed: 2026-10-09 09:06:07 +0200
Add unit-tests for the StatTimer.prototype.toString method
This method is used by the "old" debugger, however it's not actually tested.
Files Modified:
- test/unit/api_spec.js
2f0b29b0e056c437e377aaeeff42393d858fbf69 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/2f0b29b0e056c437e377aaeeff42393d858fbf69
Authored: 2026-10-08 22:01:32 +0200
Committed: 2026-10-08 22:01:32 +0200
Always check if crypto.randomUUID is available in the getUuid helper (issue 22107)
Don't skip this check in MOZCENTRAL builds, to prevent issues in non-"secure contexts" (i.e. HTTP).
Files Modified:
- src/shared/util.js
a4411d2c945fcbb6aba02740f75729d094d4ff3a by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/a4411d2c945fcbb6aba02740f75729d094d4ff3a
Authored: 2026-10-07 13:05:47 +0200
Committed: 2026-10-08 21:54:34 +0200
Split the src/display/display_utils.js file into multiple ones (PR 21860 follow-up)
The built pdf.renderer.mjs file currently contains a lot of dead code, since it pulls in the entire src/display/display_utils.js file as-is and that one contains many functions that only make sense in the main-thread.
Hence we make the following changes:
- Move a couple of helpers into the existing
src/display/api_utils.jsfile. - Move all functions that access the DOM, or ones that are only invoked in the main-thread, into a new
src/display/dom_utils.jsfile. - Keep functions that make sense in both the main- and worker-threads in the existing
src/display/display_utils.jsfile.
Note: This reduces the size of the gulp mozcentral bundle by 20787 bytes, i.e. over 20 kilo-bytes, which is way too much to ignore.
Files Added:
- src/display/dom_utils.js
- test/unit/dom_utils_spec.js
Files Modified:
- src/display/annotation_layer.js
- src/display/api.js
- src/display/api_utils.js
- src/display/binary_data_factory.js
- src/display/display_utils.js
- src/display/dom_filter_factory.js
- src/display/editor/alt_text.js
- src/display/editor/annotation_editor_layer.js
- src/display/editor/color_picker.js
- src/display/editor/comment.js
- src/display/editor/draw.js
- src/display/editor/editor.js
- src/display/editor/highlight.js
- src/display/editor/stamp.js
- src/display/editor/toolbar.js
- src/display/editor/tools.js
- src/display/network_stream.js
- src/display/network_utils.js
- src/display/text_layer.js
- src/display/touch_manager.js
- src/display/transport_stream.js
- src/pdf.js
- test/unit/api_spec.js
- test/unit/bidi_spec.js
- test/unit/clitests.json
- test/unit/display_utils_spec.js
- test/unit/jasmine-boot.js
- test/unit/pdf_spec.js
- test/unit/test_utils.js
5e7bdbf9fe22ff5f7dd1d72b552670d65e4bced4 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/5e7bdbf9fe22ff5f7dd1d72b552670d65e4bced4
Authored: 2026-10-07 17:54:43 +0200
Committed: 2026-10-08 16:28:27 +0200
Move renderer worker support out of api.js (PR 21860 follow-up)
Extract RendererWorker and WorkerRenderTask into renderer_worker_proxy.js.
Share worker URL wrapping and canvas tracker creation.
Forward only page objects stored on the main thread, removing the renderer's
cleaned-page tracking and restorePage message.
Create the annotation canvases with the canvas factory, as main-thread
rendering does, so they're no longer dropped when rendering into an
OffscreenCanvas.
Files Added:
- src/display/renderer_worker_proxy.js
Files Modified:
- src/display/api.js
- src/display/api_utils.js
- src/display/canvas_dependency_tracker.js
- src/display/object_handler.js
- src/display/renderer_worker.js
- test/unit/api_spec.js
- test/unit/jasmine-boot.js
- web/app.js
e3b563d24856d236292a2381541230b0e47713f6 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/e3b563d24856d236292a2381541230b0e47713f6
Authored: 2026-10-07 17:52:58 +0200
Committed: 2026-10-07 17:59:30 +0200
Reduce duplication in the type1FontGlyphMapping function
Currently the same exact code is duplicated three times, which seems completely unnecessary, however that can be avoided with the introduction of a new helper function.
Files Modified:
- src/core/fonts_utils.js
e06a8ba5474fa304d12197367db2c4b8dd741b8e by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/e06a8ba5474fa304d12197367db2c4b8dd741b8e
Authored: 2026-10-06 21:06:25 +0200
Committed: 2026-10-06 21:44:19 +0200
Test main-thread and worker rendering paths
Add main-thread variants for transfer functions, soft masks, knockout
groups, and partial rendering via a disableWorkerRendering manifest
option. Run the transfer-function unit test with worker rendering enabled
and disabled.
Use canvas for the optimized partial-render pass so it can run in the
renderer worker, matching the full-render pass.
Files Modified:
- test/driver.js
- test/test_manifest.json
- test/unit/api_spec.js
| Reporter | ||
Comment 2•1 month ago
|
||
| e-dtnJNYS-ShKx-iSYkknA | ||
I've submitted a try run for this commit: https://treeherder.mozilla.org/jobs?repo=try&revision=c44995523be9aa5fe3f33e877a2ce43bb75abb2f
| Reporter | ||
Comment 3•1 month ago
|
||
Updated•1 month ago
|
| Reporter | ||
Comment 4•1 month ago
|
||
| JvtnRVyaSUqTuFojKTkg4Q | ||
All the jobs in the try run succeeded. Like literally all of them, there weren't
even any intermittents. That is pretty surprising to me, so maybe you should double
check to make sure I didn't misinterpret things and that the correct tests ran...
Anyway, I've done all I can, so I'm passing to you to review and land the patch.
When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.
Updated•1 month ago
|
Comment 6•1 month ago
|
||
| bugherder | ||
Updated•25 days ago
|
Description
•