22512 Commits

Author SHA1 Message Date
Tim van der Meij
f4e24f75ae
Merge pull request #21181 from Snuffleupagus/getPageIndex-async
Convert `Catalog.prototype.getPageIndex` to an asynchronous method
2026-04-28 12:55:38 +02:00
Jonas Jenwald
3475806311 Convert Catalog.prototype.getPageIndex to an asynchronous method
This simplifies/shortens a piece of old code, which shouldn't hurt.
2026-04-28 11:34:41 +02:00
Jonas Jenwald
339f755a52 Add more validation in the Catalog.prototype.getPageIndex method
- Ensure that the /Kids-entries are Arrays, before trying to iterate through them.
 - Ensure that the /Count-entries are (positive) integers.
2026-04-28 11:33:50 +02:00
calixteman
a1b7d0feb5
Merge pull request #21169 from calixteman/speedup_lint
Improve the performances of "gulp lint"
2026-04-27 22:14:42 +02:00
Tim van der Meij
d68ef5bc36
Merge pull request #21177 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2026-04-27 21:31:34 +02:00
Tim van der Meij
12c96d5510
Bump the stable version in pdfjs.config 2026-04-27 21:26:50 +02:00
calixteman
7e5b36c2d5
Merge pull request #21171 from calixteman/bug2034980
Allow free-highlighting on top of image placeholders (bug 2034980)
v5.7.284
2026-04-27 21:07:56 +02:00
Calixte Denizet
dc3c07b3e3 Allow free-highlighting on top of image placeholders (bug 2034980)
The `textLayerImagePlaceholder` canvas added in #20626 covers scanned
pages and was not recognized as a valid pointerdown target by
`#textLayerPointerDown`, so free highlights couldn't start.
2026-04-27 20:13:39 +02:00
calixteman
01b315a8f3
Merge pull request #21176 from calixteman/bug2035197
Fix merging PDFs with conflicting AcroForm /DR (bug 2035197)
2026-04-27 20:04:43 +02:00
Calixte Denizet
c9a7ff0506 Fix merging PDFs with conflicting AcroForm /DR (bug 2035197) 2026-04-27 18:54:52 +02:00
Tim van der Meij
d9f175d36d
Merge pull request #21174 from nicolo-ribaudo/fix-comment
Fix array type in CanvasBBoxTracker comment
2026-04-27 16:33:53 +02:00
Nicolò Ribaudo
81678f20ca
Fix array type in CanvasBBoxTracker comment
Remove the "Float32Array" mention in the comment, given that the
implementation usesa  Float64Array.

Actually using a Float32Array passes all the tests we currently have and
reduces memory usage (by 16 bytes per op), however to be sure that it
does not introduce rounding bugs we'd need to `Math.fround` all
operations we do on the clipBox and pendingBBox. It reduces the
readibilty of the code, but we can revisit if this memory usage becomes
a problem.
2026-04-27 15:52:12 +02:00
Tim van der Meij
8d3d370daa
Merge pull request #21170 from calixteman/speedup_typetest
Speed up 'gulp typestest' by removing the unused 'generic' dependency
2026-04-27 13:59:06 +02:00
calixteman
da0b99ce68
Merge pull request #20371 from timvandermeij/github-actions-integration-tests
Introduce a GitHub Actions workflow for running the integration tests
2026-04-27 09:51:22 +02:00
calixteman
3b8f55603d
Merge pull request #21154 from calixteman/bug2034804
Fix merging a PDF after a page deletion (bug 2034804)
2026-04-27 09:19:14 +02:00
calixteman
38beff5cef Speed up 'gulp typestest' by removing the unused 'generic' dependency 2026-04-27 09:14:34 +02:00
calixteman
a761dac3ea
Improve the performances of "gulp lint"
Don't format json files with Prettier: it's done by eslint.
Parallelize the linting tools and eslint.
2026-04-26 23:09:50 +02:00
Calixte Denizet
64b25a8f47
Fix merging a PDF after a page deletion (bug 2034804)
When pages carry explicit pageIndices (e.g. after a delete),
resolve insertAfter against that layout instead of the empty
base sequence. Also reject partial pageIndices combined with
insertAfter, which would race against the extraction's auto-fill.
2026-04-26 22:37:22 +02:00
calixteman
53931c5d2f
Merge pull request #21132 from calixteman/workflow_sync_pdfs
Add a gh workflow for triggering an event when some pdfs are added in test/pdfs
2026-04-26 22:15:03 +02:00
Jonas Jenwald
0ec70b0953
Merge pull request #21168 from Snuffleupagus/unittestcli-coverage-web
Include the `web/` folder in the coverage report for `gulp unittestcli`
2026-04-26 22:02:08 +02:00
Jonas Jenwald
40ea3e3acb Include the web/ folder in the coverage report for gulp unittestcli
Given that there's a few unit-tests for `web/` code that runs in Node.js, it seems reasonable to include that folder in the coverage report.
2026-04-26 21:55:09 +02:00
Calixte Denizet
65792863b9
Add a gh workflow for triggering an event when some pdfs are added in test/pdfs 2026-04-26 21:29:10 +02:00
Tim van der Meij
ce998f1d16
Introduce a GitHub Actions workflow for running the integration tests 2026-04-26 20:40:57 +02:00
Tim van der Meij
b178305a8b
Merge pull request #21167 from timvandermeij/fix-coverage-workflow
Fix the Codecov token not being usable in the unit tests GitHub Actions workflow
2026-04-26 20:40:20 +02:00
Tim van der Meij
142c581362
Fix the Codecov token not being usable in the unit tests GitHub Actions workflow
The job's environment must be `code-coverage` before it has access to
the `CODECOV_TOKEN` secret that's required for pushing coverage data to
Codecov. Without it we get an HTTP 400 response with a `Token required
because branch is protected` message if it's run from `master`.

Fixes f932a58d.
2026-04-26 20:25:57 +02:00
calixteman
f45d507302
Merge pull request #21165 from timvandermeij/github-actions-unit-tests-coverage
Include unit test coverage reporting in the GitHub Actions workflow
2026-04-26 19:55:53 +02:00
calixteman
88609becf8
Merge pull request #21166 from Snuffleupagus/internal-viewer-fixes
A couple of `internal-viewer` fixes
2026-04-26 19:54:36 +02:00
calixteman
c4afee385a
Merge pull request #21164 from timvandermeij/github-actions-font-tests-twice
Remove duplicated font tests execution in the GitHub Actions workflow
2026-04-26 19:53:47 +02:00
Jonas Jenwald
fae980a72d A couple of internal-viewer fixes
- Bundle the `web/text_layer_builder.css` file correctly, to ensure that textLayer debugging works when the code is *built*.
   Note how loading https://mozilla.github.io/pdf.js/internal-viewer/web/debugger.html currently logs the following error: `GET https://mozilla.github.io/pdf.js/internal-viewer/text_layer_builder.css [HTTP/2 404  7ms]`.

 - Import the `MathClamp` helper function from the *built* library, rather than "manually", since that's more correct.
2026-04-26 19:10:05 +02:00
Tim van der Meij
348942418c
Merge pull request #21163 from timvandermeij/updates
Update dependencies to the most recent versions
2026-04-26 17:01:06 +02:00
Tim van der Meij
f932a58d9c
Include unit test coverage reporting in the GitHub Actions workflow 2026-04-26 15:53:30 +02:00
Tim van der Meij
2d95e9964c
Remove duplicated font tests execution in the GitHub Actions workflow
The font tests have run with coverage reporting enabled for quite some
time now and the coverage information has proven to work and be stable,
so we don't have to also run the font tests without coverage reporting
anymore, thereby reducing the total runtime of the workflow.
2026-04-26 15:49:52 +02:00
Jonas Jenwald
60dcc64419
Merge pull request #21162 from Snuffleupagus/renderCommentButton-zIndex-parseInt
Get the `zIndex` correctly in `PopupElement.prototype.renderCommentButton`
2026-04-26 15:21:55 +02:00
Tim van der Meij
9afc31751a
Update dependencies to the most recent versions 2026-04-26 15:02:02 +02:00
Jonas Jenwald
72011c5088 Get the zIndex correctly in PopupElement.prototype.renderCommentButton
In practice this probably hasn't caused any bugs, however given that `DOMElement.style.zIndex` returns a string the existing code is subtly wrong.
This is also consistent with pre-existing `zIndex` code in the `PopupElement` class, see the `#show` and `#hide` methods.
2026-04-26 14:46:39 +02:00
Tim van der Meij
4aed8fd01b
Merge pull request #21161 from Snuffleupagus/getPageIndex-more-tests
Improve unit-testing for the `PDFDocumentProxy.prototype.getPageIndex` method
2026-04-26 14:46:24 +02:00
Jonas Jenwald
fc9d9e49de Improve unit-testing for the PDFDocumentProxy.prototype.getPageIndex method
Given the existing worker-thread caching it doesn't seem, based on the coverage report, that all of the `getPageIndex` code is being tested.
2026-04-26 13:38:08 +02:00
Jonas Jenwald
5c11bf15b0
Merge pull request #21160 from Snuffleupagus/more-hexNumbers
Move the `hexNumbers` Array into `Util`, to enable using it in the viewer
2026-04-26 13:08:42 +02:00
Tim van der Meij
0d7439e856
Merge pull request #21158 from Snuffleupagus/modifiedIds-proper-hash
Compute a "proper" hash in the `AnnotationStorage.prototype.modifiedIds` getter
2026-04-26 12:10:24 +02:00
Jonas Jenwald
9b238b9719 Move the hexNumbers Array into Util, to enable using it in the viewer
This reduces some code duplication, and the new `Util.hexNums` property is now computed lazily.
2026-04-26 12:05:12 +02:00
Tim van der Meij
2674a9f3e4
Merge pull request #21137 from calixteman/bug2022700
Don't decode name of the checkboxes exported values (bug 2022700)
2026-04-26 12:00:58 +02:00
Jonas Jenwald
1591ddfa8d
Merge pull request #21157 from Snuffleupagus/eslint-radix
Enable the `radix` ESLint rule
2026-04-25 22:27:21 +02:00
Jonas Jenwald
b72a229ee8 Compute a "proper" hash in the AnnotationStorage.prototype.modifiedIds getter
Currently the hash-property is just a stringified Array, which means that the hash-property can become arbitrarily long. That's not a good idea since it's used to compute a cache-key, in the API, which is then sent to the worker-thread. Hence the hash-property should be reasonably short, and its length should *not* depend on the number of modified editors, which can be achieved by using `MurmurHash3_64` here as well.
2026-04-25 12:52:29 +02:00
Jonas Jenwald
e6dba6ee34 Enable the radix ESLint rule
Many `parseInt` call-sites already provide the `radix` argument, and this rule helps improve consistency in the code-base; see https://eslint.org/docs/latest/rules/radix

*Please note:* The rule is disabled in `src/scripting_api/util.js` for now, since it's not obvious at a glance (at least to me) what the correct `radix` argument should be there.
2026-04-25 12:13:12 +02:00
calixteman
30d060c77a
Merge pull request #21151 from calixteman/bug2034568
Fix clicking on a thumbnail image not navigating to the correct page when using a screen reader (bug 2034568)
2026-04-25 08:20:25 +02:00
Tim van der Meij
f41c60ab7e
Merge pull request #21147 from Snuffleupagus/unittestcli-download-PDFs
Download linked PDFs when running `gulp unittestcli`
2026-04-24 20:29:14 +02:00
Tim van der Meij
7dc4812643
Merge pull request #21138 from calixteman/bug2034111
Fix status label mismatch after merging with a pre-existing selection (bug 2034111)
2026-04-24 20:07:50 +02:00
calixteman
2d896faa1e
Merge pull request #21142 from calixteman/input_color_alpha
[Ink] Replace the opacity slider with an alpha-enabled color input
2026-04-24 15:46:46 +02:00
Jonas Jenwald
476626eb49
Merge pull request #21153 from Snuffleupagus/rm-MIN_INT_32
Remove the unused `MIN_INT_32` constant (PR 21139 follow-up)
2026-04-24 15:01:16 +02:00
Calixte Denizet
39eb691252
Fix status label mismatch after merging with a pre-existing selection (bug 2034111) 2026-04-24 14:13:53 +02:00