Closed Bug 2059935 Opened 3 months ago Closed 3 months ago

Update PDF.js to new version 7fc7072f9c8e499b068dfc0d860f90ebe6eda36d from 2026-07-31 18:16:07

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 external file)

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


toolkit/components/pdfjs/PdfJsDefaultPrefs.js | 1 +
toolkit/components/pdfjs/content/build/pdf.mjs | 84 +-
toolkit/components/pdfjs/content/build/pdf.sandbox.external.sys.mjs | 14 +-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 48 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 116 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 586 ++--
toolkit/components/pdfjs/content/web/viewer-geckoview.html | 4 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 53 +-
toolkit/components/pdfjs/content/web/viewer.css | 1226 +++++----
toolkit/components/pdfjs/content/web/viewer.html | 14 +-
toolkit/components/pdfjs/content/web/viewer.mjs | 53 +-
toolkit/components/pdfjs/moz.yaml | 4 +-
12 files changed, 1065 insertions(+), 1138 deletions(-)


0f999e27b56cc90bd8252dbc1a77185eeeb297cc by calixteman <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/0f999e27b56cc90bd8252dbc1a77185eeeb297cc
Authored: 2026-07-29 22:08:36 +0200
Committed: 2026-07-31 19:26:53 +0200

Let pointerup/cancel propagate in TouchManager

During two-finger gestures, keep preventing the default action on pointerup/pointercancel, but don't stop propagation. Resize/drag sessions need those bubble events to clean up.

Files Modified:

  • src/display/touch_manager.js
  • test/integration/ink_editor_spec.mjs
  • test/integration/test_utils.mjs
  • test/integration/viewer_spec.mjs

0d5df9d96e411bdab071d7da95577283717ded6f by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/0d5df9d96e411bdab071d7da95577283717ded6f
Authored: 2026-07-31 16:55:49 +0200
Committed: 2026-07-31 17:37:05 +0200

Re-factor the EventBus to use Map/Set internally

Especially the Array to Set conversion should be helpful, since adding/removing elements from a Set is more efficient.

Files Modified:

  • web/event_utils.js

8960eddfc165fa29506e074f5b73e7ef306504d6 by Calixte Denizet <calixte.denizet@gmail.com>

https://github.com/mozilla/pdf.js/commit/8960eddfc165fa29506e074f5b73e7ef306504d6
Authored: 2026-07-28 22:38:05 +0200
Committed: 2026-07-31 16:44:28 +0200

Use the client coordinates for the pinch-zoom origin

TouchManager computes the pinch distances with the screen coordinates, but it
was passing the pinch center in that space too, while the viewer expects a
client coordinate, like the origin coming from a wheel event.

Since a two-finger gesture can be synthesized with WebDriver BiDi, the
pinch-zoom test doesn't have to rely on CDP anymore and can run in Chrome, where
it fails without the above fix.

Files Modified:

  • src/display/touch_manager.js
  • test/integration/ink_editor_spec.mjs
  • test/integration/test_utils.mjs
  • test/integration/viewer_spec.mjs
  • web/pdf_viewer.js

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

https://github.com/mozilla/pdf.js/commit/ee59db5018796f3dcde40575e3453cf842953453
Authored: 2026-07-31 12:24:08 +0200
Committed: 2026-07-31 12:24:08 +0200

Replace simple return if statements with ternary operators

In a couple of cases, where a boolean is returned, it's also possible to use an OR operator rather a ternary.

Note: This patch reduces the size of the gulp mozcentral bundle by 960 bytes.

Files Modified:

  • external/builder/builder.mjs
  • src/core/cff_parser.js
  • src/core/chunked_stream.js
  • src/core/decode_stream.js
  • src/core/parser.js
  • src/core/stream.js
  • src/core/string_utils.js
  • src/core/to_unicode_map.js
  • src/core/xfa/fonts.js
  • src/core/xfa/template.js
  • src/core/xfa/xfa_object.js
  • src/core/xml_parser.js
  • src/display/annotation_layer.js
  • src/display/canvas_dependency_tracker.js
  • src/display/editor/alt_text.js
  • src/display/editor/drawers/inkdraw.js
  • src/display/editor/signature.js
  • src/pdf.sandbox.external.js
  • src/scripting_api/aform.js
  • src/scripting_api/field.js
  • src/scripting_api/util.js
  • test/driver.js
  • test/unit/test_utils.js
  • web/pdf_viewer.js

734b21e61e599f531e8a153847254ce86de93bc0 by github-actions[bot] <github-actions[bot]@users.noreply.github.com>

https://github.com/mozilla/pdf.js/commit/734b21e61e599f531e8a153847254ce86de93bc0
Authored: 2026-07-31 00:39:04 +0000
Committed: 2026-07-31 00:39:04 +0000

l10n: Update locale files

Files Modified:

  • l10n/bqi/viewer.ftl
  • l10n/de/viewer.ftl
  • l10n/es-MX/viewer.ftl
  • l10n/eu/viewer.ftl
  • l10n/fr/viewer.ftl
  • l10n/it/viewer.ftl
  • l10n/sl/viewer.ftl
  • l10n/vi/viewer.ftl

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

https://github.com/mozilla/pdf.js/commit/b4d028132bfb16daf5a5beeac19c23b43b4e0bf8
Authored: 2026-07-30 10:53:39 +0200
Committed: 2026-07-30 23:13:43 +0200

Sync the viewer chrome with the Firefox design system

The chrome is now authored against Firefox design-token names with the shipped
value as a fallback var(--fx-token, <literal>) so colors, borders and radii
follow Firefox instead of having to be re-synced by hand.

In MOZCENTRAL viewer.css imports chrome://global/skin/design-system/tokens-brand.css,
gated on the new pdfjs.enableNova pref (default false, read straight from CSS via -moz-pref()).
With the pref off the sheet isn't applied, every fallback resolves, and the
viewer renders as before, as it also does in the GENERIC and components builds,
which never see the chrome sheet.

Consuming a token means never declaring its name in an unlayered rule, which
would shadow Firefox's for the whole subtree; --focus-outline, --border-color and
--text-color/--button-border-color are therefore renamed to
--editor-selection-outline, --signature-border-color and --views-*. In forced
colors each state reads a matching background/foreground/border triple so it
can't collapse to a single system color.

The dialog button styling also moves out of .dialog .mainContainer button into
a shared .primaryButton/.secondaryButton primitive (buttons.css, imported from
pdf_viewer.css so the components build gets it too). The password,
document-properties, print and undo-bar buttons use it in place of .dialogButton,
and the custom radio appearance gives way to native controls tinted with
accent-color.

Files Added:

  • web/buttons.css

Files Modified:

  • web/annotation_editor_layer_builder.css
  • web/app_options.js
  • web/comment_manager.css
  • web/dialog.css
  • web/digital_signature_properties.css
  • web/menu.css
  • web/message_bar.css
  • web/pdf_viewer.css
  • web/sidebar.css
  • web/signature_manager.css
  • web/toggle_button.css
  • web/viewer-geckoview.css
  • web/viewer-geckoview.html
  • web/viewer.css
  • web/viewer.html
  • web/views_manager.css

803c9d7d21a9112c8dc701659bde5a319c740985 by Jonas Jenwald <jonas.jenwald@gmail.com>

https://github.com/mozilla/pdf.js/commit/803c9d7d21a9112c8dc701659bde5a319c740985
Authored: 2026-07-30 14:51:04 +0200
Committed: 2026-07-30 16:04:58 +0200

[api-minor] Convert getJSActions to return data in a Map

Compared to regular Objects there's a number of advantages to using Maps:

  • They support proper iteration.
  • They have a simple way to check for the existence of data.
  • They have a simple/efficient way to check the number of elements.

If this functionality was added today, I cannot imagine that we'd choose an Object for this data.

Note also how in the scripting-implementation the actions were already converted into a Map, via the createActionsMap helper.
In the Firefox PDF Viewer sending Maps to the scripting-implementation should be fine, since it uses the browser Cu.cloneInto functionality; see https://searchfox.org/firefox-main/source/toolkit/components/pdfjs/content/PdfSandbox.sys.mjs
However with QuickJS, used by the GENERIC viewer, all data needs to be stringified and unfortunately JSON.stringify() doesn't support Maps. Hence we convert Maps to Objects, via a replacer function, since the existing createActionsMap usage will convert the actions-Objects back to Maps.

Files Modified:

  • src/core/annotation.js
  • src/core/catalog.js
  • src/core/core_utils.js
  • src/display/annotation_layer.js
  • src/display/api.js
  • src/pdf.sandbox.js
  • src/scripting_api/common.js
  • src/scripting_api/doc.js
  • test/unit/annotation_spec.js
  • test/unit/api_spec.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://github.com/mozilla-firefox/firefox/commit/901765a0056e https://hg.mozilla.org/integration/autoland/rev/d7efeaa20c79 Update PDF.js to 7fc7072f9c8e499b068dfc0d860f90ebe6eda36d r=pdfjs-reviewers,calixte
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Regressions: 2084084
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: