Closed Bug 1931188 Opened 28 days ago Closed 20 days ago

Update PDF.js to new version 9bf9bbda0b828f528679a981eb416b805880460e from 2024-11-13 08:19:05

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1932543
Tracking Status
firefox134 --- affected

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

(Whiteboard: [3pl-filed][task_id: Mr3kQ_9YSuKMeHIngUr0KQ])

Attachments

(1 obsolete file)

This update covers 14 commits. Here are the overall diff statistics, and then the commit information.


taskcluster/kinds/fetch/toolchains.yml | 2 +-
toolkit/components/pdfjs/content/build/pdf.mjs | 53 +-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 3768 ++++++------
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 6 +-
toolkit/components/pdfjs/content/web/viewer.css | 5 +
toolkit/components/pdfjs/content/web/viewer.mjs | 6 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
8 files changed, 1916 insertions(+), 1932 deletions(-)


913738644a4dacc55190b4b5d7a89bcaf1b21900 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/913738644a4dacc55190b4b5d7a89bcaf1b21900
Authored: 2024-11-12 20:49:27 +0100
Committed: 2024-11-12 20:59:01 +0100

Use Python 3.13 in the GitHub workflows

Python 3.13 is the current version and was released over a month ago
(see https://devguide.python.org/versions). The dependencies we use now
support Python 3.13, most importantly fonttools which uses OS-specific
builds and for which compatibility got introduced in
https://github.com/fonttools/fonttools/pull/3656 and the corresponding
cp313 wheels for all distributions are published on
https://pypi.org/project/fonttools/#files.

Moreover, we fix forgotten npx usage in the font tests README which
was encountered while testing this patch.

Files Modified:

  • .github/workflows/fluent_linter.yml
  • .github/workflows/font_tests.yml
  • test/font/README.md

cfbbf61dd988f9eeeea0a3817da19e156435ca8e by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/cfbbf61dd988f9eeeea0a3817da19e156435ca8e
Authored: 2024-11-12 20:23:27 +0100
Committed: 2024-11-12 20:36:16 +0100

Update translations to the most recent versions

Files Modified:

  • l10n/es-ES/viewer.ftl
  • l10n/eu/viewer.ftl
  • l10n/fi/viewer.ftl
  • l10n/gn/viewer.ftl
  • l10n/hr/viewer.ftl
  • l10n/hu/viewer.ftl
  • l10n/it/viewer.ftl
  • l10n/ja/viewer.ftl
  • l10n/kk/viewer.ftl
  • l10n/nb-NO/viewer.ftl
  • l10n/nn-NO/viewer.ftl
  • l10n/pa-IN/viewer.ftl
  • l10n/pt-PT/viewer.ftl
  • l10n/sl/viewer.ftl
  • l10n/sq/viewer.ftl
  • l10n/tr/viewer.ftl
  • l10n/uk/viewer.ftl

499fab998e056e0880762c4a84176b32170cdbf2 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/499fab998e056e0880762c4a84176b32170cdbf2
Authored: 2024-11-12 20:26:32 +0100
Committed: 2024-11-12 20:35:50 +0100

Upgrade eslint to version 9

This is unblocked now that all dependencies have been updated and the
flat configuration format (compatible with ESLint 8 and 9) was
introduced first. The following deprecation warnings during npm install are resolved by this upgrade:

npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

Note that according to https://eslint.org/version-support ESLint 8 is
officially EOL now, and ESLint 9 has been released for over seven
months and is the only officially supported version.

Fixes #17928.

Files Modified:

  • package-lock.json
  • package.json

cdb32dae459173918dda2ed417ebac98edc16137 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/cdb32dae459173918dda2ed417ebac98edc16137
Authored: 2024-11-12 20:22:27 +0100
Committed: 2024-11-12 20:22:27 +0100

Update dependencies to the most recent versions

Files Modified:

  • package-lock.json
  • package.json

65eedfb0fc6d62cbf46bb1b72ad23f2d6d343982 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/65eedfb0fc6d62cbf46bb1b72ad23f2d6d343982
Authored: 2024-11-12 16:56:54 +0100
Committed: 2024-11-12 17:12:42 +0100

[api-minor] Add a getDocument option to disable ImageDecoder usage

This allows end-users to forcibly disable ImageDecoder usage, even if the browser appears to support it (similar to the pre-existing option for OffscreenCanvas).

Files Modified:

  • src/core/evaluator.js
  • src/core/image_resizer.js
  • src/core/jpeg_stream.js
  • src/core/pdf_manager.js
  • src/display/api.js
  • src/shared/util.js

9e6ff979dbcbdacbebebd8baf9984c34d856fe2b by Nicolò Ribaudo <nribaudo@igalia.com>

https://github.com/mozilla/pdf.js/commit/9e6ff979dbcbdacbebebd8baf9984c34d856fe2b
Authored: 2024-11-12 13:00:27 +0100
Committed: 2024-11-12 16:15:17 +0100

Migrate to ESLint flat config

Flat config is the new config system used by ESLint 9.
To make the migration easier, they also added
flat config support to ESLint 8.

This commit migrates the various ESLint configs in the repository to use
the new system, without upgrading to ESLint 9 yet.

Files Added:

  • eslint.config.mjs

Files Deleted:

  • .eslintignore
  • .eslintrc
  • examples/.eslintrc
  • examples/node/.eslintrc
  • examples/webpack/.eslintrc
  • external/.eslintrc
  • test/.eslintrc
  • test/fuzz/.eslintrc
  • test/integration/.eslintrc
  • test/unit/.eslintrc

Files Modified:

  • gulpfile.mjs
  • package-lock.json
  • package.json
  • src/core/image_resizer.js
  • src/core/jpeg_stream.js

4bf77870848f75dcd38fea55351c739572629f25 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/4bf77870848f75dcd38fea55351c739572629f25
Authored: 2024-11-10 20:54:42 +0100
Committed: 2024-11-12 10:59:38 +0100

Simplify saving added/modified annotations.

Having this map to collect the different changes will allow to know if some objects have already been modified.

Files Modified:

  • src/core/annotation.js
  • src/core/document.js
  • src/core/primitives.js
  • src/core/struct_tree.js
  • src/core/worker.js
  • src/core/writer.js
  • test/unit/annotation_spec.js
  • test/unit/writer_spec.js

92b7374aad26cf7573cc317cd8b67db5c17c5e81 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/92b7374aad26cf7573cc317cd8b67db5c17c5e81
Authored: 2024-11-11 17:58:36 +0100
Committed: 2024-11-11 18:55:56 +0100

Disable ref test 'issue18896' for Chrome because it takes too much time

Files Modified:

  • test/driver.js
  • test/test_manifest.json

79e1f155ac2118979e6c17ca119efd97f8f44058 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/79e1f155ac2118979e6c17ca119efd97f8f44058
Authored: 2024-11-11 15:38:12 +0100
Committed: 2024-11-11 15:53:07 +0100

Apply gradient when stroking text

It fixes #19022.

I noticed that the glyph contours weren't correct (for T and x) and
because we forgot to close the contour.

Files Added:

  • test/pdfs/issue19022.pdf.link

Files Modified:

  • src/display/canvas.js
  • src/display/font_loader.js
  • test/test_manifest.json

16e86878d2ff7f84548a601dc92cb17b65508485 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/16e86878d2ff7f84548a601dc92cb17b65508485
Authored: 2024-11-11 11:56:47 +0100
Committed: 2024-11-11 11:57:28 +0100

Add a PartialEvaluator helper for fetching CMap and Standard Font data

This avoids a little bit of code duplication, which cannot hurt.

Files Modified:

  • src/core/evaluator.js

0b864ee7d542baefccfd552a864c89b950a206df by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/0b864ee7d542baefccfd552a864c89b950a206df
Authored: 2024-11-10 16:27:19 +0100
Committed: 2024-11-10 16:30:07 +0100

Shorten the Page.prototype.userUnit getter slightly

Files Modified:

  • src/core/document.js

ca3b777b89138d038ee6f386566fd0a20f755405 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/ca3b777b89138d038ee6f386566fd0a20f755405
Authored: 2024-11-09 22:30:41 +0100
Committed: 2024-11-09 22:30:50 +0100

Set the padding of the buttons in the toolbars to zero

It fixes #19008.
In Firefox on mac, the default padding is set to 4px and with Firefox for iOS, it's set to 13px.
The padding is useless for such buttons.

Files Modified:

  • web/annotation_editor_layer_builder.css
  • web/viewer.css

9b62f2e7d1086a3febe0027aa02b0e9daf876abe by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/9b62f2e7d1086a3febe0027aa02b0e9daf876abe
Authored: 2024-11-09 12:58:18 +0100
Committed: 2024-11-09 18:51:32 +0100

Polyfill ImageData in Node.js environments

Given that ImageData has been supported for many years in all browsers, see MDN, we have a typeof check that's only necessary in Node.js environments.
Since the @napi-rs/canvas package provides that functionality, we can thus add an ImageData polyfill which allows us to ever so slightly simplify the code.

Files Modified:

  • src/display/canvas.js
  • src/display/node_utils.js

86f943ca033c059b72f7dacfbd999f27efb01e9e by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/86f943ca033c059b72f7dacfbd999f27efb01e9e
Authored: 2024-11-08 11:29:24 +0100
Committed: 2024-11-09 18:51:29 +0100

[api-minor] Replace the canvas package with @napi-rs/canvas

The @napi-rs/canvas package has fewer dependencies, which should hopefully make installing and using it easier for pdfjs-dist end-users. (Over the years we've seen, repeatedly, that canvas can be difficult to install successfully.)
Furthermore, this package includes more functionality (such as Path2D) which reduces the overall number of dependencies in the PDF.js project.

One point to note is that @napi-rs/canvas is a fair bit newer than canvas, and has a lot fewer users, however looking at the commit history it does seem to be actively maintained.

Note that I've successfully tested the Node.js examples, in particular the pdf2png one, with this patch applied and things appear to work fine.

Please see:

Files Modified:

  • README.md
  • examples/node/pdf2png/README.md
  • examples/node/pdf2png/pdf2png.mjs
  • gulpfile.mjs
  • package-lock.json
  • package.json
  • src/display/node_utils.js

Assignee: nobody → update-bot
Status: NEW → ASSIGNED

All the jobs in the try run succeeded. Like literally all of them, there weren't
even any intermittents. That is pretty surprising to me, so maybe you should double
check to make sure I didn't misinterpret things and that the correct tests ran...

Anyway, I've done all I can, so I'm passing to you to review and land the patch.
When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.

Assignee: update-bot → cdenizet

This bug is being closed because a newer revision of the library is available.
This bug will be marked as a duplicate of it (because although this bug is older, it is superseded by the newer one).

Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Duplicate of bug: 1932543
Resolution: --- → DUPLICATE
Attachment #9437517 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: