Closed Bug 1928159 Opened 4 months ago Closed 3 months ago

Update PDF.js to new version f013c39b9fdb3170edd4058809bd7bf3c37007ff from 2024-10-29 16:10:36

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1929709
Tracking Status
firefox134 --- affected

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 obsolete file)

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


taskcluster/kinds/fetch/toolchains.yml | 2 +-
toolkit/components/pdfjs/content/build/pdf.mjs | 1013 +++++++-----
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 193 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 127 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 7 +-
toolkit/components/pdfjs/content/web/viewer.css | 1 +
toolkit/components/pdfjs/content/web/viewer.mjs | 7 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
toolkit/locales/en-US/toolkit/pdfviewer/viewer.ftl | 11 +-
9 files changed, 737 insertions(+), 628 deletions(-)


db1238aae3de5b6d7da62598a2f4f0c1dca2d3fa by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/db1238aae3de5b6d7da62598a2f4f0c1dca2d3fa
Authored: 2024-10-29 16:35:44 +0100
Committed: 2024-10-29 16:35:44 +0100

Re-factor the toHexUtil helper (PR 17862 follow-up)

We can re-use the hexNumbers structure, since that allows us to directly lookup the hexadecimal values and shortens the code.

Files Modified:

  • src/shared/util.js

5a9607b2adda2cc55a75ee63b69aa99938bd7e3b by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/5a9607b2adda2cc55a75ee63b69aa99938bd7e3b
Authored: 2024-10-28 20:29:50 +0100
Committed: 2024-10-29 15:41:08 +0100

[Editor] Refactor the free highlight stuff in order to be able to use the code for more general drawing

One goal is to make the code for drawing with the Ink tool similar to the one to free highlighting:
it doesn't really make sense to have so different ways to do almost the same thing.

When the zoom level is high, it'll avoid to create a too big canvas covering all the page which consume
more memory, makes the drawing very slow and the overall user xp pretty bad.

A second goal is to be able to easily implement more drawing tools where we would just have to implement
how to draw from the pointer coordinates.

Files Added:

  • src/display/editor/drawers/highlight.js
  • src/display/editor/drawers/outline.js

Files Modified:

  • src/display/draw_layer.js
  • src/display/editor/highlight.js
  • src/pdf.js
  • test/driver.js

Files Changed:

  • R056 src/display/editor/outliner.js

afb4813d1c4288011c93383d28c4445e9af28596 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/afb4813d1c4288011c93383d28c4445e9af28596
Authored: 2024-10-29 13:21:25 +0100
Committed: 2024-10-29 14:59:39 +0100

Simplify the "ReaderHeadersReady" message-handler in the API

We can convert the handler to an async function, which removes the need to create a temporary Promise here.
Given the age of this code it shouldn't hurt to simplify it a little bit.

Files Modified:

  • src/display/api.js

8f47d06d075f6c803f43f22fee8bdc3930c33b17 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/8f47d06d075f6c803f43f22fee8bdc3930c33b17
Authored: 2024-10-14 14:26:11 +0200
Committed: 2024-10-29 10:22:35 +0100

Add helper functions to allow using new Uint8Array methods

This allows using the new methods in browsers that support them, e.g. Firefox 133+, while still providing fallbacks where necessary; see https://github.com/tc39/proposal-arraybuffer-base64

Please note: These are not actual polyfills, but only implements what we need in the PDF.js code-base. Eventually this patch should be reverted, once support is generally available.

Files Modified:

  • src/core/document.js
  • src/core/xfa/template.js
  • src/display/font_loader.js
  • src/shared/util.js

bfc645bab17c0544aee1466513200dfd396f2579 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/bfc645bab17c0544aee1466513200dfd396f2579
Authored: 2024-04-10 12:45:22 +0200
Committed: 2024-10-29 10:22:35 +0100

Introduce some Uint8Array.fromBase64 and Uint8Array.prototype.toBase64 usage in the main code-base

See https://github.com/tc39/proposal-arraybuffer-base64

Files Modified:

  • src/core/xfa/template.js
  • src/display/font_loader.js

f9fc4770804edfc404def28335cf8ad04e2e724e by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/f9fc4770804edfc404def28335cf8ad04e2e724e
Authored: 2024-03-31 12:43:07 +0200
Committed: 2024-10-29 10:22:35 +0100

Improve the implementation of the PDFDocument.fingerprints-getter

  • Add explicit length validation of the /ID entries. Given the EMPTY_FINGERPRINT constant we're already implicitly assuming a particular length.

  • Move the constants into the fingerprints-getter, since they're not used anywhere else.

  • Replace the hexString helper function with the standard Uint8Array.prototype.toHex method; see https://github.com/tc39/proposal-arraybuffer-base64

Files Modified:

  • src/core/document.js

48a18585f299dbad1e80b0e761bfbdcbbcf7958e by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/48a18585f299dbad1e80b0e761bfbdcbbcf7958e
Authored: 2024-10-29 08:52:14 +0100
Committed: 2024-10-29 09:36:08 +0100

Allow StreamsSequenceStream to skip sub-streams that are not actual Streams (issue 18973)

This extends PR 13796 to also handle the case where sub-streams contain invalid data, i.e. anything that isn't a Stream, however please note that in these cases there's no guarantee that we'll render the page "correctly".

Note that Adobe Reader, i.e. the PDF reference implementation, cannot render the last page of the referenced PDF document.

Files Added:

  • test/pdfs/issue18973.pdf.link

Files Modified:

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

ee812b5df2a984b00c0ff398bdd66e54fea3925f by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/ee812b5df2a984b00c0ff398bdd66e54fea3925f
Authored: 2024-10-28 14:34:12 +0100
Committed: 2024-10-28 17:19:02 +0100

[Editor] Utilize Fluent "better" when localizing the AltText

Currently we manually localize and update the DOM-elements of the AltText-button, and it seems nicer to utilize Fluent "properly" for that task.
This can be achieved by introducing an explicit span-element on the AltText-button (similar to e.g. the regular toolbar-buttons), and adding a few more l10n-strings, since that allows just setting the data-l10n-id-attribute on all the relevant DOM-elements.

Finally, note how we no longer need to localize any strings eagerly when initializing the various editors.

Files Modified:

  • l10n/en-US/viewer.ftl
  • src/display/editor/alt_text.js
  • src/display/editor/editor.js
  • test/integration/stamp_editor_spec.mjs

b649b6f8dd4eaf7a7ee036ff9985d0918556991c by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/b649b6f8dd4eaf7a7ee036ff9985d0918556991c
Authored: 2024-10-18 17:23:48 +0200
Committed: 2024-10-28 14:09:52 +0100

Use a BMP decoder when resizing an image

The image decoding won't block the main thread any more.
For now, it isn't enabled for Chrome because issue6741.pdf leads to a crash.

Files Modified:

  • src/core/evaluator.js
  • src/core/image_resizer.js
  • src/display/api.js

8fbb9e2f169ed7b2ec6de614e976c6550696db39 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/8fbb9e2f169ed7b2ec6de614e976c6550696db39
Authored: 2024-10-27 20:24:24 +0100
Committed: 2024-10-28 11:08:30 +0100

[Editor] Split the long words when showing the alt-text tooltip (bug 1903588)

Files Modified:

  • test/integration/stamp_editor_spec.mjs
  • web/annotation_editor_layer_builder.css

230d7f92291d2aa3b7b7493d419667b625d0513c by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/230d7f92291d2aa3b7b7493d419667b625d0513c
Authored: 2024-10-27 19:19:06 +0100
Committed: 2024-10-27 19:19:06 +0100

Make util.scand a bit more flexible with dates which don't match the given format (bug 1910431)

Files Modified:

  • src/scripting_api/aform.js
  • src/scripting_api/util.js
  • test/unit/scripting_spec.js

8a2b95418a6293a9fc3002bce0a4557c4822afda by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/8a2b95418a6293a9fc3002bce0a4557c4822afda
Authored: 2024-10-27 11:03:04 +0100
Committed: 2024-10-27 11:03:04 +0100

Re-factor the ImageResizer._goodSquareLength definition

Move the ImageResizer._goodSquareLength definition into the class itself, since the current position shouldn't be necessary, and also convert it into an actually private field.

Files Modified:

  • src/core/image_resizer.js

d114f71feb7051f922fe02a02b81b34aeba2a631 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/d114f71feb7051f922fe02a02b81b34aeba2a631
Authored: 2024-10-26 14:14:44 +0200
Committed: 2024-10-26 14:14:51 +0200

Always fill the mask with the backdrop color

It fixes #18956.

In the patch #18029, for performance reasons and because I thought it was useless, I deliberately chose to not fill the mask
with the backdrop color when it's full black: it was a bad idea.
So in this patch we always add the backdrop color to the mask.

Files Added:

  • test/pdfs/issue18956.pdf

Files Modified:

  • src/display/canvas.js
  • test/pdfs/.gitignore
  • test/test_manifest.json

b048420d21b2352bded393e81254648ce6998e6c by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/b048420d21b2352bded393e81254648ce6998e6c
Authored: 2024-10-23 15:35:00 +0200
Committed: 2024-10-24 11:08:16 +0200

[api-minor] Remove the CMapCompressionType enumeration

After the binary CMap format had been added there were also some ideas about maybe providing other formats, see here, however that was over seven years ago and we still only use binary CMaps.
Hence it now seems reasonable to simplify the relevant code by removing CMapCompressionType and instead just use a boolean to indicate the type of the built-in CMaps.

Files Modified:

  • src/core/cmap.js
  • src/core/evaluator.js
  • src/display/base_factory.js
  • src/pdf.js
  • src/shared/util.js
  • test/unit/pdf_spec.js
  • web/pdfjs.js

50c291eb33d8553b63c130779a4edfeac98d85e8 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/50c291eb33d8553b63c130779a4edfeac98d85e8
Authored: 2024-10-23 12:03:12 +0200
Committed: 2024-10-24 10:15:09 +0200

Unconditionally cache built-in CMaps on the worker-thread

Given that we've not shipped, nor used, anything except binary CMaps for years let's just cache them unconditionally (since that's a tiny bit less code).

Files Modified:

  • src/core/evaluator.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

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: ASSIGNED → RESOLVED
Closed: 3 months ago
Duplicate of bug: 1929709
Resolution: --- → DUPLICATE
Attachment #9434303 - Attachment is obsolete: true
No longer blocks: 1903588
No longer blocks: 1910431
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: