Closed Bug 1852286 Opened 10 months ago Closed 13 days ago

Update PDF.js to new version 59cf2ee5a9c38a730e78cf84ba99656f1b467dab from 2023-11-28 15:26:32

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1853179

People

(Reporter: update-bot, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

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

This update covers 24 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 | 1289 ++++++++-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 131 +-
toolkit/components/pdfjs/content/web/images/loading-dark.svg | 24 -
toolkit/components/pdfjs/content/web/images/toolbarButton-editorHighlight.svg | 6 +
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 116 +-
toolkit/components/pdfjs/content/web/viewer.css | 578 ++--
toolkit/components/pdfjs/content/web/viewer.html | 63 +-
toolkit/components/pdfjs/content/web/viewer.mjs | 152 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
toolkit/locales/en-US/toolkit/pdfviewer/viewer.ftl | 13 +-
12 files changed, 1791 insertions(+), 590 deletions(-)


b03ce966051a85a5f0f2ceb267667e65beab5ee0 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/b03ce966051a85a5f0f2ceb267667e65beab5ee0
Authored: 2023-11-26 12:18:23 +0100
Committed: 2023-11-28 16:19:58 +0100

[Firefox] Remove the FirefoxCom.requestSync method, since it's unused

After the two previous commits, which removed the remaining call-sites, this method is no longer used and can thus be removed.
As mentioned in the JSDocs for the now removed method, synchronous communication between the viewer and the platform code isn't really a good idea.

Once this patch has landed in mozilla-central some additional clean-up of the platform code will also be possible.

Files Modified:

  • web/firefoxcom.js

9ca504e538a04cd989c9d6c5828479d636e530e4 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/9ca504e538a04cd989c9d6c5828479d636e530e4
Authored: 2023-11-26 12:18:17 +0100
Committed: 2023-11-28 16:19:58 +0100

[Firefox] Don't send the "abortLoading" message synchronously

Despite the comment, I believe that changing this should be fine for two separate reasons:

All-in-all, given the existing platform code and the current viewer-implementation it should thus be safe to not wait for the "abortLoading" message to complete.

Files Modified:

  • web/firefoxcom.js

ddebb0f954b0fea89136e706d23955123da71870 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/ddebb0f954b0fea89136e706d23955123da71870
Authored: 2023-11-26 12:18:08 +0100
Committed: 2023-11-28 16:19:58 +0100

[Firefox] Don't send the "initPassiveLoading" message synchronously

The return value is not, nor has it ever been, used for anything and we should thus be able to just send the message.
Note that the responses are already handled by the "message" event listener registered above.

Files Modified:

  • web/firefoxcom.js

59112a7730feddd70726672d9b52e21a91e79e35 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/59112a7730feddd70726672d9b52e21a91e79e35
Authored: 2023-11-24 14:05:29 +0100
Committed: 2023-11-28 15:36:29 +0100

[Editor] Move the alt text button in the editor toolbar

Files Added:

  • src/display/editor/alt_text.js

Files Modified:

  • l10n/en-US/viewer.ftl
  • src/display/editor/editor.js
  • src/display/editor/toolbar.js
  • test/integration/stamp_editor_spec.mjs
  • web/annotation_editor_layer_builder.css

1ea62939238ddffb664979afb0074dbd6667e523 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/1ea62939238ddffb664979afb0074dbd6667e523
Authored: 2023-11-22 19:02:42 +0100
Committed: 2023-11-28 14:21:53 +0100

[Editor] Add a new editor to highlight some text in a pdf (bug 1866119)

This patch is first big step for the new highlight feature.
Few patches will follow in order to conform to the specs UX/UI gave us.

Files Added:

  • src/display/editor/highlight.js
  • web/images/toolbarButton-editorHighlight.svg

Files Modified:

  • extensions/chromium/preferences_schema.json
  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/editor.js
  • src/display/editor/toolbar.js
  • src/display/editor/tools.js
  • src/shared/util.js
  • web/annotation_editor_layer_builder.css
  • web/annotation_editor_layer_builder.js
  • web/annotation_editor_params.js
  • web/app.js
  • web/app_options.js
  • web/draw_layer_builder.js
  • web/pdf_page_view.js
  • web/toolbar.js
  • web/viewer.css
  • web/viewer.html
  • web/viewer.js

2be136ab700a06b7e6c4f83a1ac6b91e8989406c by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/2be136ab700a06b7e6c4f83a1ac6b91e8989406c
Authored: 2023-11-27 15:06:23 +0100
Committed: 2023-11-27 16:18:31 +0100

[Editor] Avoid to add a new ink editor when we aren't editing anymore

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/tools.js

52ea20eda4b52286442635c3c8481fa382fe46ee by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/52ea20eda4b52286442635c3c8481fa382fe46ee
Authored: 2023-11-26 17:32:52 +0100
Committed: 2023-11-26 18:12:22 +0100

Don't throw when there isn't enough data to get block info in flate stream

but just ends the stream.

Files Added:

  • test/pdfs/issue17332.pdf.link

Files Modified:

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

dd07267da6558612bcc4e8a6808550b90ce2059e by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/dd07267da6558612bcc4e8a6808550b90ce2059e
Authored: 2023-11-26 13:46:23 +0100
Committed: 2023-11-26 13:46:23 +0100

Bump the stable version in pdfjs.config

Files Modified:

  • pdfjs.config

ab692f805a45d2fcd6f12d0f2c1e5c2946af7240 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/ab692f805a45d2fcd6f12d0f2c1e5c2946af7240
Authored: 2023-11-25 17:29:49 +0100
Committed: 2023-11-25 19:34:44 +0100

Update translations to the most recent versions

Files Modified:

  • l10n/be/viewer.ftl
  • l10n/cy/viewer.ftl
  • l10n/dsb/viewer.ftl
  • l10n/el/viewer.ftl
  • l10n/en-GB/viewer.ftl
  • l10n/eo/viewer.ftl
  • l10n/es-CL/viewer.ftl
  • l10n/fi/viewer.ftl
  • l10n/fr/viewer.ftl
  • l10n/gl/viewer.ftl
  • l10n/gn/viewer.ftl
  • l10n/he/viewer.ftl
  • l10n/hsb/viewer.ftl
  • l10n/ia/viewer.ftl
  • l10n/is/viewer.ftl
  • l10n/it/viewer.ftl
  • l10n/kab/viewer.ftl
  • l10n/kk/viewer.ftl
  • l10n/ko/viewer.ftl
  • l10n/nb-NO/viewer.ftl
  • l10n/pl/viewer.ftl
  • l10n/pt-BR/viewer.ftl
  • l10n/ru/viewer.ftl
  • l10n/sk/viewer.ftl
  • l10n/sq/viewer.ftl
  • l10n/sv-SE/viewer.ftl
  • l10n/th/viewer.ftl
  • l10n/tr/viewer.ftl
  • l10n/vi/viewer.ftl
  • l10n/zh-TW/viewer.ftl

dd7ff7e6620bb14866c2512327213a2552a22623 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/dd7ff7e6620bb14866c2512327213a2552a22623
Authored: 2023-11-25 18:00:40 +0100
Committed: 2023-11-25 19:34:44 +0100

Update the JSDoc comments for the new TypeScript version

This commit fixes the JSDoc comment for the annotationEditorMode setter.
The types tests fail on that now because the input value was changed from
a number to an object with various properties in recent patches, but the
JSDoc comment was not updated accordingly.

Moreover, the types tests also fail because TypeScript 5.3 assumes that
getters and setters have equal return and input value types, which is
arguably also what one would expect, but our annotationEditorMode
getter and setter deviate from that because the getter returns a number
while the setter accepts an object. Given that it seems more important
to document the setter entirely, including the meaning and types of its
properties, and the type of the getter can easily be inferred from this
comment and the other JSDoc comments that have annotationEditorMode in
it, we remove the getter type to make the types tests pass again.

Files Modified:

  • web/pdf_viewer.js

8aa26fad243e6f018a38dd60dd00c1b3897f60f9 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/8aa26fad243e6f018a38dd60dd00c1b3897f60f9
Authored: 2023-11-25 17:28:14 +0100
Committed: 2023-11-25 18:15:09 +0100

Update the code style for the new Prettier version

This patch is automatically generated using gulp lint --fix.

Files Modified:

  • web/app_options.js

7381515e20a40225315b724ed41a615fb12e6e93 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/7381515e20a40225315b724ed41a615fb12e6e93
Authored: 2023-11-25 17:25:35 +0100
Committed: 2023-11-25 17:25:35 +0100

Update dependencies to the most recent versions

Files Modified:

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

eb5f610d18a0613fce115452929ee3b4349eb38e by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/eb5f610d18a0613fce115452929ee3b4349eb38e
Authored: 2023-11-24 20:17:15 +0100
Committed: 2023-11-25 15:09:31 +0100

Remove language codes from text strings.

And take care to have an even number of bytes with utf16 strings.

Files Modified:

  • src/shared/util.js
  • test/unit/util_spec.js

42147e88398a77394f06563765953da7f5cb3f11 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/42147e88398a77394f06563765953da7f5cb3f11
Authored: 2023-11-24 16:00:00 +0100
Committed: 2023-11-24 16:00:04 +0100

[Editor] Only focus the canvas for mouse events when drawing in the canvas

And if we've to focus it, we must prevent scrolling to avoid to draw at an
unexpected position.

Files Modified:

  • src/display/editor/ink.js

fd7a7e285914bf224a6b112b15fb95e75363398c by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/fd7a7e285914bf224a6b112b15fb95e75363398c
Authored: 2023-11-24 12:56:22 +0100
Committed: 2023-11-24 13:05:57 +0100

Use the fetchData helper function in more cases

  • Extend the fetchData helper function to also support fetching of "blob" data.

  • Use the fetchData helper function more in the code-base, when fetching non-PDF data. Given that the Fetch API isn't supported for all protocols, this should improve compatibility for the PDF.js library.

Files Modified:

  • src/display/display_utils.js
  • src/display/editor/tools.js
  • web/l10n_utils.js

1f0f51613a958d661ce1b91c10d66c59f215e66d by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/1f0f51613a958d661ce1b91c10d66c59f215e66d
Authored: 2023-11-22 20:23:52 +0100
Committed: 2023-11-23 17:01:49 +0100

Make sure that only one radio button is checked in its group (bug 1864136)

When the first checked radio is met, the others in the group are set to false.

Files Added:

  • test/pdfs/bug1864136.pdf.link

Files Modified:

  • src/display/annotation_layer.js
  • test/driver.js
  • test/integration/scripting_spec.mjs
  • test/test_manifest.json

6e7381bc20b9152b51ce5cef2fbc0601c1e90d05 by Takashi Tamura

https://github.com/mozilla/pdf.js/commit/6e7381bc20b9152b51ce5cef2fbc0601c1e90d05
Authored: 2023-11-23 09:21:34 +0900
Committed: 2023-11-23 09:25:20 +0900

Fix examples/webpack/README.md. The .mjs extension is necessary. Close #17319

Files Modified:

  • examples/webpack/README.md

5df7c970742f16c809c2543858e9290a00832aa1 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/5df7c970742f16c809c2543858e9290a00832aa1
Authored: 2023-11-18 22:05:21 +0100
Committed: 2023-11-22 13:04:05 +0100

Move the editor-buttons in the main toolbar

By introducing a CSS variable for the editor-toolbars we're able to handle resizing of the viewer without complicating the code too much.

Files Modified:

  • web/viewer.css
  • web/viewer.html

f8f44329617e045c5610f6860efeb5919352e124 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/f8f44329617e045c5610f6860efeb5919352e124
Authored: 2023-11-20 20:03:34 +0100
Committed: 2023-11-22 10:41:55 +0100

[Editor] Add support for saving/printing a newly added Highlight annotation (bug 1865708)

Files Modified:

  • src/core/annotation.js
  • src/shared/util.js
  • test/test_manifest.json
  • test/unit/annotation_spec.js

625d4f794e449ffb022685507a979387ca778e1c by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/625d4f794e449ffb022685507a979387ca778e1c
Authored: 2023-11-16 14:24:16 +0100
Committed: 2023-11-21 13:55:36 +0100

Re-factor the loading-icons used in the viewer toolbars

Currently the SVG images for the loading-icons exist in two versions, for the light- respectively dark-theme, which nowadays are the only "duplicated" icons left.
The reason for this is that these icons are being used in input-elements, where the regular mask-image approach used for all buttons don't work.

To address this we add containers for the input-elements, such that we have a "regular" DOM-element where we can use mask-image.

Files Deleted:

  • web/images/loading-dark.svg

Files Modified:

  • web/toolbar.js
  • web/viewer.css
  • web/viewer.html

31d9b9f574d61cd8f275f86628dfd9459a281769 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/31d9b9f574d61cd8f275f86628dfd9459a281769
Authored: 2023-11-17 18:54:26 +0100
Committed: 2023-11-20 18:45:19 +0100

[Editor] Add a way to extract the outlines of a union of rectangles

The goal is to be able to get these outlines to fill the shape corresponding
to a text selection in order to highlight some text contents.
The outlines will be used either to show selected/hovered highlights.

Files Added:

  • src/display/draw_layer.js
  • src/display/editor/outliner.js
  • test/draw_layer_test.css
  • web/draw_layer_builder.css
  • web/draw_layer_builder.js

Files Modified:

  • src/pdf.js
  • test/driver.js
  • test/test.mjs
  • test/test_manifest.json
  • test/unit/pdf_spec.js
  • web/pdfjs.js

a6f0609a6e40db3f8b741b19aacff354f9d4647b by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/a6f0609a6e40db3f8b741b19aacff354f9d4647b
Authored: 2023-11-20 17:33:49 +0100
Committed: 2023-11-20 17:33:49 +0100

Throw a JpegError when a JPEG image has no frame data (issue 17302)

Given that there's nothing to parse in this case, since we're dealing with an invalid JPEG image, throwing an explicit Error makes sense here.

Files Modified:

  • src/core/jpg.js

bd6c2a192c4727b952976db90038f905ac9e0358 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/bd6c2a192c4727b952976db90038f905ac9e0358
Authored: 2023-11-20 13:22:02 +0100
Committed: 2023-11-20 13:22:02 +0100

[Editor] Make the alt-text button large enough to display correctly whatever string

Files Modified:

  • web/annotation_editor_layer_builder.css

53101b379b3aa5986f0fa61b6cad9e3ecb8dc852 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/53101b379b3aa5986f0fa61b6cad9e3ecb8dc852
Authored: 2023-11-18 18:18:36 +0100
Committed: 2023-11-18 21:32:25 +0100

Restore the option to set light/dark mode for chromium and generic builds

Files Modified:

  • extensions/chromium/preferences_schema.json
  • gulpfile.mjs
  • package-lock.json
  • package.json
  • web/app.js
  • web/app_options.js

It looks like we experienced one or more build failures when trying to apply this
update. You will need to apply this update manually; you can replicate the patch
locally with ./mach vendor toolkit/components/pdfjs/moz.yaml. I'm going to abandon the Phabricator patch and
let you submit a new one.

If the build failure wasn't caused by a library change, and was instead caused by
something structural in the build system please let my maintainers know in
Slack:#secinf.

I do my best to automatically add new files to the build, but some moz.build files
are complicated and you may need to fix them manually.

Flags: needinfo?(cdenizet)

This bug is being closed because a newer revision of the library is available.
This bug will be marked as a duplicate of it (because although this bug is older, it is superseded by the newer one).

Status: NEW → RESOLVED
Closed: 13 days ago
Duplicate of bug: 1853179
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.