23351 Commits

Author SHA1 Message Date
Tim van der Meij
1b48daa461
Merge pull request #21614 from mozilla/dependabot/github_actions/github/codeql-action/autobuild-4.37.0
Bump github/codeql-action/autobuild from 4.36.3 to 4.37.0
2026-07-21 20:10:19 +02:00
Tim van der Meij
2bdd9e3d9c
Merge pull request #21613 from mozilla/dependabot/github_actions/github/codeql-action/init-4.37.0
Bump github/codeql-action/init from 4.36.3 to 4.37.0
2026-07-21 20:10:05 +02:00
Tim van der Meij
34268e38fc
Merge pull request #21611 from mozilla/dependabot/github_actions/github/codeql-action/analyze-4.37.0
Bump github/codeql-action/analyze from 4.36.3 to 4.37.0
2026-07-21 20:09:53 +02:00
Tim van der Meij
876ec4bd96
Merge pull request #21612 from mozilla/dependabot/github_actions/actions/setup-node-7.0.0
Bump actions/setup-node from 6.4.0 to 7.0.0
2026-07-21 20:06:47 +02:00
Calixte Denizet
f0bbfa6f9e Preserve indirect AcroForm resources 2026-07-21 19:41:45 +02:00
Jonas Jenwald
69e26ad319 Re-use the NS_DATASETS constant more in the src/core/xfa/bind.js file 2026-07-21 16:04:24 +02:00
dependabot[bot]
cfb92313fa
Bump github/codeql-action/autobuild from 4.36.3 to 4.37.0
Bumps [github/codeql-action/autobuild](https://github.com/github/codeql-action) from 4.36.3 to 4.37.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](54f647b7e1...99df26d4f1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 12:16:47 +00:00
dependabot[bot]
569bae5900
Bump github/codeql-action/init from 4.36.3 to 4.37.0
Bumps [github/codeql-action/init](https://github.com/github/codeql-action) from 4.36.3 to 4.37.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](54f647b7e1...99df26d4f1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 12:15:32 +00:00
dependabot[bot]
6509517da3
Bump actions/setup-node from 6.4.0 to 7.0.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.4.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](48b55a011b...8207627860)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 12:14:16 +00:00
dependabot[bot]
f97e61a7a2
Bump github/codeql-action/analyze from 4.36.3 to 4.37.0
Bumps [github/codeql-action/analyze](https://github.com/github/codeql-action) from 4.36.3 to 4.37.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](54f647b7e1...99df26d4f1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 12:14:00 +00:00
Jonas Jenwald
028c02f539
Merge pull request #21607 from Snuffleupagus/viewerPreferences-Map
[api-minor] Convert `getViewerPreferences` to return data in a Map
2026-07-20 22:14:55 +02:00
Tim van der Meij
d314788368
Merge pull request #21604 from calixteman/issue21593
Copy the backdrop for non-isolated groups with a soft mask
2026-07-20 20:00:28 +02:00
Tim van der Meij
1a1090a0ae
Merge pull request #21602 from timvandermeij/updates
Update dependencies to the most recent versions
2026-07-20 19:53:39 +02:00
Tim van der Meij
559ab148a9
Merge pull request #21603 from timvandermeij/gitattributes
Update the file format entries in `.gitattributes`
2026-07-20 19:53:15 +02:00
calixteman
997dabf5a9
Merge pull request #21606 from calixteman/fix/ambiguous-date-format
Fix parsing of ambiguous date formats like `Hm`
2026-07-20 17:05:01 +02:00
Jonas Jenwald
67ed457bb8 Bump library version to 6.2
See commit eddd70a2ca1054ad2e0792972c3f2774b89f0cd2
2026-07-20 16:52:39 +02:00
Jonas Jenwald
de3eecca11 [api-minor] Convert getViewerPreferences to return data in a Map
Compared to regular Objects there's a number of advantages to using Maps:
 - They support proper iteration.
 - They have a simple way to check for the existence of data.
 - They have a simple/efficient way to check the number of elements.

If this functionality was added today, I cannot imagine that we'd choose an Object for this data.
2026-07-20 16:52:36 +02:00
calixteman
09a45ad2af
Merge pull request #21601 from uwezkhan/fix-postscript-wasm-i32const-sleb128
Encode i32.const immediates as signed LEB128 in the PostScript Wasm compiler
2026-07-20 15:29:20 +02:00
Calixte Denizet
d5661f801f Fix parsing of ambiguous date formats like Hm
We support having hours/minutes numbers with one or two digits for strings like "1:30:31" but
if the format is for example Hm, then "12" is really ambiguous.
So the idea is to match the longest string as possible.
2026-07-20 15:23:23 +02:00
uwezkhan
778aa450d9 Encode i32.const immediates as signed LEB128 in the PostScript Wasm compiler
The Type-4 PostScript -> Wasm compiler emitted i32.const immediates with the
unsigned LEB128 encoder (_emitULEB128). Wasm decodes i32.const as a *signed*
LEB128, so any immediate whose final 7-bit group has bit 0x40 set is
mis-decoded (e.g. 64 -> single byte 0x40 -> read back as -64).

The output-store address for the i-th result is emitted as i32.const (i*8).
For a function with >= 9 outputs the 9th offset is 64, which decodes as -64, so
f64.store targets 0xFFFFFFC0 and traps (memory access out of bounds). The module
still validates and instantiates, so the JS fallback in function.js is not
engaged; the trap only surfaces at render time (the affected shading / tint
transform silently fails to render). The same mis-encoding affects the constant
bitshift amount.

Add a signed-LEB128 emitter (_emitSLEB128) and use it for the three i32.const
immediate sites; local/import/type indices remain unsigned (correct). Add a unit
test covering functions with 9+ outputs, and a reference test rendering a shading
whose colour function has 9 outputs.
2026-07-20 14:56:04 +05:30
Jonas Jenwald
cd03276d60
Merge pull request #21594 from Snuffleupagus/issue-21582
Ignore Annotations with `fieldValue = null` when saving (issue 21582)
2026-07-20 11:13:03 +02:00
calixteman
547236bcd5
Merge pull request #21605 from calixteman/followup_21598
Address follow-up review comments in coverage_search.mjs
2026-07-19 23:19:55 +02:00
Jonas Jenwald
ee56dc7719 Ignore Annotations with fieldValue = null when saving (issue 21582)
Some Annotations, e.g. `SignatureWidgetAnnotation`, set `fieldValue = null` which may causing saving to fail during `writeXFADataForAcroform`, hence we simply ignore any such Annotation-data during saving.
2026-07-19 23:00:31 +02:00
calixteman
850020a84e
Address follow-up review comments in coverage_search.mjs
Use a Headers object for the request and log informational progress
messages via console.log instead of console.error.
2026-07-19 21:54:45 +02:00
calixteman
50601d0341
Copy the backdrop for non-isolated groups with a soft mask
PR #21455 drew non-isolated blend-mode groups against their backdrop via a
direct path on the parent canvas, but a soft mask forces the group onto an
intermediate canvas instead. There the inner blend modes composited against
transparency, so e.g. a /Multiply highlight was painted opaquely over the
text behind it, hiding it.

Copy the backdrop into that intermediate canvas so the blends see the real
background. The copy is limited to groups that would otherwise have taken
the direct path (source-over, alpha 1, not knockout/gray) but were displaced
onto the intermediate canvas by the soft mask.

It fixes #21593.
2026-07-19 21:01:28 +02:00
Tim van der Meij
154e82871a
Update the file format entries in .gitattributes
Several extensions (`.coffee`, `.jade`, `.inc` and others) became
obsolete in e.g. the conversion to Wintersmith/Fluent/other tools, while
other new extensions (`.mjs`, `.njk`, `.py` and others) were missing.

This commit removes all obsolete file format entries, adds all missing
ones and orders the list alphatically (so it can more easily be matched
against tooling that lists all in-use file extensions in the repository).
2026-07-19 19:33:10 +02:00
Tim van der Meij
a3a0d5d9a0
Upgrade eslint-plugin-unicorn to version 72.0.0
This is a major version bump, but the changelog at
https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v72.0.0
doesn't indicate any breaking changes that should impact us.
2026-07-19 18:53:34 +02:00
Tim van der Meij
299624a2d3
Update dependencies to the most recent versions 2026-07-19 18:52:20 +02:00
Tim van der Meij
5266f13ea4
Merge pull request #21599 from Snuffleupagus/CompiledFont-rm-hasBuiltPath
Combine the `getPathJs` and `hasBuiltPath` methods in the `CompiledFont` class
2026-07-19 18:39:16 +02:00
Jonas Jenwald
02027ba381 Combine the getPathJs and hasBuiltPath methods in the CompiledFont class
This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular:
 - Given that the path-data is returned as a TypedArray, it's easy enough to instead return `null` to indicate that the glyph was previously compiled.

 - The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds.

 - The `compileFontPathInfo` call is moved into `CompiledFont` class, since that simplifies the `src/core/evaluator.js` code a tiny bit.
2026-07-19 16:48:07 +02:00
calixteman
ee6d5f2102
Merge pull request #21598 from calixteman/use_per_test
Download the per-test coverage index
2026-07-19 16:45:19 +02:00
calixteman
e6c7ab5425
Skip the cache existence check when --no-download is set
Move the `fs.existsSync(indexPath)` check below the `--no-download`
early return: in that mode the check is unused (the read after
refreshIndex already validates existence), so it's wasted disk I/O.
2026-07-19 16:42:05 +02:00
calixteman
c7dc7d7dd0
Sanitize the cached ETag and index to satisfy CodeQL
Address two CodeQL findings on the per-test index downloader:

- "File data in outbound network request": validate the cached ETag
  against the RFC 7232 grammar before sending it as If-None-Match, so
  the cache file's contents can't be injected into the request header.
- "Network data written to file": cache the re-serialized JSON
  (JSON.stringify(JSON.parse(...))) instead of the raw response body,
  so only well-formed JSON produced by our own serializer is written.
2026-07-19 16:13:20 +02:00
Jonas Jenwald
eddd70a2ca
Merge pull request #21597 from Snuffleupagus/destinations-Map
[api-minor] Convert `getDestinations` to return data in a Map
2026-07-19 16:06:12 +02:00
calixteman
d504000012
Download the per-test coverage index
`coverage_search` now fetches `per-test-index.json` from the pdf.js.refs
gh-pages branch, caches it locally, and only re-downloads it (via ETag)
when it changed, so querying which ref tests cover a line/function no
longer needs a local `--coverage-per-test` build. `--no-download` reuses
the cached index offline and `--index` points at a local one.

`browsertest` and `makeref` accept the same `--code` filter to run (or
regenerate refs for) only the covering tests, dropping any covered IDs
that aren't in this branch's manifest so the run isn't rejected.
2026-07-19 15:37:05 +02:00
Tim van der Meij
b83274803c
Merge pull request #21588 from calixteman/fix/pdf-editor-struct-attribute-revisions
Handle revisioned structure attributes
2026-07-19 14:11:08 +02:00
Tim van der Meij
fd77b3ea9f
Merge pull request #21591 from calixteman/fix/pdf-editor-missing-acroform-fields
Rebuild missing AcroForm fields
2026-07-19 14:08:40 +02:00
Tim van der Meij
4f7f3baed4
Merge pull request #21587 from calixteman/smask_in_data
Implement SmaskInData == 2 for JPX images
2026-07-19 13:57:41 +02:00
Tim van der Meij
8c3941a0d5
Merge pull request #21595 from Snuffleupagus/CompiledFont-Maps
Change the `CompiledFont` glyph/charCode caches to use `Map`s
2026-07-19 13:53:12 +02:00
Tim van der Meij
0a3ed983be
Merge pull request #21596 from Snuffleupagus/pattern-bCache-Map
Re-factor the `bCache`, used with /Mesh Shadings
2026-07-19 13:50:44 +02:00
Tim van der Meij
be89d6475d
Merge pull request #21585 from Snuffleupagus/Iterator-join
Start using `Iterator.prototype.join` in the code-base
2026-07-19 13:48:06 +02:00
Tim van der Meij
f12c6f64ad
Merge pull request #21592 from Snuffleupagus/Iterator-helpers
Use Iterator methods to avoid some unnecessary Array creation
2026-07-19 13:46:58 +02:00
Tim van der Meij
e624336b2e
Merge pull request #21590 from Snuffleupagus/canvas-_getPattern-getOrInsertComputed
Use `getOrInsertComputed` in the `CanvasGraphics.prototype._getPattern` method
2026-07-19 13:45:56 +02:00
Jonas Jenwald
6fbd2227db [api-minor] Convert getDestinations to return data in a Map
Compared to regular Objects there's a number of advantages to using Maps:
 - They support proper iteration.
 - They have a simple way to check for the existence of data.
 - They have a simple/efficient way to check the number of elements.

If this functionality was added today, I cannot imagine that we'd choose an Object for this data.
2026-07-19 12:07:08 +02:00
Jonas Jenwald
344736bcad Re-factor the bCache, used with /Mesh Shadings
- Initialize the `bCache` lazily, since many/most PDF documents don't need it.
 - Change the `bCache` to a `Map`, rather than an Object, which thanks to `getOrInsertComputed` allows the `buildB` function to be inlined.

Also, while unrelated here, move the `this.matrix = null;` definition to the `BaseShadingPattern` class to reduce (a tiny bit of) unnecessary duplication.
2026-07-18 14:15:24 +02:00
Jonas Jenwald
b2cf8527c6 Change the CompiledFont glyph/charCode caches to use Maps
This code is old enough that it predates the general availability of `Map`, and these changes allow us to shorten the code a tiny bit.
2026-07-18 11:44:27 +02:00
Jonas Jenwald
47f2b22842 Use Iterator methods to avoid some unnecessary Array creation
Currently there are some spots in the code-base where intermediate Arrays are unnecessarily created from Iterators, before `filter` and `map` is used to create a final Array.
Thanks to newer Iterators methods, see e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter, that can be now be avoided.
2026-07-17 21:23:08 +02:00
Calixte Denizet
922d57631b Rebuild missing AcroForm fields 2026-07-17 13:51:08 +02:00
Jonas Jenwald
0f060e1e64 Use getOrInsertComputed in the CanvasGraphics.prototype._getPattern method 2026-07-17 12:49:29 +02:00
calixteman
dd7e3731d1
Merge pull request #21589 from mozilla/update-locales
l10n: Update locale files
2026-07-17 08:08:07 +02:00