Closed Bug 1831389 Opened 1 year ago Closed 1 year ago

Update PDF.js to new version a24e11a91cb289dded4241fba6818d9cf1bfb100 from 2023-05-04 17:48:57

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox114 --- wontfix
firefox115 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

(Whiteboard: [3pl-filed][task_id: JgWY4c--T5asjRGLIsmTaQ])

Attachments

(1 file)

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


toolkit/components/pdfjs/content/build/pdf.js | 168 +-
toolkit/components/pdfjs/content/build/pdf.scripting.js | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.js | 5473 ++++++++++++-
toolkit/components/pdfjs/content/web/viewer-geckoview.js | 31 +-
toolkit/components/pdfjs/content/web/viewer.css | 77 +-
toolkit/components/pdfjs/content/web/viewer.js | 117 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
7 files changed, 5158 insertions(+), 716 deletions(-)


9dcc50402e421c6f65cb74996db607cb83c8c4a5 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/9dcc50402e421c6f65cb74996db607cb83c8c4a5
Authored: 2023-05-02 14:16:18 +0200
Committed: 2023-05-04 12:51:30 +0200

Simplify the PDFSidebar.#forceRendering method

The fallback code-path has never really been used, since the PDFSidebar is only used in the default viewer (and has never been exposed in e.g. the COMPONENTS-build).

Files Modified:

  • web/pdf_sidebar.js

74c615b5b03a1c2cc8004fd21ae821585220459e by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/74c615b5b03a1c2cc8004fd21ae821585220459e
Authored: 2023-04-30 16:26:44 +0200
Committed: 2023-05-04 12:17:51 +0200

Remove unused canvas clean-up code in PDFThumbnailView.reset (PR 13357 follow-up)

Files Modified:

  • web/pdf_thumbnail_view.js

1b6a83da4a0f32b309df5e1fb4143df7970f1915 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/1b6a83da4a0f32b309df5e1fb4143df7970f1915
Authored: 2023-04-30 11:01:42 +0200
Committed: 2023-05-04 12:17:49 +0200

Simplify the thumbnail styling in the viewer

This patch tries to simplify, and improve, the thumbnail styling:

  • For rendered thumbnails there's one less DOM-element per thumbnail, which can't hurt in longer documents.
  • Use CSS-variables to set the dimensions of all relevant DOM-elements at once.
  • Simplify the visual styling of the thumbnails, e.g. remove the border since the viewer no longer has visible borders around pages, since the relevant CSS-rules are quite old code.
    These changes also, at least in my opinion, makes the relevant CSS-rules much easier to understand and work with.
  • Make it easier to work on e.g. bug 1690428 without affecting the other sidebarViews.

Files Modified:

  • web/pdf_thumbnail_view.js
  • web/viewer.css

24a75bda5d442f930125641117307692d2cf8583 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/24a75bda5d442f930125641117307692d2cf8583
Authored: 2023-05-03 11:49:37 +0200
Committed: 2023-05-03 11:52:54 +0200

Remove the unused isStandardFont font-property (PR 15880 follow-up)

This property was added in PR 12726 specifically for use in the getFontType function, indirectly used by the PDFDocumentProxy.stats getter in the API.
In PR 15880 that functionality was removed, but I forgot to remove this now unused font-property.

Files Modified:

  • src/core/evaluator.js

c07149a44f0e1adb45ff0fcb02f7441fdd88fd6d by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/c07149a44f0e1adb45ff0fcb02f7441fdd88fd6d
Authored: 2023-05-02 16:37:49 +0200
Committed: 2023-05-03 10:19:59 +0200

Apply HCM filters on annotations which have their own canvas (bug 1830850)

Files Modified:

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

c8246b072005b31562578f6ce6c565541e42fa2a by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/c8246b072005b31562578f6ce6c565541e42fa2a
Authored: 2023-04-30 22:32:13 +0200
Committed: 2023-04-30 22:32:13 +0200

Re-factor the PDFViewer.pageViewsReady getter slightly

Files Modified:

  • web/pdf_viewer.js

88616f77aec785fe7f2bad36026e8118a775a2af by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/88616f77aec785fe7f2bad36026e8118a775a2af
Authored: 2023-04-21 21:16:57 +0200
Committed: 2023-04-29 13:49:39 +0200

Remove the closure from BitModel in the src/core/jpx.js file

Files Modified:

  • src/core/jpx.js

b0a1af306da6ef5bf1aa9b567b15c21fcec6fb22 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/b0a1af306da6ef5bf1aa9b567b15c21fcec6fb22
Authored: 2023-03-15 12:20:41 +0100
Committed: 2023-04-29 13:49:38 +0200

Simplify initialization of static class properties in the worker-thread

Now that we no longer depend on the old Babel version in SystemJS we can remove the static get ... work-arounds used to define constants, which leads to slightly more compact code.

Files Modified:

  • src/core/evaluator.js
  • src/core/function.js
  • src/core/image_utils.js
  • src/core/operator_list.js
  • src/core/pattern.js
  • src/display/pattern_helper.js

d950b91c4eb1cbeb10a258981d08d39d902f9692 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/d950b91c4eb1cbeb10a258981d08d39d902f9692
Authored: 2022-07-17 11:24:05 +0200
Committed: 2023-04-29 13:49:37 +0200

Introduce some logical assignment in the src/core/ folder

Files Modified:

  • src/core/annotation.js
  • src/core/catalog.js
  • src/core/colorspace.js
  • src/core/core_utils.js
  • src/core/document.js
  • src/core/evaluator.js
  • src/core/fonts.js
  • src/core/operator_list.js
  • src/core/parser.js
  • src/core/pattern.js
  • src/core/pdf_manager.js
  • src/core/primitives.js
  • src/core/ps_parser.js
  • src/core/worker.js
  • src/core/xfa/formcalc_parser.js
  • src/core/xfa/parser.js
  • src/core/xfa/template.js
  • src/core/xfa/utils.js
  • src/display/annotation_layer.js
  • src/display/api.js

317abd6d0795b4b6c32ae8083c488ab5a6227fd2 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/317abd6d0795b4b6c32ae8083c488ab5a6227fd2
Authored: 2022-03-07 17:41:41 +0100
Committed: 2023-04-29 13:43:24 +0200

Change the createPromiseCapability helper function into a PromiseCapability class

This is not only slightly more compact, but it also simplifies the handling of the settled getter.

Files Modified:

  • src/core/chunked_stream.js
  • src/core/evaluator.js
  • src/core/worker.js
  • src/display/api.js
  • src/display/fetch_stream.js
  • src/display/network.js
  • src/display/node_stream.js
  • src/display/text_layer.js
  • src/display/transport_stream.js
  • src/pdf.js
  • src/shared/message_handler.js
  • src/shared/util.js
  • test/driver.js
  • test/unit/api_spec.js
  • test/unit/message_handler_spec.js
  • test/unit/util_spec.js
  • web/app.js
  • web/password_prompt.js
  • web/pdf_attachment_viewer.js
  • web/pdf_document_properties.js
  • web/pdf_find_controller.js
  • web/pdf_outline_viewer.js
  • web/pdf_scripting_manager.js
  • web/pdf_viewer.js

f9c2a8d437d1b3c95088dba2758f99d62d0d2ff1 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/f9c2a8d437d1b3c95088dba2758f99d62d0d2ff1
Authored: 2021-09-17 13:46:47 +0200
Committed: 2023-04-29 13:43:24 +0200

Introduce some optional chaining in the src/shared/ folder

Files Modified:

  • src/shared/fonts_utils.js
  • src/shared/message_handler.js
  • src/shared/util.js

94c2d089751dee63d7ad0da6b6e74856c5019d57 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/94c2d089751dee63d7ad0da6b6e74856c5019d57
Authored: 2020-11-02 11:58:40 +0100
Committed: 2023-04-29 13:43:24 +0200

Revert "Add a getArrayLookupTableFactory helper function and use it to re-format src/core/{glyphlist, unicode}.js"

This reverts commit 56fa6d414cb1115e03f9c1aa9f1d5bc52efcb7ac now that SystemJS is gone.

Files Modified:

  • src/core/core_utils.js
  • src/core/glyphlist.js

95bf9fc17f3827f24f01b223cf1838cfa4666c6f by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/95bf9fc17f3827f24f01b223cf1838cfa4666c6f
Authored: 2020-11-01 23:06:40 +0100
Committed: 2023-04-29 13:43:24 +0200

Remove SystemJS usage, in development mode, from the worker

Now that https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 has landed in Firefox, we're able to use worker-modules during development :-)

This removes the final piece of SystemJS usage from the PDF.js library, thus allowing a fair bit of clean-up, and we now use only native import/export statements everywhere in development mode.

Files Deleted:

  • external/systemjs/plugin-babel-cached.js
  • src/core/.eslintrc
  • src/shared/.eslintrc
  • src/worker_loader.js
  • systemjs.config.js

Files Modified:

  • .eslintrc
  • package-lock.json
  • package.json
  • src/core/unicode.js
  • src/display/api.js
  • web/app.js
  • web/app_options.js

7c1e505f6a557c03be9ba39df87a0c94621bed8f by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/7c1e505f6a557c03be9ba39df87a0c94621bed8f
Authored: 2023-04-28 11:42:19 +0200
Committed: 2023-04-29 10:50:37 +0200

Include the entire git history in the work-flows (issue 16366)

Without this change we're not able to correctly determine the version number, please refer to https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches

Files Modified:

  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/publish_website.yml

09edd6657f0e9c6d47b31427ccae113d46a3764d by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/09edd6657f0e9c6d47b31427ccae113d46a3764d
Authored: 2023-04-28 10:29:31 +0200
Committed: 2023-04-28 10:31:52 +0200

Limit the publish_website.yml work-flow to only the master branch (issue 16369)

This is a tentative patch, based on https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#using-filters

Files Modified:

  • .github/workflows/publish_website.yml

bb1228cb64966ad2b42e621c0326b0e26004dd3d by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/bb1228cb64966ad2b42e621c0326b0e26004dd3d
Authored: 2023-04-28 09:40:32 +0200
Committed: 2023-04-28 09:40:32 +0200

Inline the addPageIndex method in GlobalImageCache.shouldCache

When the GlobalImageCache implementation originally landed, back in PR 11912, the image handling was slightly more complex (with e.g. browser-decoding of some JPEG images). At this point it no longer seems necessary to manually handle pageIndexes in this way, and we should be able to simply inline that in the GlobalImageCache.shouldCache method.

Files Modified:

  • src/core/evaluator.js
  • src/core/image_utils.js

d18b9ee472dd6ffdd1544f6cc6a3f3adf45057c5 by Sebastien Corbin

https://github.com/mozilla/pdf.js/commit/d18b9ee472dd6ffdd1544f6cc6a3f3adf45057c5
Authored: 2023-04-27 17:03:03 +0200
Committed: 2023-04-28 09:28:21 +0200

Update type documentations for #16307 and #16359

Files Modified:

  • web/pdf_find_controller.js
  • web/pdf_page_view.js
  • web/ui_utils.js

263ef59fc7dec2fab68f73e5f3688296d1f2e7d4 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/263ef59fc7dec2fab68f73e5f3688296d1f2e7d4
Authored: 2023-04-27 20:27:27 +0200
Committed: 2023-04-27 20:27:27 +0200

Chmod ugo-x gv-toolbarButton-download.svg

Files Modified:

  • web/images/gv-toolbarButton-download.svg

30ca27ac48ec9fde81e9388e23a917359941a7d0 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/30ca27ac48ec9fde81e9388e23a917359941a7d0
Authored: 2023-04-27 18:04:07 +0200
Committed: 2023-04-27 19:18:03 +0200

Introduce a GitHub Actions workflow for publishing the website

This commit migrates this functionality away from the bots. Nowadays
it's possible to build and deploy the website to GitHub Pages directly
through the GitHub Actions, which provides a nice simplication of the
process. Not only does this remove the requirement to have a gh-pages
branch in the repository, it also avoids the complexity of having to
configure the workflow to commit to Git branches and allows us to remove
the Git committing code from the Gulpfile.

Note that deploying directly though GitHub Actions workflows needs to be
enabled in the repository settings, but this is easy and well documented
on the link below.

The following resources are relevant for this patch:

Files Added:

  • .github/workflows/publish_website.yml

Files Modified:

  • gulpfile.js

8259fb4d2f9a38e4e070c042d2f1c593c468f713 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/8259fb4d2f9a38e4e070c042d2f1c593c468f713
Authored: 2023-04-27 15:39:29 +0200
Committed: 2023-04-27 15:39:29 +0200

Declare the linkService and l10n properties as optional in the PDFViewerOptions documentation

Both properties have a fallback to SimpleLinkService respectively
NullL10n if no other value is provided explicitly.

Files Modified:

  • web/pdf_viewer.js

89ea6b3bb68ddf769254ceaf8f2fad355cffc093 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/89ea6b3bb68ddf769254ceaf8f2fad355cffc093
Authored: 2023-04-26 22:01:40 +0200
Committed: 2023-04-26 22:11:02 +0200

Update the styling of the findbar findMsg-element (issue 16355)

This patch tries to mimic the look of the message-element in the Firefox browser-findbar, and thus makes the following changes:

  • Remove the red colour, since it didn't take the light/dark themes into account.
  • Display the "notFound" message in bold.

Files Modified:

  • web/pdf_find_bar.js
  • web/viewer.css

b4264e964830422b70242b479b6c6349249e3c69 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/b4264e964830422b70242b479b6c6349249e3c69
Authored: 2023-04-25 11:35:21 +0200
Committed: 2023-04-25 12:31:36 +0200

Fix two intermittents issues in integration tests

Files Modified:

  • test/integration/scripting_spec.js

5fad91a680fb1da4fb27d0201e1dd62fc5341563 by Ben Wagner

https://github.com/mozilla/pdf.js/commit/5fad91a680fb1da4fb27d0201e1dd62fc5341563
Authored: 2023-03-03 11:41:04 -0500
Committed: 2023-03-09 08:49:50 -0500

Better approximate gradient color stops

PDF gradients do not have color stops but an arbitrary PDF function of
the type f(t) -> color. CSS gradients are only based on color stops.
Most PDF gradient functions are produced from color stop oriented
gradients.

Take advantage of this by sampling the PDF function at a higher
frequency but not converting any samples which could be interpolated to
color stops. The sampling frequency is chosen to be the least common
multiple of as many values as practical to exactly re-create the common
case of the PDF function implementing equally spaced linearly
interpolated stops in RGB color space. This also allows for better
approximation of other smooth PDF functions (non-linear, or non-equally
spaced, or in different color space).

Fixes: #10572, #14165

Files Added:

  • test/pdfs/issue10572.pdf
  • test/pdfs/issue14165.pdf

Files Modified:

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

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: nobody → cdenizet
Attachment #9331648 - Attachment description: Bug 1831389 - Update PDF.js to a24e11a91cb289dded4241fba6818d9cf1bfb100 → Bug 1831389 - Update PDF.js to a24e11a91cb289dded4241fba6818d9cf1bfb100 r=#pdfjs-reviewers
Pushed by cdenizet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e7a3157cffd Update PDF.js to a24e11a91cb289dded4241fba6818d9cf1bfb100 r=pdfjs-reviewers,marco
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
Blocks: 1832018
No longer blocks: 1832018
No longer blocks: 1690428
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: