Closed Bug 1881422 Opened 4 months ago Closed 4 months ago

Update PDF.js to new version 72b8b29147c3a19ccacc9db111df4925efcbe1bf from 2024-02-21 09:14:40

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox124 --- fixed
firefox125 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

This update covers 19 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 | 84 +++++++--
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 14 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 7 +
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 63 +++++--
toolkit/components/pdfjs/content/web/viewer.css | 7 +
toolkit/components/pdfjs/content/web/viewer.mjs | 63 +++++--
toolkit/components/pdfjs/moz.yaml | 4 +-
9 files changed, 182 insertions(+), 65 deletions(-)


46416bb131bc35c54e8d2a381f30c7b1e3eff639 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/46416bb131bc35c54e8d2a381f30c7b1e3eff639
Authored: 2024-02-20 09:49:20 +0100
Committed: 2024-02-20 21:29:33 +0100

[Editor] Add the possibility to query some ML stuff to guess an alt text for an image

It's only for an experimental purpose.

Files Modified:

  • extensions/chromium/preferences_schema.json
  • src/display/editor/alt_text.js
  • src/display/editor/editor.js
  • src/display/editor/stamp.js
  • src/display/editor/tools.js
  • web/app.js
  • web/app_options.js
  • web/chromecom.js
  • web/firefoxcom.js
  • web/genericcom.js
  • web/pdf_viewer.js

95f9bedc7c96ef515d84ed28a884a0b6a3decc75 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/95f9bedc7c96ef515d84ed28a884a0b6a3decc75
Authored: 2024-02-20 19:27:54 +0100
Committed: 2024-02-20 21:17:05 +0100

[Editor] Disable annotation layer when highlighting (bug 1868759)

When highlighting, the annotation editor layer is disabled to get pointer events
from the text layer, but the annotation layer must be then disabled either in
order to avoid bad interactions.

Files Added:

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • test/integration/highlight_editor_spec.mjs
  • test/pdfs/.gitignore
  • web/annotation_layer_builder.css

a6eadf8150cb4cf2c867b046111d795b1fe3c8e6 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/a6eadf8150cb4cf2c867b046111d795b1fe3c8e6
Authored: 2024-02-19 09:54:24 +0100
Committed: 2024-02-19 09:55:23 +0100

Avoid to access to a missing cidSystemInfo property

Fixes #17689.

Files Added:

  • test/pdfs/issue17689.pdf.link

Files Modified:

  • src/core/evaluator.js
  • test/test_manifest.json

c2fcc66302d40b39fa20e5a4f814aa6d5f63d64e by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/c2fcc66302d40b39fa20e5a4f814aa6d5f63d64e
Authored: 2024-02-18 19:21:45 +0100
Committed: 2024-02-18 19:21:45 +0100

[Editor] Avoid to scroll when an editor is unselected

Files Modified:

  • src/display/editor/editor.js

673639c54b5df26e3341fc9de085496de03be219 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/673639c54b5df26e3341fc9de085496de03be219
Authored: 2024-02-17 22:09:24 +0100
Committed: 2024-02-17 22:14:37 +0100

Disable source-map generation in the minified builds (PR 17686 follow-up)

As part of the changes in PR 17686 we "accidentally" enabled source-maps for the minified builds, which seems unnecessary since those have never been included in the pdfjs-dist output.
Locally this patch reduces the run-time of gulp minified by ~15 percent.

Files Modified:

  • gulpfile.mjs

091e86153108e70f25442a821778017f0836a8bf by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/091e86153108e70f25442a821778017f0836a8bf
Authored: 2024-02-17 16:18:12 +0100
Committed: 2024-02-17 18:51:34 +0100

Run minification directly during Webpack building

Rather than first building the library and then use Terser "manually" to minify the files, we can utilize a Webpack plugin to combine these steps which helps to simplify the gulpfile.

Files Modified:

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

2e6fa797d94f08eb8438a375ae3b747c2294e598 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/2e6fa797d94f08eb8438a375ae3b747c2294e598
Authored: 2024-02-17 16:12:26 +0100
Committed: 2024-02-17 16:22:10 +0100

Improve the webserver's constructor

This makes the webserver configurable during instantiation rather than
having to set the parameters afterwards.

Files Modified:

  • gulpfile.mjs
  • test/test.mjs
  • test/webserver.mjs

985ba77579fe4f26969b77fbd9d8b4e9e565193c by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/985ba77579fe4f26969b77fbd9d8b4e9e565193c
Authored: 2024-02-11 20:10:27 +0100
Committed: 2024-02-17 16:22:10 +0100

Modernize the remainder of the webserver's code and enable the no-var ESLint rule

This commit also moves the content type logic into a helper method to
ever so slightly reduce duplication.

Files Modified:

  • test/webserver.mjs

0015eb2431e35d58aaa7b44b040ea6e7dcd91ff6 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/0015eb2431e35d58aaa7b44b040ea6e7dcd91ff6
Authored: 2024-02-11 20:03:23 +0100
Committed: 2024-02-17 16:22:10 +0100

Modernize the webserver's handler method

This commit converts var to const/let, gives the variables more
readable names and annotates the code to make the flow clearer.

Files Modified:

  • test/webserver.mjs

6ef813af010c226128189bcf24e57752bc604612 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/6ef813af010c226128189bcf24e57752bc604612
Authored: 2024-02-11 19:55:21 +0100
Committed: 2024-02-17 16:22:10 +0100

Extract and modernize the webserver's request checking code

The handler method contained this code in two inline functions,
triggered via callbacks, which made the handler method big and harder
to read. Moreover, this code relied on variables from the outer scope,
which made it harder to reason about because the inputs and outputs
weren't easily visible.

This commit fixes the problems by extracting the request checking code
into a dedicated private method, and modernizing it to use e.g. const/
let instead of var and using template strings. The logic is now
self-contained in a single method that can be read from top to bottom
without callbacks and with comments annotating each check/section.

Files Modified:

  • test/webserver.mjs

43cdc1ca8a36063c1d86af71ccaeb3c66cb29519 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/43cdc1ca8a36063c1d86af71ccaeb3c66cb29519
Authored: 2024-02-17 15:41:24 +0100
Committed: 2024-02-17 16:00:18 +0100

Update translations to the most recent versions

Files Modified:

  • l10n/cs/viewer.ftl
  • l10n/cy/viewer.ftl
  • l10n/da/viewer.ftl
  • l10n/el/viewer.ftl
  • l10n/eo/viewer.ftl
  • l10n/fur/viewer.ftl
  • l10n/he/viewer.ftl
  • l10n/ja/viewer.ftl
  • l10n/pl/viewer.ftl
  • l10n/rm/viewer.ftl
  • l10n/sk/viewer.ftl
  • l10n/zh-CN/viewer.ftl

6baa439e15d2deb0f5de8b4cb2bbe0d2755bba2d by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/6baa439e15d2deb0f5de8b4cb2bbe0d2755bba2d
Authored: 2024-02-17 15:51:07 +0100
Committed: 2024-02-17 16:00:18 +0100

Update dependencies to the most recent versions

Files Modified:

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

a7bcc81eb188faf83c4ca10c8a8de0a6b67c3595 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/a7bcc81eb188faf83c4ca10c8a8de0a6b67c3595
Authored: 2024-02-16 12:53:09 +0100
Committed: 2024-02-17 13:45:16 +0100

Add a dummy beginMarkedContentProps operator when optional content parsing fails (issue 17679)

Files Added:

  • test/pdfs/issue17679.pdf
  • test/pdfs/issue17679_2.pdf

Files Modified:

  • src/core/evaluator.js
  • src/display/optional_content_config.js
  • test/pdfs/.gitignore
  • test/test_manifest.json

75a5b2051d315b4c24f30841593c1d6e08f6e936 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/75a5b2051d315b4c24f30841593c1d6e08f6e936
Authored: 2024-02-16 16:45:38 +0100
Committed: 2024-02-16 16:54:13 +0100

Tweak the parseMinified handling slightly in the gulpfile

  • Run the minification in "parallel" since that should be a tiny bit more efficient.
  • Don't rename the minified files since that seems unnecessary, especially considering that they are only used in the dist-pre target where we currently change the name back manually.

Files Modified:

  • gulpfile.mjs

751611f690e452f81fe6551617cfb0ee02017503 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/751611f690e452f81fe6551617cfb0ee02017503
Authored: 2024-02-16 11:35:41 +0100
Committed: 2024-02-16 11:42:40 +0100

Remove unneeded tweakWebpackOutput usage in the gulpfile (PR 17637 follow-up)

After the changes in PR 17637 there's no longer any reason to invoke tweakWebpackOutput without an argument, since the __non_webpack_import__ re-writing was moved into the Babel plugin.
This way we can avoid a (little) bit of unnecessary parsing during building.

Files Modified:

  • gulpfile.mjs

b420bd8b2015af971a301e2800755353de304e6c by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/b420bd8b2015af971a301e2800755353de304e6c
Authored: 2024-02-15 11:22:49 +0100
Committed: 2024-02-15 11:25:29 +0100

