Closed Bug 1936937 Opened 2 months ago Closed 2 months ago

Update PDF.js to new version 8fa439826632c5e7e2f3671673998a3a4791bea0 from 2024-12-12 09:15:05

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1938477
Tracking Status
firefox135 --- affected

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 obsolete file)

This update covers 33 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 | 653 +++++++++----
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 7 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 293 +++--
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 13 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 304 ++----
toolkit/components/pdfjs/content/web/viewer.css | 24 +-
toolkit/components/pdfjs/content/web/viewer.mjs | 337 ++----
toolkit/components/pdfjs/moz.yaml | 4 +-
9 files changed, 876 insertions(+), 761 deletions(-)


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

https://github.com/mozilla/pdf.js/commit/e0b63ecd03c67bf557a6ae6c718d2ed135e6c890
Authored: 2024-12-11 16:41:35 +0100
Committed: 2024-12-11 23:20:01 +0100

Move the pinch stuff in its own file in order to use for editors

Files Added:

  • src/display/touch_manager.js

Files Modified:

  • src/pdf.js
  • test/unit/pdf_spec.js
  • web/app.js
  • web/pdfjs.js

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

https://github.com/mozilla/pdf.js/commit/d61b882888006c8fa4479f318459999ed73c535d
Authored: 2024-12-11 13:49:48 +0100
Committed: 2024-12-11 15:06:56 +0100

[Editor] Avoid to focus an existing editor when enabling the layer

It fixes #18911.

Files Added:

  • test/pdfs/issue18911.pdf

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/draw.js
  • src/display/editor/editor.js
  • src/display/editor/freetext.js
  • src/display/editor/highlight.js
  • src/display/editor/stamp.js
  • test/integration/highlight_editor_spec.mjs
  • test/pdfs/.gitignore

89f61b4262f5c722325214bfb67040804bf35c26 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/89f61b4262f5c722325214bfb67040804bf35c26
Authored: 2024-11-28 17:42:13 +0100
Committed: 2024-12-10 21:54:29 +0100

[Editor] Improve drawing on a touch screen.

  • it's now possible to start a drawing with a pen and use fingers to zoom
    or scroll without interacting with the current drawing;
  • it's now possible to draw with a finger and them zoom with two fingers.

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/draw.js
  • src/display/editor/drawers/inkdraw.js
  • web/annotation_editor_layer_builder.css

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

https://github.com/mozilla/pdf.js/commit/b7ab5ee01831e36902e228895851e73c71cdbded
Authored: 2024-12-10 19:59:54 +0100
Committed: 2024-12-10 19:59:54 +0100

Update Puppeteer to version 23.10.3

Files Modified:

  • package-lock.json
  • package.json

73701ad873fdee657ba6376fc11293d0aea52301 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/73701ad873fdee657ba6376fc11293d0aea52301
Authored: 2024-12-10 18:21:05 +0100
Committed: 2024-12-10 19:55:55 +0100

Update Puppeteer to version 23.10.2

Files Modified:

  • package-lock.json
  • package.json

74a377f72feb68e976ace12617384def4fe47a6f by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/74a377f72feb68e976ace12617384def4fe47a6f
Authored: 2024-12-08 22:16:41 +0100
Committed: 2024-12-10 16:14:26 +0100

Fix intermittent failures when moving a freetext annotation in integration tests

When an editor is moved with the keyboard or in dragging it, it is moved in the DOM in order
to make screen readers happy. But this move is slightly postponed thanks to a setTimeout(..., 0).
The failures were very likely due to the fact that intermittently the DOM move was done in
the middle of the next key sequence which was making the move on screen failing.

Files Modified:

  • src/display/editor/editor.js
  • test/integration/freetext_editor_spec.mjs
  • test/integration/test_utils.mjs

62db66dd4645efadc896f628ac7a5b3067a06e77 by Nicolò Ribaudo <nribaudo@igalia.com>

https://github.com/mozilla/pdf.js/commit/62db66dd4645efadc896f628ac7a5b3067a06e77
Authored: 2024-12-10 12:00:09 +0100
Committed: 2024-12-10 12:00:09 +0100

Simplify logic to insert canvas as first element

Instead of conditionally checking if the .cavnasWrapper already
has a child element and then inserting the canvas before it, we can
use .prepend which always injects the new element as the first
child.

Files Modified:

  • web/pdf_page_view.js

3402b727eeab7ae3f2ba3ebf4a97adf578efa771 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/3402b727eeab7ae3f2ba3ebf4a97adf578efa771
Authored: 2024-12-09 19:55:31 +0100
Committed: 2024-12-09 19:55:37 +0100

Make sure the canvas is always the first child of its wrapper

While drawing, in zooming fast enough, it's possible, intermittently, to have the canvas
after the svg which makes the svg invisible.
So this patch makes sure to have the canvas at the right position.

Files Modified:

  • web/pdf_page_view.js

19ea64c6d747bdb4aba6e3be751f193d5d312e0d by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/19ea64c6d747bdb4aba6e3be751f193d5d312e0d
Authored: 2024-12-09 18:02:18 +0100
Committed: 2024-12-09 18:02:18 +0100

Update OpenJPEG to 2.5.3

Files Modified:

  • external/openjpeg/openjpeg.js

166a529ddd1cb5ccc8aa9293f4380661cc9753b2 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/166a529ddd1cb5ccc8aa9293f4380661cc9753b2
Authored: 2024-12-09 17:25:36 +0100
Committed: 2024-12-09 17:25:36 +0100

[Editor] Don't commit the current drawing while zooming

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • web/annotation_editor_layer_builder.js

99f3e6b4ec3003a80971135869a36f787abc65f3 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/99f3e6b4ec3003a80971135869a36f787abc65f3
Authored: 2024-12-09 16:07:39 +0100
Committed: 2024-12-09 16:07:43 +0100

[Editor] When resizing a stamp annotation, the opposite corner must stay fixed

It was due the resize observer which is removed thanks to this patch.
In order to reuse the dragAndDrop function in test, this patch slighty refactors it
in order to make it easier to use.

Files Modified:

  • src/display/editor/stamp.js
  • test/integration/freetext_editor_spec.mjs
  • test/integration/ink_editor_spec.mjs
  • test/integration/stamp_editor_spec.mjs
  • test/integration/test_utils.mjs

6153b15231a9158feb3c8f136cbe6efdd3119f39 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/6153b15231a9158feb3c8f136cbe6efdd3119f39
Authored: 2024-12-09 15:03:09 +0100
Committed: 2024-12-09 15:09:18 +0100

Remove the raw path-strings after creating the actual Path2D glyph-objects

The Path2D glyph-objects are cached on the FontFaceObject-instance, so we can save a little bit of memory by removing the raw path-strings once they're no longer needed.

Files Modified:

  • src/display/api.js
  • src/display/font_loader.js

2b059245049f187ecdc009810bcd5febccb4f27b by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/2b059245049f187ecdc009810bcd5febccb4f27b
Authored: 2024-12-06 23:16:16 +0100
Committed: 2024-12-08 17:12:10 +0100

Improve perfs of the font renderer

Some SVG paths are generated from the font and used in the main thread
to render the glyphs.

Files Modified:

  • src/core/font_renderer.js
  • src/display/canvas.js
  • src/display/font_loader.js
  • src/shared/util.js

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

https://github.com/mozilla/pdf.js/commit/f6662d3f7ca9fb24116f400f7527d62e94d43934
Authored: 2024-12-08 16:06:25 +0100
Committed: 2024-12-08 16:06:25 +0100

Add a ref test for setting disableFontFace to true

Files Modified:

  • test/driver.js
  • test/test_manifest.json

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

https://github.com/mozilla/pdf.js/commit/c6e3fc4fe688165bd9f7d6223d3ef55d935f78c1
Authored: 2024-12-08 14:45:54 +0100
Committed: 2024-12-08 15:51:04 +0100

Take the userUnit into account in the PageViewport class (issue 19176)

Files Added:

  • test/pdfs/issue19176.pdf

Files Modified:

  • src/display/api.js
  • src/display/display_utils.js
  • test/pdfs/.gitignore
  • test/test_manifest.json
  • test/unit/api_spec.js

e74080915de27b98e609877a73cbf9cddeee9ee9 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/e74080915de27b98e609877a73cbf9cddeee9ee9
Authored: 2024-12-07 19:05:02 +0100
Committed: 2024-12-07 19:28:26 +0100

Fix intermittent issues in the issue14307.pdf integration tests

The must check input for US zip format integration test fails pretty
consistently in Puppeteer 23.4.0+ with Expected '12341' to equal '12345'. This is reproducible with the pdf.sandbox.external.js hack
from https://github.com/mozilla/pdf.js/issues/18396#issuecomment-2211273743.
Investigation uncovered two issues at play here:

  1. We do two clearInput calls, but don't await processing of the two
    sandbox events that are triggered by that action. The three tests that
    use issue14307.pdf are in different describe blocks and therefore
    reload the PDF file, so we can simply remove those calls because the
    inputs are already empty by default.

  2. We don't await processing of the sandbox events that occur after
    switching to another text field. This causes the expectation failure
    because the typing actions will happen too soon and interfere with
    the sandbox event processing. We solve the issue by explicitly
    awaiting the sandbox roundtrip.

Moreover, similar to PR #19001 and #18399 we remove any remaining room
for intermittent issues by directly checking for the expected value,
which also results in shorter code.

Files Modified:

  • test/integration/scripting_spec.mjs

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

https://github.com/mozilla/pdf.js/commit/c60a6d1ebd9c2999f305c1ddbcefb7a06841c40c
Authored: 2024-12-07 14:01:00 +0100
Committed: 2024-12-07 14:08:09 +0100

Print more warnings about potential problems in Node.js environments

  • Warn if the "regular" PDF.js build is used in Node.js environments, since that won't load any of the relevant polyfills.

  • Warn if the require function cannot be accessed, since currently we're just "swallowing" any errors.

Files Modified:

  • src/display/node_utils.js

2738d1e4f6f9e37dec340d5ef41e451966a49a43 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/2738d1e4f6f9e37dec340d5ef41e451966a49a43
Authored: 2024-12-07 13:23:29 +0100
Committed: 2024-12-07 13:44:57 +0100

Update translations to the most recent versions

Files Modified:

  • l10n/cs/viewer.ftl
  • l10n/dsb/viewer.ftl
  • l10n/en-CA/viewer.ftl
  • l10n/en-GB/viewer.ftl
  • l10n/es-AR/viewer.ftl
  • l10n/fa/viewer.ftl
  • l10n/hr/viewer.ftl
  • l10n/hsb/viewer.ftl
  • l10n/id/viewer.ftl
  • l10n/is/viewer.ftl
  • l10n/it/viewer.ftl
  • l10n/ko/viewer.ftl
  • l10n/pa-IN/viewer.ftl
  • l10n/ru/viewer.ftl
  • l10n/sr/viewer.ftl
  • l10n/sv-SE/viewer.ftl
  • l10n/vi/viewer.ftl
  • l10n/zh-TW/viewer.ftl

129fc66f65fd4fb63cb08b8c5a86ad60dc12336b by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/129fc66f65fd4fb63cb08b8c5a86ad60dc12336b
Authored: 2024-12-07 13:34:27 +0100
Committed: 2024-12-07 13:44:48 +0100

Upgrade eslint-plugin-perfectionist to version 4.2.0

This requires two changes on our side:

  • The order of exports in web/viewer{-geckoview}.js changes slightly
    because eslint-plugin-perfectionist aligned the sorting order with
    the eslint-plugin-sort-exports plugin we used before. This restores
    the change from commit 347f155.
  • The eslint-plugin-import plugin contains a bug that causes the new
    version of eslint-plugin-perfectionist to be reported as unresolved.
    This issue is tracked upstream, and since the plugin works fine we
    can simply extend the ignore list we already have to avoid this error
    until the upstream bug is fixed.

Files Modified:

  • eslint.config.mjs
  • package-lock.json
  • package.json
  • web/viewer-geckoview.js
  • web/viewer.js

7d1ca73acc571e48d612b9efe53a562a9f2a628d by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/7d1ca73acc571e48d612b9efe53a562a9f2a628d
Authored: 2024-12-07 13:21:27 +0100
Committed: 2024-12-07 13:22:44 +0100

Update dependencies to the most recent versions

Files Modified:

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

6fe6b6d6b7eead129622f73cb99bd295a1715562 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/6fe6b6d6b7eead129622f73cb99bd295a1715562
Authored: 2024-12-06 15:53:36 +0100
Committed: 2024-12-06 18:25:13 +0100

Get the first codepoint instead of the first char when using the toUnicode map

It fixes #19182.

Files Added:

  • test/pdfs/issue19182.pdf

Files Modified:

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

49326f71c2baa8874bacdd37b1ddbefd8fbf198f by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/49326f71c2baa8874bacdd37b1ddbefd8fbf198f
Authored: 2024-12-05 17:03:47 +0100
Committed: 2024-12-06 17:53:28 +0100

Support toggling the PDFFindBar options with the Enter key (issue 19175)

These DOM elements are input type="checkbox" and (natively) only support being toggled with the Space key, however we can extend an existing event-listener to "manually" support the Enter key as well.

Files Modified:

  • web/pdf_find_bar.js

202b26487f7ed0bf94d84f49de0a360c39d202ff by Nicolò Ribaudo <nribaudo@igalia.com>

https://github.com/mozilla/pdf.js/commit/202b26487f7ed0bf94d84f49de0a360c39d202ff
Authored: 2024-12-02 13:28:20 +0100
Committed: 2024-12-06 14:47:22 +0100

Do not stringify errors when logging them

Converting errors to string drops their stack trace, making it more
difficult to debug their actual reason. We can instead pass the error
objects as-is to console.warn/error, so that Firefox/Chrome devtools
will show both the stack trace of the console.warn/error call, and the
original stack trace of the error.

This commit also enables the unicorn/no-console-spaces ESLint rule,
which avoids accidental extra spaces when passing multiple parameters to
console.* methods.

Files Modified:

  • eslint.config.mjs
  • test/downloadutils.mjs
  • test/driver.js
  • test/unit/testreporter.js
  • web/app.js
  • web/download_manager.js
  • web/firefoxcom.js
  • web/l10n.js
  • web/pdf_page_view.js
  • web/pdf_rendering_queue.js
  • web/pdf_scripting_manager.js
  • web/viewer.js

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

https://github.com/mozilla/pdf.js/commit/eff8ede33ec8d0e338ca50d6fa8dad45ad54f481
Authored: 2024-12-01 11:36:18 +0100
Committed: 2024-12-06 12:09:36 +0100

Make the onError callback required in NetworkManager

This helps ensure that loading errors are always handled correctly, and note that both PDFNetworkStreamFullRequestReader and PDFNetworkStreamRangeRequestReader already provided such a callback.

Files Modified:

  • src/display/network.js

2661d0623bb002eedc8948e190ef9419a3593646 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/2661d0623bb002eedc8948e190ef9419a3593646
Authored: 2024-11-27 12:33:39 +0100
Committed: 2024-12-06 12:09:34 +0100

Ensure that a missing/invalid "Content-Range" header is handled in PDFNetworkStream (issue 19075)

In the event that the "Content-Range" header is missing/invalid, loading will now be aborted rather than hanging indefinitely.

Files Modified:

  • src/display/network.js
  • test/unit/network_spec.js
  • test/webserver.mjs

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

https://github.com/mozilla/pdf.js/commit/f3038406b1c2685a09d300ec3f18a2b89c642b22
Authored: 2024-12-04 19:34:57 +0100
Committed: 2024-12-05 23:15:04 +0100

When zooming replace the css-zoomed canvas by the new one only when rendering is finished

It fixes #18622.

It avoids to recreate a canvasWrapper element in order minimize the DOM operations.

Files Modified:

  • test/integration/viewer_spec.mjs
  • web/pdf_page_view.js
  • web/pdf_viewer.css

34390ca53a84315bb3c9b1184b10983e490b6086 by Tim van der Meij <timvandermeij@gmail.com>

https://github.com/mozilla/pdf.js/commit/34390ca53a84315bb3c9b1184b10983e490b6086
Authored: 2024-12-05 22:25:31 +0100
Committed: 2024-12-05 22:25:31 +0100

Bump the stable version in pdfjs.config

Files Modified:

  • pdfjs.config

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

https://github.com/mozilla/pdf.js/commit/d1db8d6294fa1be07543ffa60795e02b4fa86b1a
Authored: 2024-12-05 21:03:54 +0100
Committed: 2024-12-05 21:04:07 +0100

Avoid to display an alert or a confirm dialog if the message is empty

It fixes #19171.

Files Modified:

  • src/scripting_api/app.js
  • test/unit/scripting_spec.js

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

https://github.com/mozilla/pdf.js/commit/dfa0e79553110a0b0d7b92edeaa18b404f14bd7b
Authored: 2024-12-05 14:22:00 +0100
Committed: 2024-12-05 14:22:02 +0100

[Editor] Correctly update the current drawing when zooming

We were trying to update the drawing on the current page but if the drawing is an another
page then it wasn't updated.

Files Modified:

  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/tools.js
  • test/integration/ink_editor_spec.mjs

61e2eceff610cbef562ee0b3696541a3921d6515 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/61e2eceff610cbef562ee0b3696541a3921d6515
Authored: 2024-12-05 13:07:57 +0100
Committed: 2024-12-05 13:07:57 +0100

Ensure that the .toggleButton, as used in the findbar, always have visible hover/focus state (issue 19165)

Similar to the regular toolbarButtons that can be toggled, this ensure that it's always possible to tell when the findbar "buttons" are hovered/focused.

Files Modified:

  • web/viewer.css

3ac55501e9d02db90736cb87549de3ca480e522a by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/3ac55501e9d02db90736cb87549de3ca480e522a
Authored: 2024-12-04 17:57:17 +0100
Committed: 2024-12-04 18:42:49 +0100

Correctly wait for the editor mode when double clicking on an annotation in integration tests

Files Modified:

  • test/integration/ink_editor_spec.mjs
  • test/integration/stamp_editor_spec.mjs

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

https://github.com/mozilla/pdf.js/commit/ef0331877d2e47c14ef5382ac40c29ccb8d77bbc
Authored: 2024-11-13 11:07:55 +0100
Committed: 2024-12-04 10:31:42 +0100

Introduce Promise.try() usage in the code-base

This simplifies the creation of Promises in some cases; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try

Files Modified:

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

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

https://github.com/mozilla/pdf.js/commit/a2b889bb9ad1ac7041bbc633b60d62e85429b7e9
Authored: 2024-12-02 13:38:22 +0100
Committed: 2024-12-02 13:38:22 +0100

Prevent Webpack from resolving import.meta.url statements during building (issue 19145)

This fixes a Node.js-specific regression from PR 18959.

Files Modified:

  • gulpfile.mjs

Duplicate of this bug: 1935485
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: 2 months ago
Duplicate of bug: 1938477
Resolution: --- → DUPLICATE
Attachment #9443327 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: