20917 Commits

Author SHA1 Message Date
Calixte Denizet
07f94825c3 Remove the possibility to go to the next page in using the ENTER key (bug 1971299) 2025-06-10 14:58:18 +02:00
Tim van der Meij
250cc7d299
Merge pull request #20000 from timvandermeij/intermittent-find
Fix intermittent failure in the find integration tests
2025-06-08 22:11:15 +02:00
Tim van der Meij
7133259341
Merge pull request #19997 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2025-06-08 22:10:01 +02:00
Tim van der Meij
64a2d708f9
Fix intermittent failure in the find integration tests
After clicking the find button we need to wait for the input field to
appear before we try to type in it, but instead we were waiting for the
button to appear. However, the button is always present, so the current
`waitForSelector` call is basically a no-op, and this can cause the
integration tests to fail intermittently if we continue before the
input field is actually visible.

This appears to be due a typo first introduced in commit
d10da907dac86c103b787127110a59aed82c7aaa that has been copy/pasted.

This commit fixes the issue by waiting for the input field to be visible
before we continue typing in it.
2025-06-08 20:21:13 +02:00
Tim van der Meij
9edcfa26ca
Update translations to the most recent versions 2025-06-08 18:07:23 +02:00
Tim van der Meij
fda68a5a56
Upgrade yargs to version 18.0.0
This is a major version bump, but the changelog at
https://github.com/yargs/yargs/releases/tag/v18.0.0
doesn't indicate any breaking changes that should impact us.
2025-06-08 18:07:23 +02:00
Tim van der Meij
34ef9ece38
Upgrade svglint to version 4.1.0
This is a major version bump, but the changelog at
https://github.com/simple-icons/svglint/releases/tag/v4.0.0
doesn't indicate any breaking changes that should impact us.
2025-06-08 18:06:12 +02:00
Tim van der Meij
003cffe6cb
Update dependencies to the most recent versions 2025-06-08 18:02:45 +02:00
calixteman
18d7aafc94
Merge pull request #19985 from calixteman/puppeteer_24.10.0
Update Puppeteer to version 24.10.0
2025-06-03 20:55:45 +02:00
Calixte Denizet
fd3a41c149 Update Puppeteer to version 24.10.0 2025-06-03 19:38:35 +02:00
Tim van der Meij
7e8587428d
Merge pull request #19981 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2025-06-01 20:30:28 +02:00
Tim van der Meij
8a0eb51f53
Bump the stable version in pdfjs.config 2025-06-01 20:26:12 +02:00
Tim van der Meij
47ad820d95
Merge pull request #19952 from timvandermeij/intermittent-viewer-origin
Fix intermittent failure in the "supports specifying a custom origin" viewer integration test
v5.3.31
2025-06-01 20:10:31 +02:00
Tim van der Meij
f251e600d2
Fix intermittent failure in the "supports specifying a custom origin" viewer integration test
The problem in the original code is that `getTextAt` is called too
early and therefore returns unexpected text content. This can happen
because we call `increaseScale` and then wait for the page's text layer
to be visible, but it can take some time before the zoom actually
occurs/completes in the viewer and in the meantime the old (pre-zoom)
text layer may still be visible, causing us to continue too soon because
we don't validate that we're dealing with the post-zoom text layer.

This commit fixes the issue by simply waiting for the expected text to
show up at the given origin coordinates, which makes the test work
independent of viewer actions/timing.
2025-06-01 19:33:58 +02:00
calixteman
d63aabd662
Merge pull request #19969 from calixteman/editor_inconsistencies
[Editor] Change mode when double clicking on an editor
2025-05-28 18:00:26 +02:00
Calixte Denizet
47e69e93a3 [Editor] Change mode when double clicking on an editor
It was only possible to double click on a FreeText editor while being in ink mode (or any other).
2025-05-28 17:49:16 +02:00
calixteman
712d502561
Merge pull request #19975 from calixteman/fix_color_dialog_buttons
Fix the colors of disabled buttons in the dialogs
2025-05-28 16:14:28 +02:00
Calixte Denizet
de1a9e7055 Fix the colors of disabled buttons in the dialogs 2025-05-26 19:11:24 +02:00
Tim van der Meij
21ef454faf
Merge pull request #19962 from Snuffleupagus/api_utils
Move a few helper functions/classes out of the `src/display/api.js` file
2025-05-24 14:21:29 +02:00
Tim van der Meij
d90ec29b4d
Merge pull request #19964 from Snuffleupagus/core-catalog-private
Replace semi-private fields/methods with actual private ones in `src/core/catalog.js`
2025-05-24 14:16:06 +02:00
Jonas Jenwald
f11d8b0f67
Merge pull request #19972 from Snuffleupagus/issue-19971
Ignore empty paths when optimizing `constructPath` operations (issue 19971)
2025-05-23 18:34:07 +02:00
Jonas Jenwald
c5449a98e0 Ignore empty paths when optimizing constructPath operations (issue 19971)
Note how we're handling empty paths in [src/display/canvas.js](a8e05d82e2/src/display/canvas.js (L1423-L1428)), hence we need add similar code in the `QueueOptimizer` as well.
2025-05-23 13:59:05 +02:00
Jonas Jenwald
a8e05d82e2
Merge pull request #19961 from nicolo-ribaudo/debugger-contructPath-op
Show the op dispatched by constructPath in the debugger
2025-05-23 13:15:55 +02:00
Jonas Jenwald
d81174d7bc
Merge pull request #19956 from Snuffleupagus/versionInfoHeader
Improve how the PDF.js version/commit information is exposed in the *built* files
2025-05-22 15:24:02 +02:00
calixteman
875233b3c6
Merge pull request #19967 from mozilla/revert-19934-minify
Revert "Minify the js code when building for Firefox (bug 1965003)"
2025-05-22 14:22:49 +02:00
calixteman
32789073a9
Revert "Minify the js code when building for Firefox (bug 1965003)" 2025-05-22 14:08:31 +02:00
Jonas Jenwald
a90e46bdc9 Use nullish coalescing in the Catalog.prototype.numPages getter 2025-05-21 16:47:20 +02:00
Jonas Jenwald
0d2ab3c709 Replace semi-private fields/methods with actual private ones in src/core/catalog.js
Additionally, move a couple of "public" fields out of the class constructor and initialize them directly instead.
2025-05-21 12:10:07 +02:00
Jonas Jenwald
e91b480c09 Move the PDFObjects class to its own file
This isn't directly part of the official API, and having this class in its own file could help avoid future changes (e.g. issue 18148) affecting the size of the `src/display/api.js` file unnecessarily.
2025-05-20 13:47:36 +02:00
Jonas Jenwald
0105237af6 Move a few helper functions/classes out of the src/display/api.js file
Given that this file represents the official API, it's difficult to avoid it becoming fairly large as we add new functionality. However, it also contains a couple of smaller (and internal) helpers that we can move into a new utils-file.

Also, we inline the `DEFAULT_RANGE_CHUNK_SIZE` constant since it's only used *once* and its value has never been changed in over a decade.
2025-05-20 13:47:36 +02:00
Nicolò Ribaudo
0596f03d4e
Show the op dispatched by constructPath in the debugger
The `constructPath` op receives as arguments not only the
information to construct the path, but also the op to apply
the path to (such as "fill", or "stroke").

This commit updates the Stepper tool in the debugger to decode
that op, showing its name rather than just its numeric ID.
2025-05-19 19:33:14 +02:00
calixteman
fc68a9f3ee
Merge pull request #19958 from calixteman/rm_useless_subarray_flate_stream
Don't create a useless subarray when getting image data from a flate stream
2025-05-19 19:29:25 +02:00
Jonas Jenwald
e921533577
Merge pull request #19960 from Snuffleupagus/version-5.3
Bump library version to `5.3`
2025-05-19 18:00:47 +02:00
Jonas Jenwald
6c803e89e6 Bump library version to 5.3 2025-05-19 17:57:28 +02:00
calixteman
f148106cb1
Merge pull request #19957 from calixteman/rm_qcms_subarray
Remove all the useless subarrays when using qcms.
2025-05-19 17:33:52 +02:00
calixteman
72faeeab93
Merge pull request #19959 from calixteman/undefined_worker_port
Fix pdfjsPreloadedWorker when it's undefined
2025-05-19 17:29:18 +02:00
Jonas Jenwald
36b40d959b
Merge pull request #19955 from Snuffleupagus/issue-19954
Support Type3 fonts with an incomplete /FontDescriptor dictionary (issue 19954)
2025-05-19 17:26:46 +02:00
Calixte Denizet
69231e2dbd Fix pdfjsPreloadedWorker when it's undefined 2025-05-19 17:05:37 +02:00
Calixte Denizet
3ecbef516d Don't create a useless subarray when getting image data from a flate stream 2025-05-19 16:48:23 +02:00
Calixte Denizet
782e883a87 Remove all the useless subarrays when using qcms.
It reduces the memory use and the newly added function `getRgbHex` is 4 times faster.
2025-05-19 16:07:57 +02:00
calixteman
2b9f621087
Merge pull request #19953 from calixteman/rm_useless_arrays
[api-minor] Create the css color to use with the canvas in the worker
2025-05-19 16:02:08 +02:00
Jonas Jenwald
c02ea0c681 Simplify how we handle Type3 fonts without a /FontDescriptor dictionary
Part of this is very old code, which we can now simplify a little bit.
2025-05-19 15:26:11 +02:00
Jonas Jenwald
97a42486f5 Improve how the PDF.js version/commit information is exposed in the *built* files
To make it easier to tell which PDF.js version/commit that the *built* files correspond to, they have (since many years) included `pdfjsVersion` and `pdfjsBuild` constants with that information.

As currently implemented this has a few shortcomings:
 - It requires manually adding the code, with its preprocessor statements, in all relevant files.

 - It requires ESLint disable statements, since it's obviously unused code.

 - Being unused, this code is removed in the minified builds.

 - This information would be more appropriate as comments, however Babel discards all comments during building.

 - It would be helpful to have this information at the top of the *built* files, however it's being moved during building.

To address all of these issues, we'll instead utilize Webpack to insert the version/commit information as a comment placed just after the license header.
2025-05-19 15:01:05 +02:00
Calixte Denizet
5789afd3f8 Create the css color to use with the canvas in the worker
It slightly reduces the time spent to draw and the memory used.
2025-05-19 14:52:24 +02:00
Jonas Jenwald
5f5d9dfc28 Support Type3 fonts with an incomplete /FontDescriptor dictionary (issue 19954)
We have a fallback for the common case of Type3 fonts without a /FontDescriptor dictionary, however we also need to handle the case where it's present but lacking the required /FontName entry.
2025-05-19 12:56:14 +02:00
Tim van der Meij
60574fb7e3
Merge pull request #19950 from timvandermeij/intermittent-all-await
Fix missing `await` for asynchronous method calls in the integration tests
2025-05-18 19:12:48 +02:00
Tim van der Meij
393e799e49
Fix missing await for asynchronous method calls in the integration tests
The `Page.evaluate()` and `Mouse.click()` APIs in Puppeteer both return
a promise; see https://pptr.dev/api/puppeteer.page.evaluate and
https://pptr.dev/api/puppeteer.mouse.click, and should therefore be
awaited before proceeding in tests to make sure that the test's behavior
is deterministic and avoid intermittent failures.

The following command was used to find potential places to fix:
`grep -nEr "[^await|return] page\." test/integration/*`
2025-05-18 18:19:46 +02:00
Tim van der Meij
819671d42f
Merge pull request #19949 from timvandermeij/intermittent-stamp-undo
Fix intermittent failure in the stamp editor's undo-related integration tests
2025-05-18 15:17:41 +02:00
Tim van der Meij
6355dd7ded
Fix intermittent failure in the stamp editor's undo-related integration tests
The clipboard, used via the `copyImage` helper function, is a shared
resource, so access to it cannot happen concurrently because it could
result in tests overwriting each other's contents. Most tests using
the clipboard are therefore run sequentially, but only the stamp
editor's undo-related tests weren't, so this commit fixes the issue
by running those tests sequentially too.
2025-05-18 14:36:19 +02:00
Tim van der Meij
f6e4b1cf4a
Merge pull request #19945 from Snuffleupagus/NetworkStream-rm-Node-Error
Remove Node.js-specific checks when using the Fetch API
2025-05-18 12:05:13 +02:00