22030 Commits

Author SHA1 Message Date
Calixte Denizet
2ac42392f0 Wait a little between each key press in the test 'must check that the comment sidebar is resizable with the keyboard' 2026-03-15 21:55:38 +01:00
Tim van der Meij
1192e5e921
Merge pull request #20884 from calixteman/fix_extract_text
Fix the issue in the ref test tracemonkey-extract_0_2_12
2026-03-15 20:41:00 +01:00
Tim van der Meij
c2acab55d9
Merge pull request #20765 from calixteman/update_eslint
Update eslint to version 10
2026-03-15 20:26:09 +01:00
Tim van der Meij
1b88960ead
Merge pull request #20883 from Snuffleupagus/PatternInfo-pointBoundingBox
Use the `Util.pointBoundingBox` helper in the `PatternInfo` class (PR 20340 follow-up)
2026-03-15 19:46:58 +01:00
Tim van der Meij
665a631bdc
Merge pull request #20879 from Snuffleupagus/increase-MAX_SCALE
Increase the maximum viewer scale to 2500 percent
2026-03-15 19:46:36 +01:00
Tim van der Meij
6ca9389d25
Merge pull request #20878 from timvandermeij/exit-code
Use a non-zero exit code if the tests failed
2026-03-15 19:44:18 +01:00
calixteman
d5ac981d62
Update eslint to version 10
Unfortunately, eslint-plugin-import depends on eslint 9. This plugin doesn't seem to be
actively maintained (lot of open issues and PRs).
Fortunately there's a fork of the plugin that doesn't support eslint 10 yet but is actively maintained.
So this PR changes the eslint version to 10 and replaces eslint-plugin-import with eslint-plugin-import-x.
2026-03-15 19:36:54 +01:00
Calixte Denizet
dde0beafc6
Fix the issue in the ref test tracemonkey-extract_0_2_12
When getting the extracted document, the url for the wasms wasn't passed
and consequently the icc-based color wasn't rendered as expected because of the wasm for qcms.
2026-03-15 19:26:24 +01:00
Tim van der Meij
f49877ae95
Merge pull request #20877 from timvandermeij/updates
Update dependencies to the most recent versions
2026-03-15 19:07:04 +01:00
Jonas Jenwald
d0ee35470b Use the Util.pointBoundingBox helper in the PatternInfo class (PR 20340 follow-up)
Rather than computing the `bounds` manually, as done in PR 20340, we can shorten/simplify the code by using an existing helper instead.
2026-03-15 18:26:15 +01:00
Jonas Jenwald
e05df11e98 Increase the maximum viewer scale to 2500 percent
After PR 19128 huge zoom levels should no longer be an issue, so let's increase the maximum viewer scale a bit.
2026-03-15 15:45:34 +01:00
Tim van der Meij
c798f88bdb
Use a non-zero exit code if the tests failed
The bots currently detect if the tests failed or not by checking the
output text, but this is error-prone as it would break if the text gets
changed (which is rather unexpected) and it's non-standard as usually
processes report success/failure via their exit code.

