22312 Commits

Author SHA1 Message Date
Tim van der Meij
36f63bebcc
Merge pull request #21058 from mozilla/dependabot/github_actions/actions/deploy-pages-5.0.0
Bump actions/deploy-pages from 4.0.5 to 5.0.0
2026-04-07 20:41:32 +02:00
Tim van der Meij
1f2e4adfc5
Merge pull request #21050 from Snuffleupagus/Ascii85Stream-fill
Replace a couple of loops with `TypedArray.prototype.fill()` in the `src/core/ascii_85_stream.js` file
2026-04-07 20:38:27 +02:00
Tim van der Meij
60668707fb
Merge pull request #21056 from mozilla/dependabot/github_actions/github/codeql-action-4.35.1
Bump github/codeql-action from 4.33.0 to 4.35.1
2026-04-07 20:34:12 +02:00
calixteman
d6afffe8f6
Merge pull request #21059 from calixteman/bug2028193
Make sure the thumbnails positions are recomputed after a structural change but after a reflow has been done (bug 2028193)
2026-04-07 17:02:07 +02:00
calixteman
f61e00f2fa
Merge pull request #21054 from calixteman/fix_writing_numbers
Fix the way to write numbers when saving a pdf
2026-04-07 16:55:36 +02:00
calixteman
1bf1ef2939
Merge pull request #21053 from Snuffleupagus/CFFCompiler-TypedArray
Reduce allocations when compiling CFF fonts
2026-04-07 16:55:02 +02:00
Calixte Denizet
1b2e98f3ce
Make sure the thumbnails positions are recomputed after a structural change but after a reflow has been done (bug 2028193) 2026-04-07 15:48:23 +02:00
Jonas Jenwald
6f0431456c Reduce allocations when compiling CFF fonts
Currently the `CFFCompiler.prototype.compile` implementation seem a bit inefficient, since the data is stored in a plain Array that needs to grow (a lot) during compilation. Additionally, adding a lot of entries isn't very efficient either and requires special handling of the "too many elements" case.
Some of the "helper" methods that use TypedArrays internally currently need to convert their return data to plain Arrays, via the `compileTypedArray` method, which adds even more intermediate allocations.
Note also that the `OpenTypeFileBuilder` has a special-case for writing plain Array data, which is only needed because of how the CFF compilation is implemented.

To improve this situation the `CFFCompiler.prototype.compile` method is re-factored to store its data in a TypedArray, whose initial size is estimated from the "raw" file size.
This removes the need for most intermediate allocations, and it also handles adding of "many elements" more efficiently.
2026-04-07 14:27:55 +02:00
dependabot[bot]
147ce2b2d2
Bump actions/deploy-pages from 4.0.5 to 5.0.0
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4.0.5 to 5.0.0.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](d6db90164a...cd2ce8fcbc)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 12:13:42 +00:00
dependabot[bot]
2ce0b5a528
Bump github/codeql-action from 4.33.0 to 4.35.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.33.0 to 4.35.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b1bff81932...c10b8064de)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 12:13:16 +00:00
calixteman
959701d8e7
Merge pull request #21055 from Snuffleupagus/toggleButton-fix-l10n
Fix the l10n-id for the sidebar toggleButton, in the `ViewsManager` class
2026-04-07 13:44:42 +02:00
Jonas Jenwald
8656b4acb3 Fix the l10n-id for the sidebar toggleButton, in the ViewsManager class
Steps to reproduce:
 1. Open http://localhost:8888/web/viewer.html
 2. Open the console, and run: `PDFViewerApplication.close();`
 3. Note the warning: `[fluent] Missing translations in en-us: pdfjs-toggle-views-manager-button`
2026-04-07 11:13:35 +02:00
Calixte Denizet
3d95aab8d7
Fix the way to write numbers when saving a pdf
It'll avoid to have numbers like 1e-23.
2026-04-07 10:52:06 +02:00
Jonas Jenwald
f8d7c20a1a
Merge pull request #21051 from Snuffleupagus/writePDF-stringToBytes
Use the `stringToBytes` helper in the `PDFEditor.prototype.writePDF` method
2026-04-06 15:55:49 +02:00
Jonas Jenwald
ea12a28e2f Use the stringToBytes helper in the PDFEditor.prototype.writePDF method
This avoids effectively re-implementing an existing helper function, and the code is also simplified a tiny bit by building the final TypedArray header directly.
2026-04-06 14:58:21 +02:00
calixteman
6ac79d05d1
Merge pull request #21049 from calixteman/load_gpu
Unconditionally create a gpu device
2026-04-06 14:14:22 +02:00
calixteman
a9f142c796
Unconditionally create a gpu device
One drawback of the current implementation is that the GPU device can be
unavailable at the time of the first pattern fill, which causes the
GPU-accelerated canvas to be move on the main thread because of putImageData.

Most of the shading patterns stuff will be moved to the GPU and in order
to avoid creating some useless data we've to know if the GPU is available or not.

So in this patch we create the GPU device during the worker initialization
and pass a flag to the evaluator to know if the GPU is available or not.
2026-04-06 13:23:29 +02:00
Jonas Jenwald
dc448b3ceb Replace a couple of loops with TypedArray.prototype.fill() in the src/core/ascii_85_stream.js file 2026-04-06 11:49:25 +02:00
Tim van der Meij
dd8f0a327f
Merge pull request #21048 from Snuffleupagus/buildPostScriptJsFunction-forceInterpreter
Shorten the `src/core/postscript/` code a tiny bit
2026-04-05 18:19:33 +02:00
Jonas Jenwald
9f9be2c619 Use this more in static methods in the src/core/postscript/ folder
Inside of static methods it's possible to reference static fields with `this`, rather than having to spell out the full class name.
2026-04-05 14:22:08 +02:00
Jonas Jenwald
ccab310a39 Add an optional parameter in buildPostScriptJsFunction to force use of the PSStackBasedInterpreter code
This way the test-only function `buildPostScriptProgramFunction` can be removed.
2026-04-05 13:52:09 +02:00
calixteman
853d5436c1
Merge pull request #21046 from timvandermeij/integration-test-ai-killswitch
Replace individual AI/ML disabling preferences with the single killswitch preference in the tests
2026-04-05 13:12:48 +02:00
Jonas Jenwald
cae075e8d0
Merge pull request #21047 from Snuffleupagus/AnnotationLayer-rm-floor-borderColor
Remove unnecessary "flooring" of the components when setting the Annotation `borderColor`
2026-04-05 12:41:04 +02:00
Jonas Jenwald
5aaf30a071
Merge pull request #21018 from Snuffleupagus/Node-22
[api-minor] Update the minimum supported Node.js version to 22
2026-04-05 12:39:36 +02:00
Jonas Jenwald
d155506005 Remove unnecessary "flooring" of the components when setting the Annotation borderColor
This looks like a leftover from much older code, since all colors are now parsed with the [`getRgbColor` helper](ca85d73335/src/core/annotation.js (L558-L583)) which returns `Uint8ClampedArray` data when the color is valid.

Also, use spread syntax when calling `Util.makeHexColor` in a few more spots.
2026-04-05 11:23:32 +02:00
Tim van der Meij
de9f139963
Replace individual AI/ML disabling preferences with the single killswitch preference in the tests
Firefox 148 shipped with a single killswitch to disable current and
future AI/ML functionality. This can be controlled in the GUI via
`Settings -> AI Controls -> Block AI enhancements`, but can also be
controlled programmatically via the `browser.ai.control.default`
preference.

This commit uses this single preference to replace the multiple
preferences we had to use for this purpose before.

Extends 844681a.
2026-04-04 20:23:35 +02:00
calixteman
ca85d73335
Merge pull request #21043 from timvandermeij/integration-test-intermittents-find-count
Fix intermittent integration test failures related to checking the find count results text
2026-04-04 20:21:52 +02:00
calixteman
da83ca69ca
Merge pull request #21045 from timvandermeij/integration-test-comment-trip
Fix intermittent failure in the "must check that the comment sidebar is resizable with the keyboard" comment integration test
2026-04-04 20:19:14 +02:00
calixteman
b5dd450041
Merge pull request #21040 from Snuffleupagus/constructSampled-flat-arrays
Use the original array-data when parsing Type 0 (Sampled) Functions
2026-04-04 19:56:54 +02:00
calixteman
345329e490
Merge pull request #21041 from timvandermeij/function-type-enumeration
Introduce a function type enumeration
2026-04-04 19:55:46 +02:00
Tim van der Meij
24e5377240
Fix intermittent failure in the "must check that the comment sidebar is resizable with the keyboard" comment integration test
In PR #20887 the issue got fixed partly, but two issues remained that
unintendedly left room for intermittent failres:

- in the "Ctrl+ArrowLeft/Right" loop the `waitForBrowserTrip` call was
  placed _before_ the actual keypresses, which means that for the final
  iteration of the loop the last key presses were not properly awaited;

- in the "ArrowLeft/ArrowRight" loop the `waitForBrowserTrip` call was
  absent, which means that we didn't wait for key presses at all.

This commit fixes the issues by consistently waiting to a browser trip
_after_ each key press to make sure the sidebar got a chance to render.
2026-04-04 19:17:54 +02:00
Tim van der Meij
6dccf85a0b
Fix intermittent integration test failures related to checking the find count results text
There is generally a small amount of time between the find call being
reported as finished and the find count results text being updated with
the correct number in the DOM, so the integration tests will fail if we
check the find results count text too soon.

This commit fixes the issue by using the `waitForTextToBe` helper
function to wait until the find count results text is what we expect it
to be. Note that we already use this helper function for this exact
purpose in other integration tests (related to reorganizing pages), and
it's also a little bit shorter/easier to read which cannot hurt.
2026-04-04 16:55:12 +02:00
Tim van der Meij
68da778329
Introduce a function type enumeration
This improves readability by removing "magic" numbers, and matches what
we already have for e.g. annotation and shading types.

Note that function type 1 does not exist in the specification, but that
also applies to everything higher than 4, so we can also remove the
specific handling of function type 1 and instead just let it fall
through to throwing an exception for unknown function types, in which we
now also log the provided function type to aid debugging.
2026-04-04 14:57:59 +02:00
Jonas Jenwald
fa344c1852 Use the original array-data when parsing Type 0 (Sampled) Functions
It seems just as easy to lookup the needed data in the original arrays, rather than having to first create (and allocate) nested arrays for that purpose.
2026-04-04 14:07:21 +02:00
Tim van der Meij
e10f11bd3a
Merge pull request #21038 from Snuffleupagus/add_test-calculateMD5
Use the `calculateMD5` helper, from `test/downloadutils.mjs`, in `test/add_test.mjs`
2026-04-04 14:01:55 +02:00
Jonas Jenwald
6207116e9b Use the calculateMD5 helper, from test/downloadutils.mjs, in test/add_test.mjs
Avoid essentially duplicating that function, and make `test/add_test.mjs` async to simplify the code a little bit.
2026-04-04 12:31:14 +02:00
Tim van der Meij
bc38b633ee
Merge pull request #21035 from timvandermeij/updates
Update dependencies to the most recent versions
2026-04-04 11:33:08 +02:00
Tim van der Meij
0b9f8fa950
Merge pull request #21036 from calixteman/fix_comment
Fix comments for (is/has)Singlefile in pdf_editor
2026-04-04 11:30:12 +02:00
Jonas Jenwald
fe35a87c85
Merge pull request #21005 from Snuffleupagus/rm-PostScriptCompiler
[api-minor] Remove `PostScriptCompiler` and `PostScriptEvaluator`, since it's now dead code (PR 21023 follow-up)
2026-04-04 11:02:34 +02:00
Jonas Jenwald
c7b17ecc26
Merge pull request #21037 from Snuffleupagus/rm-compilePostScriptToIR
Remove the unused `compilePostScriptToIR` function (PR 21023 follow-up)
2026-04-04 10:59:29 +02:00
Jonas Jenwald
4cf0bf410b Remove the unused compilePostScriptToIR function (PR 21023 follow-up)
This function was added in PR 21010, and it became unused in PR 21023.
2026-04-03 22:47:12 +02:00
Jonas Jenwald
0e6903d11e Bump library version to 5.7
See commit a40b91f0bba70c65fe6ac7baba775f7e4b362a4d
2026-04-03 22:29:55 +02:00
Jonas Jenwald
58fc6026fc Add a linked test-case for PR 5134
This test-case is an especially "bad" one performance wise given its PostScript function use, when falling back to the (now removed) `PostScriptEvaluator` code.
2026-04-03 22:29:38 +02:00
calixteman
b3e4932cca
Fix comments for (is/has)Singlefile in pdf_editor 2026-04-03 22:15:34 +02:00
Jonas Jenwald
f6bac014ea [api-minor] Remove PostScriptCompiler and PostScriptEvaluator, since it's now dead code (PR 21023 follow-up)
These classes, and various related code, became unused after PR 21023 with only unit-tests actually running that code now.

Also removes the `isEvalSupported` API option, since the `PostScriptCompiler` was the only remaining code where `eval` was used.
2026-04-03 22:14:14 +02:00
calixteman
5347c22703
Merge pull request #21020 from calixteman/issue7821
Fix the annotation base transform before drawing it
2026-04-03 21:26:48 +02:00
calixteman
f8f21c0eca
Merge pull request #21030 from calixteman/eslint_math_clamp
Add an eslint plugin for using MathClamp when it's possible
2026-04-03 21:19:35 +02:00
Calixte Denizet
1e3d688a32
Add an eslint plugin for using MathClamp when it's possible 2026-04-03 21:12:52 +02:00
Calixte Denizet
9ed5eef6d7
Fix the annotation base transform before drawing it
It fixes #7821.

We do something similar for before drawing XObjects.
2026-04-03 20:59:37 +02:00
calixteman
f05bad9872
Merge pull request #21019 from calixteman/issue16091
Get the right transform for a pattern before filling some text
2026-04-03 20:57:29 +02:00