Closed Bug 1840990 Opened 1 year ago Closed 1 year ago

Update PDF.js to new version 88c7c8b5bfae61a20d7cb5fb27b3749b98a48d02 from 2023-06-28 20:42:54

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox116 --- wontfix
firefox117 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

This update covers 18 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.js | 229 ++++--
toolkit/components/pdfjs/content/build/pdf.scripting.js | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.js | 274 ++++++-
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 26 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.js | 347 ++++-----
toolkit/components/pdfjs/content/web/viewer.css | 26 +-
toolkit/components/pdfjs/content/web/viewer.js | 305 ++++----
toolkit/components/pdfjs/moz.yaml | 4 +-
9 files changed, 746 insertions(+), 470 deletions(-)


a024cd0127680499135e8abea731c3fd177ad62d by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/a024cd0127680499135e8abea731c3fd177ad62d
Authored: 2023-06-26 23:12:37 +0200
Committed: 2023-06-26 23:37:39 +0200

Re-factor how HCM highlight-filters are handled in the viewer components (PR 16593 follow-up)

This is something that I completely overlooked during review of PR 16593, since the idea is (obviously) that the viewer-components should be usable as-is without the user needing to manually pass in any additional parameters.

To support this we can very easily expose the current FilterFactory-instance on the PDFPageProxy-class[1], and if needed initialize the highlight-filters when initializing the page (again limited to the viewer-components).

Files Modified:

  • src/display/api.js
  • web/pdf_page_view.js
  • web/pdf_viewer.js

599b9498f229360096f506720157cbe87727cd71 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/599b9498f229360096f506720157cbe87727cd71
Authored: 2023-06-22 19:48:40 +0200
Committed: 2023-06-26 15:47:05 +0200

[Editor] Add support for printing/saving newly added Stamp annotations

In order to minimize the size the of a saved pdf, we generate only one
image and use a reference in each annotation using it.
When printing, it's slightly different since we have to render each page
independantly but we use the same image within a page.

Files Added:

  • test/images/firefox_logo.png

Files Modified:

  • src/core/annotation.js
  • src/core/document.js
  • src/core/worker.js
  • src/display/api.js
  • src/shared/util.js
  • test/driver.js
  • test/test_manifest.json
  • test/unit/api_spec.js

80b4708fa32721dd3630973a11fe21f474d63e3e by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/80b4708fa32721dd3630973a11fe21f474d63e3e
Authored: 2023-06-26 15:17:03 +0200
Committed: 2023-06-26 15:17:03 +0200

[GeckoView] Remove the enableFloatingToolbar preference

Note that we'll now display the toolbar unconditionally in GeckoView.

Files Modified:

  • web/app.js
  • web/app_options.js

c519cc821bc216ac7c24dc68448e4292b1f803a4 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/c519cc821bc216ac7c24dc68448e4292b1f803a4
Authored: 2023-06-23 15:47:59 +0200
Committed: 2023-06-26 14:45:03 +0200

Improve highlightments and popups in HCM (bug 1830850)

  • Modify the text and background colors in popup to fit a11y requirements
  • Add a backdrop filter on clickable areas in using a svg filter mapping
    canvas colors to Highlight and HighlightText ones.

Files Modified:

  • src/display/annotation_layer.js
  • src/display/base_factory.js
  • src/display/display_utils.js
  • web/annotation_layer_builder.css
  • web/pdf_page_view.js
  • web/pdf_viewer.js

5f5db4b160a3d4f6c4e375ae6d2e254222f2edf3 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/5f5db4b160a3d4f6c4e375ae6d2e254222f2edf3
Authored: 2023-06-26 09:30:13 +0200
Committed: 2023-06-26 09:37:34 +0200

Run the PDF.js-viewer API unit-test in Node.js environments (PR 16592 follow-up)

It occurred to me that we can actually run this unit-test in Node.js environments by making use of the preprocessor to stub out the browser globals there.

Files Modified:

  • external/webL10n/l10n.js
  • gulpfile.js
  • test/unit/clitests.json
  • web/genericl10n.js

9e7023776e3a8d8b7c452c918d68bad6425e0b2a by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/9e7023776e3a8d8b7c452c918d68bad6425e0b2a
Authored: 2023-06-25 16:02:31 +0200
Committed: 2023-06-25 16:02:31 +0200

Use nullish coalescing when handling the TESTING build-target

Given that nullish coalescing is now available in all environments/browser that we support, we can (ever so slightly) simplify handling of the TESTING build-target.

Files Modified:

  • gulpfile.js

1f29baad226c8c0a58c54fe26acad7c06271c2fe by Rob Wu

https://github.com/mozilla/pdf.js/commit/1f29baad226c8c0a58c54fe26acad7c06271c2fe
Authored: 2023-06-03 12:02:13 +0200
Committed: 2023-06-25 14:19:50 +0200

Set minimum_chrome_version to 88

Set minimum_chrome_version to 88 to not distribute an incompatible
version of the extension to older Chrome versions.

See https://github.com/mozilla/pdf.js/issues/13669#issuecomment-1510485564

Files Modified:

  • extensions/chromium/manifest.json

a4ddf7baaa81aca1a14e72030fc068188db03af7 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/a4ddf7baaa81aca1a14e72030fc068188db03af7
Authored: 2023-06-25 09:19:03 +0200
Committed: 2023-06-25 09:19:03 +0200

Update l10n files

Files Modified:

  • l10n/eu/viewer.properties
  • l10n/sat/viewer.properties

744b01b6377d2753eb18bf89dc3cf9b71baa906c by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/744b01b6377d2753eb18bf89dc3cf9b71baa906c
Authored: 2023-06-25 09:18:41 +0200
Committed: 2023-06-25 09:18:41 +0200

Update npm packages

Files Modified:

  • package-lock.json
  • package.json

7667f55e45665bcb19a510836de80ba6417dc928 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/7667f55e45665bcb19a510836de80ba6417dc928
Authored: 2023-06-24 18:33:17 +0200
Committed: 2023-06-24 18:37:43 +0200

[Firefox] Simplify FirefoxPreferences._readFromStorage (PR 16583 follow-up)

Now that https://bugzilla.mozilla.org/show_bug.cgi?id=1840064 has landed in mozilla-central we can implement the final piece of clean-up for the FirefoxPreferences._readFromStorage method.

Files Modified:

  • web/firefoxcom.js

e153e3a7419c43b16955af1c5a9beff2ddfce792 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/e153e3a7419c43b16955af1c5a9beff2ddfce792
Authored: 2023-06-24 13:23:02 +0200
Committed: 2023-06-24 13:23:02 +0200

Expose FindState in the viewer-components (issue 16589)

Files Modified:

  • test/unit/pdf_viewer.component_spec.js
  • web/pdf_viewer.component.js

f596490a1b8c31b65600bb435a81d5505a8ed255 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/f596490a1b8c31b65600bb435a81d5505a8ed255
Authored: 2023-06-23 12:21:58 +0200
Committed: 2023-06-23 12:22:54 +0200

Add a unit-test to check that the official PDF.js-viewer API exposes the expected functionality

Until now we've not actually had any tests that ensure that the official PDF.js-viewer API exposes the intended functionality, which means that things can easily break accidentally.

Please note: This unit-test cannot (easily) be run in Node.js-environments, since the external/webL10n/l10n.js file contains various browser-specific functionality.

Files Added:

  • test/unit/pdf_viewer.component_spec.js

Files Modified:

  • test/unit/jasmine-boot.js
  • web/pdf_viewer.component.js

c5e4a22ee0567d08a8bf410c0df79f81b308f52b by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/c5e4a22ee0567d08a8bf410c0df79f81b308f52b
Authored: 2023-06-23 11:52:43 +0200
Committed: 2023-06-23 11:54:30 +0200

[api-minor] Remove the default-factories from the viewer components (PR 15811 follow-up)

The changes in PR 15811 have now been included in no less than six official releases, hence it should hopefully be OK to remove this now.

Files Modified:

  • examples/components/pageviewer.js
  • web/pdf_viewer.component.js

b4b941984172a201c5106262cc02ab507bb66de5 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/b4b941984172a201c5106262cc02ab507bb66de5
Authored: 2023-06-23 10:37:27 +0200
Committed: 2023-06-23 10:44:08 +0200

Remove a couple of unused constants from src/shared/util.js

These constants were added "speculatively" in PR 10820, almost four years ago, but have never actually been used. We already have issue 10982 that tracks potentially extending support for the affected annotation-format, however until that happens I really don't think that we should keep shipping completely unused code in the PDF.js library.

For the MOZCENTRAL build-target, i.e. the Firefox PDF Viewer, this reduces the total bundle size by 1.1 kilo-byte.

Files Modified:

  • src/shared/util.js

0bbadce066b84fa9eed8ab32f47562f8fedd64d7 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/0bbadce066b84fa9eed8ab32f47562f8fedd64d7
Authored: 2023-06-22 15:16:25 +0200
Committed: 2023-06-22 15:21:10 +0200

Add a unit-test to check that the official PDF.js API exposes the expected functionality

Until now we've not actually had any tests that ensure that the official PDF.js API exposes the intended functionality, which means that things can easily break accidentally.

Files Added:

  • test/unit/pdf_spec.js

Files Modified:

  • test/unit/clitests.json
  • test/unit/jasmine-boot.js

25a07d92d0b3127aa8b47cce776a4382341a1551 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/25a07d92d0b3127aa8b47cce776a4382341a1551
Authored: 2023-06-22 15:02:54 +0200
Committed: 2023-06-22 15:02:54 +0200

[Firefox] Stub out the isValidFetchUrl function in MOZCENTRAL builds

This helper function is completely unused in the Firefox PDF Viewer.

Files Modified:

  • src/display/display_utils.js

547b8276e60f73c3bc617b4301b02eb09d7ef4ed by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/547b8276e60f73c3bc617b4301b02eb09d7ef4ed
Authored: 2023-06-20 12:40:48 +0200
Committed: 2023-06-22 08:09:58 +0200

[api-minor] Re-factor the PDFScriptingManager class to use private fields/methods

  • Change (most) fields/methods into private ones, since that's now supported.
  • Tweak the constructor-parameters, and simplify the sandbox initialization w.r.t. the viewer components.
  • Remove some unused function/method parameters.
  • Slightly simplify the "updatefromsandbox"-handler by using local variables and inverting some conditions.

Files Modified:

  • web/app.js
  • web/generic_scripting.js
  • web/pdf_scripting_manager.js

cca299eeb9993dcbc5791ffcf22bb37d38c1ae00 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/cca299eeb9993dcbc5791ffcf22bb37d38c1ae00
Authored: 2023-06-20 12:32:58 +0200
Committed: 2023-06-22 08:09:58 +0200

[GeckoView] Ignore Scroll/Spread-modes in the PDFViewer setters

Rather than sprinkling pre-processor statements throughout the viewer-code, simply "disable" the relevant PDFViewer setters instead.

Also, given that the GeckoView-specific viewer doesn't have a sidebar we don't actually need to explicitly ignore a pageMode during loading.

Files Modified:

  • web/app.js
  • web/pdf_scripting_manager.js
  • web/pdf_viewer.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
Pushed by cdenizet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6fa3bbca79c8 Update PDF.js to 88c7c8b5bfae61a20d7cb5fb27b3749b98a48d02 r=pdfjs-reviewers,calixte
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: