Closed Bug 1850112 Opened 6 months ago Closed 6 months ago

Update PDF.js to new version 598421b11f067dacfb2cf81897c19b10db3c9988 from 2023-08-24 13:58:32


(Firefox :: PDF Viewer, enhancement)




119 Branch
Tracking Status
firefox118 --- wontfix
firefox119 --- fixed


(Reporter: update-bot, Assigned: calixte)


(Blocks 2 open bugs)


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


(1 file)

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

toolkit/components/pdfjs/content/build/pdf.js | 109 ++++----------
toolkit/components/pdfjs/content/build/pdf.scripting.js | 6 +-
toolkit/components/pdfjs/content/build/pdf.worker.js | 49 +-----
toolkit/components/pdfjs/content/web/viewer-geckoview.js | 6 +-
toolkit/components/pdfjs/content/web/viewer.html | 2 +-
toolkit/components/pdfjs/content/web/viewer.js | 6 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
7 files changed, 53 insertions(+), 129 deletions(-)

24b480fabe152b0d38d448eb6b963eb5de933c47 by Calixte Denizet
Authored: 2023-08-23 16:00:52 -0400
Committed: 2023-08-24 09:10:27 -0400

Don't reset all fields when the resetForm argument is an array

correctly set the readonly property in the annotation layer and set the default checkbox value to Off when none is provided.

Files Added:

  • test/pdfs/

Files Modified:

  • src/core/annotation.js
  • src/display/annotation_layer.js
  • src/scripting_api/doc.js
  • test/integration/scripting_spec.js
  • test/test_manifest.json

ee3ac35e0553f5614c58a76952da451a35529466 by Calixte Denizet
Authored: 2023-08-23 11:14:29 -0400
Committed: 2023-08-23 12:34:41 -0400

Revert fix for bug 1838855 (bug 1849876)

The issue described in the mentioned bug is reall because
Acrobat is rendering the XFA instead of the Acroform.
The original patch just tried to workaround the issue but it
induces some regressions.

Files Modified:

  • src/core/annotation.js
  • src/core/document.js
  • src/display/annotation_layer.js
  • test/integration/annotation_spec.js
  • test/unit/api_spec.js

89779b3f6c51b8867f39a6a8b9ed6b8accbcf179 by Jonas Jenwald
Authored: 2023-08-23 11:22:25 +0200
Committed: 2023-08-23 11:22:25 +0200

Add the .mjs file-extension to the EditorConfig

Given that this file-extension is used for JavaScript modules, those files should obviously be formatted just like any "normal" JS file.

Files Modified:

  • .editorconfig

de52c98ddf32b59535b742a27906ffdeca0a718b by Jonas Jenwald
Authored: 2023-08-22 10:05:21 +0200
Committed: 2023-08-22 10:05:21 +0200

Add the "aria-controls" attribute to the StampEditor toolbar-button

Given that the other Editor toolbar-buttons use this attribute, it seems that the StampEditor should as well.

Files Modified:

  • web/viewer.html

cd181eb74632789a6c64b10d56b01ec5eddbaa04 by Jonas Jenwald
Authored: 2023-08-21 10:07:25 +0200
Committed: 2023-08-21 10:15:04 +0200

Exclude lineEndings, in Annotation-data, in MOZCENTRAL builds (PR 14899 follow-up)

This was added in PR 14899, over a year ago, however it's still completely unused in the PDF.js library/viewer. In hindsight I think that it was a mistake to add unused functionality, and the issue should probably have been WONTFIXed instead, however we probably can't just remove it now.
Thanks to the pre-processor, we can at least exclude this code in the built-in Firefox PDF Viewer.

Files Modified:

  • src/core/annotation.js

988ce2820ba2085ed8d21413abc100970dafefe1 by Jonas Jenwald
Authored: 2023-08-19 16:18:38 +0200
Committed: 2023-08-19 16:18:38 +0200

Initialize the PDFWorker.#workerPorts WeakMap lazily

By default this WeakMap isn't needed, and it's simple enough to initialize it lazily instead.

Files Modified:

  • src/display/api.js

2993c7725b48baed5010d8531500bc33b17b2881 by Jonas Jenwald
Authored: 2023-08-19 15:52:00 +0200
Committed: 2023-08-19 15:52:00 +0200

[Firefox] Exclude more workerPort related code in MOZCENTRAL builds