This commit makes sure that the test process fails with a non-zero exit
code if the tests failed, and a zero exit code otherwise. Note that we
keep the same output text as before, so this change should not impact
the bots, but it does form another step to unlock usage in GitHub
Actions (which uses the exit code of commands to determine the status of
the workflow run).
2026-03-15 15:13:56 +01:00
Tim van der Meij
534a199d18
Fix vulnerability in the flatted dependency
This patch is generated with `npm audit fix` and fixes CVE-2026-32141.
2026-03-15 14:54:11 +01:00
Tim van der Meij
b7ebd80db8
Update dependencies to the most recent versions 2026-03-15 14:53:11 +01:00
Tim van der Meij
3127492a38
Merge pull request #20875 from Snuffleupagus/version-5.6
Bump library version to `5.6`
2026-03-15 14:36:01 +01:00
calixteman
a3a205d69b
Merge pull request #20871 from calixteman/refactor_debugger
Split the new debugger into multiple files
2026-03-15 14:29:13 +01:00
Jonas Jenwald
f54c0b1619 Bump library version to 5.6 2026-03-15 14:03:10 +01:00
calixteman
7bac644731
Split the new debugger into multiple files
Instead of having all the code for the new debugger in a single file,
split it into multiple files.
This makes it easier to navigate and maintain the codebase.
It'll be make hacking and fixing bugs in the debugger easier.
2026-03-15 13:21:26 +01:00
Tim van der Meij
315491dd32
Merge pull request #20840 from Snuffleupagus/getDocument-rm-length
[api-minor] Remove the `length` parameter from `getDocument`
2026-03-15 11:48:02 +01:00
Tim van der Meij
b5c55002ef
Merge pull request #20870 from mozilla/dependabot/npm_and_yarn/undici-7.24.2
Bump undici from 7.21.0 to 7.24.2
2026-03-15 11:44:42 +01:00
calixteman
8f7a615455
Merge pull request #20860 from calixteman/radial_gradients
Fix the rendering of the radial gradient when a center is outside of the other circle and there's no extend
2026-03-14 16:07:39 +01:00
dependabot[bot]
85fe14ac94
Bump undici from 7.21.0 to 7.24.2
Bumps [undici](https://github.com/nodejs/undici) from 7.21.0 to 7.24.2.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.21.0...v7.24.2)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.24.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 10:34:32 +00:00
Jonas Jenwald
09a9a7bd0b [api-minor] Remove the length parameter from getDocument
This is an old API-parameter that is now unused within the PDF.js project itself, and its description says that it's (partly) being used for "range requests operations".
Note that the `length` API-parameter is used to set the *initial* `contentLength` in various `BasePDFStreamReader` implementations, however it's always overridden by the "Content-Length" header (sent by the server) when that one exists *and* is a valid number. While we currently fallback to the keep the initial `contentLength` otherwise, note however how in that case range requests will always be *disabled* and thus the only spot in the code-base [where `fullReader.contentLength` is necessary](873378b718/src/core/worker.js (L230-L236)) cannot actually be reached.

Hence the only possible reason to use the `length` API-parameter would be for improved progress reporting[1] during streaming of PDF data in rare cases where the "Content-Length" header is missing/invalid, but the user *somehow* has information from another source about the correct `length` of the PDF document.
That situation feels very much like an edge-case, but it's obviously impossible to know if someone is depending on it. However, please note that there's a work-around available for users affected by this removal:
 - Implement a `PDFDataRangeTransport` instance together with custom data-fetching[2], since in that case its `length`-parameter will always be used as-is.

Finally, updates various `BasePDFStreamReader` implementations to only set the `_isRangeSupported` field once the headers are available (since previously we'd just overwrite the "initial" value anyway).

---

[1] I.e. to avoid the "indeterminate" loadingBar being displayed in the viewer.

[2] This is what e.g. the Firefox PDF Viewer uses.
2026-03-13 23:42:45 +01:00
Tim van der Meij
820b70eb25
Merge pull request #20858 from calixteman/move_save_as_to_export_selected
Move 'Save as...' menu to 'Export selected...'
2026-03-13 22:04:12 +01:00
Tim van der Meij
94b7f8f998
Merge pull request #20863 from calixteman/fix_intermittent_undo_bar
Only focus the undo bar when the focus isn't inside
2026-03-13 22:03:45 +01:00
Tim van der Meij
23926ee948
Merge pull request #20861 from Snuffleupagus/split-obj-bin-transform
Split the `src/shared/obj-bin-transform.js` file into separate files for the main/worker threads (PR 20197 follow-up)
2026-03-13 21:07:50 +01:00
Tim van der Meij
f4c6fff759
Merge pull request #20865 from Snuffleupagus/internal-viewer-urls
Bundle the necessary files and set the correct `cMapUrl`, `iccUrl`, and `standardFontDataUrl` when building `gulp internal-viewer`
2026-03-13 21:02:30 +01:00
Jonas Jenwald
75739a173b Bundle the necessary files and set the correct cMapUrl, iccUrl, and standardFontDataUrl when building gulp internal-viewer
Without these changes none of the relevant functionality would work in the *built* internal-viewer.
2026-03-13 18:16:10 +01:00
calixteman
1d25607b9c
Move 'Save as...' menu to 'Export selected...' 2026-03-13 17:29:12 +01:00
calixteman
a7083d08ff
Merge pull request #20854 from calixteman/bug2022769
Add a button for unchecking all the checked thumbnails (bug 2022769)
2026-03-13 15:58:24 +01:00
Calixte Denizet
df4a5638d0
Add a button for unchecking all the checked thumbnails (bug 2022769) 2026-03-13 14:18:51 +01:00
calixteman
fbfccebb81
Merge pull request #20850 from calixteman/bug2021828
Don't let the user delete/cut all the pages (bug 2021828)
2026-03-13 14:06:01 +01:00
Calixte Denizet
bbf178c5ee Only focus the undo bar when the focus isn't inside
It should fix the test "must work properly when selecting undo by keyboard"
which calls focus() but it can be steal by fixed callback in setTimeout.
2026-03-13 13:53:51 +01:00
Jonas Jenwald
67f3972bf0 Add a private FontInfo helper method for reading array-data (PR 20197 follow-up)
Currently the `bbox`, `fontMatrix`, and `defaultVMetrics` getters duplicate almost the same code, which we can avoid by adding a new helper method (similar to existing ones for reading numbers and strings).

The added `assert` in the new helper method also caught a bug in how the `defaultVMetrics` length was compiled.
2026-03-13 11:21:37 +01:00
Jonas Jenwald
3842936edf Split the src/shared/obj-bin-transform.js file into separate files for the main/worker threads (PR 20197 follow-up)
On the worker-thread only the static `write` methods are actually used, and on the main-thread only class instances are being created.
Hence this, after PR 20197, leads to a bunch of dead code in both of the *built* `pdf.mjs` and `pdf.worker.js` files.

This patch reduces the size of the `gulp mozcentral` output by `21 419` bytes, i.e. `21` kilo-bytes, which I believe is way too large of a saving to not do this.
(I can't even remember the last time we managed to reduce build-size this much with a single patch.)
2026-03-13 11:21:24 +01:00
Calixte Denizet
c610f44952 Fix the rendering of the radial gradient when a center is outside of the other circle and there's no extend
It fixes #20851.
2026-03-13 10:23:58 +01:00
calixteman
b7698d617d
Merge pull request #20859 from mozilla/update-locales
l10n: Update locale files
2026-03-13 09:42:50 +01:00
github-actions[bot]
8b86f7bb16 l10n: Update locale files 2026-03-13 00:30:37 +00:00
calixteman
ea949b9a0a
Merge pull request #20845 from calixteman/new_debugger
Update the internal viewer to use a new debugger.
2026-03-12 22:41:47 +01:00
calixteman
2381ac6b16
Update the internal viewer to use a new debugger.
It has few cool features:
 - all the canvas used during the rendering can be viewed;
 - the different properties in the graphics state can be viewed;
 - the different paths can be viewed.
2026-03-12 22:38:08 +01:00
Tim van der Meij
d8a40d9372
Merge pull request #20849 from Snuffleupagus/viewer-rm-enableHWA-opts
Remove the `enableHWA` option from viewer components (PR 20016 follow-up)
2026-03-12 20:40:38 +01:00
Tim van der Meij
decbce7b9b
Merge pull request #20856 from Snuffleupagus/fix-font-clearData
Fix the `FontInfo.prototype.clearData` method to actually remove the data as intended (PR 20197 follow-up)
2026-03-12 20:39:02 +01:00
calixteman
2177c4bc00
Merge pull request #20848 from Snuffleupagus/mv-PagesMapper
Move the `PagesMapper` class into its own file
2026-03-12 18:26:33 +01:00
Jonas Jenwald
e88a5652de Fix the FontInfo.prototype.clearData method to actually remove the data as intended (PR 20197 follow-up)
The purpose of PR 11844 was to reduce memory usage once fonts have been attached to the DOM, since the font-data can be quite large in many cases.

Unfortunately the new `clearData` method added in PR 20197 doesn't actually remove *anything*, it just replaces the font-data with zeros which doesn't help when the underlying `ArrayBuffer` itself isn't modified.
The method does include a commented-out `resize` call[1], but uncommenting that just breaks rendering completely.

To address this regression, without having to make large or possibly complex changes, this patch simply changes the `clearData` method to replace the internal buffer/view with its contents *before* the font-data.
While this does lead to a data copy, the size of this data is usually orders of magnitude smaller than the font-data that we're removing.

---

[1] Slightly off-topic, but I don't think that patches should include commented-out code since there's a very real risk that those things never get found/fixed.
At the very least such cases should be clearly marked with `// TODO: ...` comments, and should possibly also have an issue filed about fixing the TODO.
2026-03-12 18:15:42 +01:00
Calixte Denizet
1291f5a32b
Don't let the user delete/cut all the pages (bug 2021828)
And dispatch an event only when the context menu is displayed.
2026-03-11 17:23:56 +01:00
Jonas Jenwald
63b4874b39 Remove the enableHWA option from viewer components (PR 20016 follow-up)
In PR 20016 the actual uses of the `enableHWA` option was removed from the viewer, but for some reason it's still being provided when initializing `PDFViewer` and `PDFThumbnailViewer` despite the fact that it's now dead code.
2026-03-11 15:28:43 +01:00
Jonas Jenwald
9aa1ce8f14 Move the PagesMapper class into its own file
The `PagesMapper` class currently makes up one third of the `src/display/display_utils.js` file size, and since its introduction it's grown (a fair bit) in size.
Note that the intention with files such as `src/display/display_utils.js` was to have somewhere to place functionality too small/simple to deserve its own file.
2026-03-11 12:28:13 +01:00
Jonas Jenwald
79df166e06
Merge pull request #20846 from Snuffleupagus/internal-viewer-followup
A couple of small improvements of the new internal viewer
2026-03-11 12:01:11 +01:00
calixteman
9d093d9607
Merge pull request #20626 from nicolo-ribaudo/images-right-click
Add support for right-clicking on images (bug 1012805)
2026-03-11 11:45:51 +01:00
calixteman
98f7e859ac
Merge pull request #20837 from calixteman/bug2021934
Disable dragging a thumbnail when the user has to paste what they copied (bug 2021934)
2026-03-11 09:13:25 +01:00