Access PDFViewerApplication.findBar safely in more spots (PR 15831 follow-up)

Note that this patch is the result of code-inspection, and the code as written doesn't (currently) cause any bugs in e.g. the GeckoView PDF Viewer.

Files Modified:

  • web/app.js

fcad3718f088da91cd2263e26b40309c25242583 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/fcad3718f088da91cd2263e26b40309c25242583
Authored: 2024-02-14 15:12:11 +0100
Committed: 2024-02-14 17:20:04 +0100

Fix the endoffset of the last glyph when it's followed by a null offset in the loca table

It fixes #17671.

Files Added:

  • test/pdfs/issue17671.pdf

Files Modified:

  • src/core/fonts.js
  • test/pdfs/.gitignore
  • test/test_manifest.json

a204f434f39ebabe82221cfcf280710180d9a03f by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/a204f434f39ebabe82221cfcf280710180d9a03f
Authored: 2024-02-13 21:28:02 +0100
Committed: 2024-02-13 21:28:02 +0100

Change PDFPrintServiceFactory.createPrintService to take a parameter object

By "modernizing" the method to use a parameter object instead, we avoid having to pass along the needed parameters individually.

Files Modified:

  • web/app.js
  • web/firefox_print_service.js
  • web/pdf_print_service.js

4ab0ad32167bd1189dead51a565e66772317d571 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/4ab0ad32167bd1189dead51a565e66772317d571
Authored: 2024-02-08 12:13:30 +0100
Committed: 2024-02-12 10:49:43 +0100

Move the __non_webpack_import__ re-writing into the Babel plugin

Note how we're using custom __non_webpack_import__-calls in the code-base, that we replace during the post-processing stage of the build, to be able to write import-calls that Webpack will leave alone during parsing.
This work-around is necessary since we let Babel discards all comments, given that we generally don't need/want them in the builds, hence why we cannot utilize /* webpackIgnore: true */-comments in the source-code.

After the changes in PR 17563 it thus seems to me that we should be able to just move this re-writing into the Babel plugin instead.

Files Modified:

  • external/builder/babel-plugin-pdfjs-preprocessor.mjs
  • external/builder/fixtures_esprima/importalias-expected.js
  • external/builder/fixtures_esprima/importalias.js
  • gulpfile.mjs

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

All jobs completed, we found the following issues.

Known Issues (From Push Health):

  • toolkit/components/pdfjs/test/browser.toml

    • 1 of 4 failed on the same (retriggered) task
      - test-windows11-32-2009-qr/debug-mochitest-browser-chrome-2 (BvZdcAh3TuOgunPsxbOtKg)
  • toolkit/components/pdfjs/test/browser_pdfjs_editing_telemetry.js

    • 1 of 1 failed on the same (retriggered) task
      - test-linux1804-64-qr/opt-mochitest-browser-chrome-spi-nw-8 (CdxQHQV5RFGB5mi96DWazQ)
  • toolkit/components/pdfjs/test/browser_pdfjs_force_opening_files.js

    • 1 of 4 failed on the same (retriggered) task
      - test-linux1804-64-qr/opt-mochitest-browser-chrome-spi-nw-2 (CigcGRlfS6eM1BXk5n994A)
  • toolkit/components/pdfjs/test/browser_pdfjs_form.js

    • 1 of 4 failed on the same (retriggered) task
      - test-windows11-32-2009-qr/debug-mochitest-browser-chrome-2 (BvZdcAh3TuOgunPsxbOtKg)
  • toolkit/components/pdfjs/test/browser_pdfjs_not_default.js

    • 1 of 1 failed on the same (retriggered) task
      - test-linux1804-64-qr/opt-mochitest-browser-chrome-spi-nw-1 (DaApEUa6REm6ZZeUXPrwuw)

Known Issues (From Taskcluster):

  • test-windows11-32-2009-qr/debug-mochitest-browser-chrome-2 (BvZdcAh3TuOgunPsxbOtKg) - new failure not classified

These failures may mean that the library update succeeded; you'll need to review
them yourself and decide. If there are lint failures, you will need to fix them in
a follow-up patch. (Or ignore the patch I made, and recreate it yourself with
./mach vendor toolkit/components/pdfjs/moz.yaml.)

In either event, I have done all I can, so you will need to take it from here.
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 cdenizet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3622293272bc
Update PDF.js to 72b8b29147c3a19ccacc9db111df4925efcbe1bf r=pdfjs-reviewers,calixte
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: