Closed Bug 1885306 Opened 7 months ago Closed 7 months ago

Update PDF.js to new version 30e69956db3110b4a14d24af9f3ee74ae1ea03a7 from 2024-03-12 17:24:37

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

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


toolkit/components/pdfjs/content/PdfJsDefaultPreferences.sys.mjs | 1 +
toolkit/components/pdfjs/content/build/pdf.mjs | 505 +++++++--
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 77 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 89 +-
toolkit/components/pdfjs/content/web/viewer.css | 242 ++++-
toolkit/components/pdfjs/content/web/viewer.html | 16 +-
toolkit/components/pdfjs/content/web/viewer.mjs | 108 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
toolkit/locales/en-US/toolkit/pdfviewer/viewer.ftl | 9 +
10 files changed, 787 insertions(+), 268 deletions(-)


b4267cd2947a132df370afa507df5a96c983a204 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/b4267cd2947a132df370afa507df5a96c983a204
Authored: 2024-02-26 19:12:34 +0100
Committed: 2024-03-12 15:06:46 +0100

[Editor] Add a floating button close to the selected text to highlight it (bug 1867742)

For now keep this feature behind a pref in order to make some experiments before
deciding to enable it.

Files Modified:

  • extensions/chromium/preferences_schema.json
  • l10n/en-US/viewer.ftl
  • src/display/editor/toolbar.js
  • src/display/editor/tools.js
  • test/integration/highlight_editor_spec.mjs
  • web/annotation_editor_layer_builder.css
  • web/app.js
  • web/app_options.js
  • web/pdf_viewer.js

70b6ddc5d967249d6082aa8116d65770da860546 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/70b6ddc5d967249d6082aa8116d65770da860546
Authored: 2024-03-05 17:25:36 +0100
Committed: 2024-03-12 13:18:15 +0100

Move the /SetOCGState handling into the OptionalContentConfig class (PR 15377 follow-up)

This helps ensure that /SetOCGState actions always take the Usage dictionary into account as expected.

Files Modified:

  • src/display/optional_content_config.js
  • web/pdf_link_service.js

3c78ff5fb06c2f3285ece6c0a3d1b521d7d5d9f0 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/3c78ff5fb06c2f3285ece6c0a3d1b521d7d5d9f0
Authored: 2024-02-25 14:12:36 +0100
Committed: 2024-03-12 13:18:15 +0100

[api-minor] Implement basic support for OptionalContent Usage dicts (issue 5764, bug 1826783)

The following are some highlights of this patch:

  • In the Worker we only extract a subset of the potential contents of the Usage dictionary, to avoid having to implement/test a bunch of code that'd be completely unused in the viewer.

  • In order to still allow the user to manually override the default visible layers in the viewer, the viewable/printable state is purposely not enforced during initialization in the OptionalContentConfig constructor.

  • Printing will now always use the default visible layers, rather than using the same state as the viewer (as was the case previously).
    This ensures that the printing-output will correctly take the Usage dictionary into account, and in practice toggling of visible layers rarely seem to be necessary except in the viewer itself (if at all).[1]


[1] In the unlikely case that it'd ever be deemed necessary to support fine-grained control of optional content visibility during printing, some new (additional) UI would likely be needed to support that case.

Files Added:

Files Modified:

  • src/core/catalog.js
  • src/display/api.js
  • src/display/optional_content_config.js
  • test/driver.js
  • test/test_manifest.json
  • web/app.js
  • web/firefox_print_service.js
  • web/firefoxcom.js
  • web/pdf_layer_viewer.js
  • web/pdf_print_service.js
  • web/pdf_thumbnail_viewer.js
  • web/pdf_viewer.js

f676c2c0c8fa53e74ef2d8174802b519a30067ae by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/f676c2c0c8fa53e74ef2d8174802b519a30067ae
Authored: 2024-03-11 14:05:28 +0100
Committed: 2024-03-11 14:21:43 +0100

[Editor] Improve the accessibility of the highlight editor (bug 1881743)

Files Modified:

  • src/display/draw_layer.js
  • src/display/editor/color_picker.js
  • src/display/editor/highlight.js
  • src/display/editor/toolbar.js
  • src/display/editor/tools.js
  • web/annotation_editor_layer_builder.css

ea4b55a0e6cb82bc4fae948ac42f73ab46ff7ef7 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/ea4b55a0e6cb82bc4fae948ac42f73ab46ff7ef7
Authored: 2024-02-22 13:24:20 +0100
Committed: 2024-03-08 10:09:51 +0100

Update l10n files

Files Modified:

  • l10n/br/viewer.ftl
  • l10n/es-ES/viewer.ftl
  • l10n/eu/viewer.ftl
  • l10n/gl/viewer.ftl
  • l10n/it/viewer.ftl
  • l10n/nb-NO/viewer.ftl
  • l10n/pt-PT/viewer.ftl
  • l10n/sl/viewer.ftl
  • l10n/th/viewer.ftl
  • l10n/uk/viewer.ftl

2b407990e22765e76c7d1de0a2808ec31f0691ea by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/2b407990e22765e76c7d1de0a2808ec31f0691ea
Authored: 2024-02-22 13:24:12 +0100
Committed: 2024-03-08 10:08:15 +0100

Use the Fetch API to download the l10n files

Given that the Fetch API is supported since Node.js 18 we should be able to use it when downloading l10n files, which allows us to simplify the code and to make it fully async.

Files Modified:

  • external/importL10n/locales.mjs

0f8dda1af041e7d90ce134bded1db8016b658204 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/0f8dda1af041e7d90ce134bded1db8016b658204
Authored: 2024-03-07 18:24:34 +0100
Committed: 2024-03-07 18:24:34 +0100

[Editor] Make sure the alt-text button is there when pasting an image from an other tab

Files Modified:

  • src/display/editor/stamp.js
  • test/integration/stamp_editor_spec.mjs

39aeea3e948e392dec0234a7f512ee2c5cbe3b12 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/39aeea3e948e392dec0234a7f512ee2c5cbe3b12
Authored: 2024-03-06 22:38:25 +0100
Committed: 2024-03-07 13:16:59 +0100

[Editor] Add a toggle button to show/hide all the highlights (bug 1867740)

Files Added:

  • web/toggle_button.css

Files Modified:

  • l10n/en-US/viewer.ftl
  • src/display/draw_layer.js
  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/editor.js
  • src/display/editor/highlight.js
  • src/display/editor/tools.js
  • src/shared/util.js
  • test/integration/highlight_editor_spec.mjs
  • web/annotation_editor_layer_builder.css
  • web/annotation_editor_params.js
  • web/viewer.html
  • web/viewer.js

dab8a2eaa4b988f1c13642160df22c303969e9d9 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/dab8a2eaa4b988f1c13642160df22c303969e9d9
Authored: 2024-02-23 13:28:47 +0100
Committed: 2024-02-23 13:32:04 +0100

Combine a few lines in the dist-pre target (PR 17681 follow-up)

In PR 17681 I completely missed that we can combine a number of lines in the dist-pre target, which helps reduce code size a little bit.

Files Modified:

  • gulpfile.mjs

db2849cc173ee5037000378453766137dbb6a1e6 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/db2849cc173ee5037000378453766137dbb6a1e6
Authored: 2024-02-22 16:50:13 +0100
Committed: 2024-02-22 16:50:13 +0100

Use fs/promises in the Node.js-specific code in the src/-folder

This is available in all Node.js versions that we currently support, and using it allows us to remove callback-functions; please see https://nodejs.org/docs/latest-v18.x/api/fs.html#promises-api

Files Modified:

  • src/display/node_stream.js
  • src/display/node_utils.js

38004b65b14ba459b4369788f149f497d6dd26a3 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/38004b65b14ba459b4369788f149f497d6dd26a3
Authored: 2024-02-20 10:50:28 +0100
Committed: 2024-02-20 18:38:18 +0100

Re-factor how the compatibilityParams, in the viewer, are handled

Previously we'd simply export this directly from web/app_options.js, which meant that it'd be technically possible to accidentally modify the compatibilityParams Object when accessing it.
To avoid this we instead introduce a new AppOptions-method that is used to lookup data in compatibilityParams, which means that we no longer need to export this Object.

Based on these changes, it's now possible to simplify some existing code in AppOptions by taking full advantage of the nullish coalescing (??) operator.

Files Modified:

  • web/app_options.js
  • web/pdf_page_view.js

90b26646222df2e6092477e946cd9b3cc70f9fbf by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/90b26646222df2e6092477e946cd9b3cc70f9fbf
Authored: 2024-02-19 12:39:11 +0100
Committed: 2024-02-20 18:38:15 +0100

Add better validation for the "PREFERENCE" kind AppOptions

Given that the "PREFERENCE" kind is used e.g. to generate the preference-list for the Firefox PDF Viewer, those options need to be carefully validated.
With this patch we'll now check this unconditionally in development mode, during testing, and when creating the preferences in the gulpfile.

Files Added:

  • test/unit/app_options_spec.js

Files Modified:

  • gulpfile.mjs
  • test/unit/clitests.json
  • test/unit/jasmine-boot.js
  • web/app_options.js
  • web/preferences.js

Assignee: nobody → update-bot
Status: NEW → ASSIGNED
Pushed by cdenizet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5804e635dd1e Update PDF.js to 30e69956db3110b4a14d24af9f3ee74ae1ea03a7 r=fluent-reviewers,flod,calixte

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
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Regressions: 1886959
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: