22546 Commits

Author SHA1 Message Date
Tim van der Meij
55e0f7e97f
Remove obsolete pdfBug: true flag in the image caching unit test
In a previous commit the time-based checks, which were based on
statistics provided by the `pdfBug: true` flag, got replaced by
test-only property checks that don't use said statistics anymore.

Fixes b01eeaf8.
2026-04-30 14:07:39 +02:00
Tim van der Meij
8f170307ed
Merge pull request #21195 from timvandermeij/unit-test-optimizations
Optimize memory usage in the unit tests
2026-04-30 12:59:58 +02:00
Jonas Jenwald
adf07ea51c
Merge pull request #21200 from Snuffleupagus/Intersector-grid-push
Shorten how intersectors are added to the grid in the `Intersector` constructor
2026-04-30 12:56:38 +02:00
Tim van der Meij
232506f4e8
Optimize memory usage in the unit tests
This commit fixes a number of missing cleanup steps in the unit tests
that kept state alive for longer than necessary:

- the loading tasks were not all being destroyed;
- the find controllers were not being reset;
- the state set in `beforeAll`/`beforeEach` was not all being nulled in
  the correspoding `afterAll`/`afterEach` blocks.

Combined this resulted in a steady increase in memory usage of the test
process as the tests ran, climbing up to ~1.5 GB. After this patch the
memory usage remains stable at ~800 MB.
2026-04-30 12:35:59 +02:00
Tim van der Meij
b71be8a501
Merge pull request #21198 from Snuffleupagus/DecryptStream-nextChunk
Simplify the `nextChunk` handling in the `DecryptStream` class
2026-04-30 12:23:18 +02:00
Jonas Jenwald
4a5c455c0b Shorten how intersectors are added to the grid in the Intersector constructor
Thanks to modern JavaScript features this code can be simplified a tiny bit.
2026-04-30 12:06:08 +02:00
Jonas Jenwald
f26b98c7c4 Simplify the nextChunk handling in the DecryptStream class
This is old code, that can be simplified a tiny bit with modern JavaScript features.
2026-04-30 11:40:34 +02:00
calixteman
d92db130da
Merge pull request #21186 from timvandermeij/reorganize-pages-intermittents
Wait for the first page to be ready in the reorganize pages integration tests
2026-04-30 09:01:26 +02:00
calixteman
ac63d851b8
Merge pull request #21197 from Snuffleupagus/find-#extractText-more-await
Improve error handling in the `PDFFindController.prototype.#extractText` method
2026-04-30 08:57:29 +02:00
Jonas Jenwald
aa08b02a5b Avoid setting page-content for a previous document in the PDFFindController.prototype.#extractText method
Given that all of the relevant API methods are asynchronous it's possible, although quite unlikely, that the existing "is the document active" check won't catch all situations where the document was closed in the middle of searching.
2026-04-29 22:39:53 +02:00
Jonas Jenwald
a6e2a42df1 Improve error handling in the PDFFindController.prototype.#extractText method
This handles *all* errors correctly, if e.g. the document is closed in the middle of searching.
Also, replacing the "promise chains" with more `await` helps simplify the code a little bit.
2026-04-29 22:39:51 +02:00
Tim van der Meij
34c3ee16f8
Merge pull request #21194 from calixteman/improve_codecov
Slighty improve codecov stuff in gh actions
2026-04-29 17:04:14 +02:00
Calixte Denizet
c91fa7e2dd
Slighty improve codecov stuff in gh actions
disable_search == true, will avoid useless search especially because we already provide the path to the info file.
disable_telem == true, disable sending telemetry to codecov.
2026-04-29 16:48:46 +02:00
Tim van der Meij
2979253338
Merge pull request #21193 from calixteman/fix_intermittent_hangul
Fix the intermittent test failure 'performs a search in a text containing some Hangul syllables'
2026-04-29 15:50:49 +02:00
Calixte Denizet
9a247e51b4
Fix the intermittent test failure 'performs a search in a text containing some Hangul syllables'
The patch cb8055f0a changed the worker source so just set it as it was.
2026-04-29 15:36:22 +02:00
Tim van der Meij
eb97e6b2b1
Merge pull request #21191 from timvandermeij/unittestcli-merge
Move `unittestcli` coverage collection to `ci.yml`
2026-04-29 15:02:24 +02:00
Tim van der Meij
3d8a3f09c5
Move unittestcli coverage collection to ci.yml
Originally we introduced a separate `coverage.yml` workflow to
test-drive coverage collection without immediately introducing it inline
in the `ci.yml` workflow. However, now that coverage collection works
nicely and is performant enough we can simplify the workflow definitions
by removing `coverage.yml` entirely in favor of simply inlining coverage
collection into the existing `unittestcli` run in `ci.yml`. Doing so
also avoids having to a full extra `unittestcli` run just to collect
coverage information.

Moreover, this commit aligns coverage collection flags with the ones in
the other workflows to be more explicit and consistent.
2026-04-29 14:43:01 +02:00
Tim van der Meij
4021d57153
Wait for the first page to be ready in the reorganize pages integration tests
The thumbnails are only available if the first page is ready, and not
awaiting that causes the drag-and-drop action to be performed using
incorrect thumbnail viewer state (see the analysis in #21184 for more
details).

Fixes #21184.
Supersedes #20902.
Unblocks #21173.
2026-04-29 14:22:10 +02:00
Jonas Jenwald
e2591b3fbb
Merge pull request #21190 from Snuffleupagus/DecodeStream-abstract-readBlock
Add an abstract `readBlock` method in the `DecodeStream` class
2026-04-29 14:19:10 +02:00
calixteman
0c5eaeeac6
Merge pull request #21189 from calixteman/issue21185
Use Istanbul instrumentation for unittestcli code coverage
2026-04-29 13:48:04 +02:00
Jonas Jenwald
1f6bfa0890 Add an abstract readBlock method in the DecodeStream class
This avoids having to "duplicate" dummy `readBlock` methods in a couple of image-stream classes.
Also, move a few `DecodeStream` field definitions to (ever so slightly) shorten the code.
2026-04-29 13:02:15 +02:00
Calixte Denizet
47f0bdc6a5
Use Istanbul instrumentation for unittestcli code coverage 2026-04-29 11:02:51 +02:00
calixteman
08eca5213e
Merge pull request #21187 from calixteman/bug2035551
Fix HCM colors for the views-manager massive unselect button (bug 2035551)
2026-04-28 21:37:08 +02:00
Calixte Denizet
ecd154160d
Fix HCM colors for the views-manager massive unselect button (bug 2035551) 2026-04-28 19:52:53 +02:00
Tim van der Meij
a5382249db
Merge pull request #21178 from calixteman/unittest-coverage-lib
Collect worker-side coverage for browser unit tests
2026-04-28 15:25:14 +02:00
calixteman
30ea3216c9
Merge pull request #21175 from calixteman/bug1942304
Send 'Terminate' to the worker when destroy races the load-time handshake (bug 1942304)
2026-04-28 15:22:20 +02:00
Calixte Denizet
cb8055f0a9
Collect worker-side coverage for browser unit tests 2026-04-28 14:53:14 +02:00
Tim van der Meij
63e8c358df
Merge pull request #21183 from timvandermeij/github-actions-split
Split the unit/font tests into per-browser jobs
2026-04-28 14:38:09 +02:00
Tim van der Meij
c3c834f708
Merge pull request #21182 from mozilla/dependabot/github_actions/actions/setup-node-6.4.0
Bump actions/setup-node from 6.3.0 to 6.4.0
2026-04-28 14:31:54 +02:00
Tim van der Meij
485dcb7b2c
Split the unit/font tests into per-browser jobs
This commit mirrors the approach from e656b833 to the other workflows
that run multiple OS/browser combinations. This approach has multiple
advantages:

- it improves performance because each job is run in its own environment
  so we don't have two browsers competing for resources in the same
  environment anymore;
- it improves monitoring because each job is shown separately, with its
  own runtime, in e.g. the pull request checks and actions overviews,
  which makes it easier to spot bottlenecks that are specific to a
  certain OS/browser combination and enable follow-up optimizations.
2026-04-28 14:19:45 +02:00
dependabot[bot]
6ca196c69d
Bump actions/setup-node from 6.3.0 to 6.4.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](53b83947a5...48b55a011b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 12:15:33 +00:00
Tim van der Meij
e66fdfb6db
Merge pull request #21179 from calixteman/split_unit_test-per_browser
Split integration tests into per-browser jobs
2026-04-28 13:15:00 +02:00
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
e656b8336f
Split integration tests into per-browser jobs 2026-04-27 22:24:22 +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
Calixte Denizet
cffb19e266 Send 'Terminate' to the worker when destroy races the load-time handshake (bug 1942304)
If `PDFDocumentLoadingTask.destroy` ran while `workerIdPromise` was
pending, the inner `.then` in `getDocument` threw "Loading aborted"
before `WorkerTransport` was constructed, so `_transport` was never set
and the "Terminate" message was never posted.
2026-04-27 17:14:45 +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