Given that this code is (and has always been) unused in the Firefox PDF Viewer, we don't need to include it in that build-target.

Files Modified:

  • src/display/api.js

d762986bb09b172c907ac17c93a49a6f5cae1839 by Jonas Jenwald
Authored: 2023-08-19 09:15:20 +0200
Committed: 2023-08-19 09:30:41 +0200

Update l10n files

Files Modified:

  • l10n/be/
  • l10n/cs/
  • l10n/cy/
  • l10n/da/
  • l10n/de/
  • l10n/dsb/
  • l10n/en-GB/
  • l10n/eo/
  • l10n/es-AR/
  • l10n/es-CL/
  • l10n/fi/
  • l10n/fr/
  • l10n/fy-NL/
  • l10n/gn/
  • l10n/he/
  • l10n/hsb/
  • l10n/hu/
  • l10n/ia/
  • l10n/is/
  • l10n/it/
  • l10n/ja/
  • l10n/ka/
  • l10n/kk/
  • l10n/ko/
  • l10n/nl/
  • l10n/pl/
  • l10n/pt-BR/
  • l10n/pt-PT/
  • l10n/rm/
  • l10n/ru/
  • l10n/sc/
  • l10n/sk/
  • l10n/sl/
  • l10n/sv-SE/
  • l10n/tg/
  • l10n/uk/
  • l10n/vi/
  • l10n/zh-CN/
  • l10n/zh-TW/

4d19db0b1939230b92826a22945a475f694ff52a by Jonas Jenwald
Authored: 2023-08-19 09:08:54 +0200
Committed: 2023-08-19 09:30:34 +0200

Re-format the code to account for prettier and globals updates

The prettier update slightly changed the formatting of some await-expressions; please see

The globals update removed the need for some eslint-disable statements; please see

Files Modified:

  • src/core/document.js
  • src/core/writer.js
  • test/unit/pdf_find_controller_spec.js
  • web/pdf_link_service.js

c5ebfa51a798df41a7fe801996c7e0429ce5766c by Jonas Jenwald
Authored: 2023-08-19 09:08:11 +0200
Committed: 2023-08-19 09:08:11 +0200

Update npm packages

Files Modified:

  • gulpfile.mjs
  • package-lock.json
  • package.json

d513899fc78ac512b96d11d86f4b83cbc13a0839 by Jonas Jenwald
Authored: 2023-08-17 09:11:30 +0200
Committed: 2023-08-17 09:25:58 +0200

Update the StampEditor.isEmpty method to handle File (PR 16828 follow-up)

After the changes in PR 16828 the StampEditor can now be initialized with a File, in addition to a URL, hence it seems that the isEmpty method ought to take that property into account as well.

Looking at this I also noticed that the assignment in the constructor may cause the this.#bitmapUrl/this.#bitmapFile fields be undefined which "breaks" the comparisons in the isEmpty method.
We could obviously fix those specific cases, but it seemed overall safer (with future changes) to just update the isEmpty method to be less sensitive to exactly how these fields are initialized and reset.

Files Modified:

  • src/display/editor/stamp.js

df9cb772d9ad04b73acd8e593ee24766b2c5b4bb by Jonas Jenwald
Authored: 2023-08-16 09:58:13 +0200
Committed: 2023-08-17 08:36:07 +0200

Add a helper method to reduce duplication in StampEditor.#getBitmap

Currently we're repeating virtually the same code four times when fetching the bitmap-data, which seems unnecessary.

Also, ensure that the #bitmapPromise is always nulled by moving that into the StampEditor.#getBitmapDone method.

Files Modified:

  • src/display/editor/stamp.js

2422492ee35cb1e40a979dea473000436be955b5 by Jonas Jenwald
Authored: 2023-08-15 12:13:36 +0200
Committed: 2023-08-15 12:45:54 +0200

Add a unit-test for the "correct" way of using the global workerPort in parallel (PR 16830 follow-up)

Please note that for performance reasons it's not really advised to use the same worker-thread in parallel for parsing multiple PDF documents, since they will then unnecessarily compete for resources.
However, given that it's still possible to do that e.g. when using the global workerPort it probably won't hurt to add a unit-test for this particular situation.

Files Modified:

  • test/unit/api_spec.js

Assignee: nobody → update-bot

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
Pushed by
Update PDF.js to 598421b11f067dacfb2cf81897c19b10db3c9988 r=pdfjs-reviewers,calixte
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.