Closed Bug 1813363 Opened 1 year ago Closed 1 year ago

Update PDF.js to new version 5620456072246f4f9f9eda37137b580863e6526c from 2023-01-28 18:10:01

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

This update covers 13 commits:


6129be7b6886161d511da44400093afb3c71a1d4 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/6129be7b6886161d511da44400093afb3c71a1d4
Authored: 2023-01-28 13:03:03 +0100
Committed: 2023-01-28 18:55:22 +0100

Change the PDFViewerApplication.open method to only accept objects

If this method was added today, I really can't imagine that we'd support anything except objects. Unfortunately we cannot just remove this now, since the code has existed since "forever", however we can deprecate this and limit it to only the GENERIC build.

Furthermore, we can avoid a redundant PDFViewerApplication.setTitleUsingUrl call in the Firefox PDF Viewer since the title has already been set previously in that case.

Files Modified:

  • web/app.js

cf0369d622ef3a65da898efd3ef649ef44e2f940 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/cf0369d622ef3a65da898efd3ef649ef44e2f940
Authored: 2023-01-22 17:01:06 +0100
Committed: 2023-01-28 18:28:22 +0100

Polyfill Path2D in Node.js environments

Until just recently the only existing Path2D polyfill didn't have support for Node.js and/or the node-canvas package. Given that this was just fixed, in the latest version, we can now finally remove our inline-checks at the relevant call-sites; please also see https://github.com/nilzona/path2d-polyfill#usage-with-node-canvas

Files Modified:

  • gulpfile.js
  • package-lock.json
  • package.json
  • src/display/canvas.js
  • src/display/pattern_helper.js
  • src/shared/compatibility.js

52d61acedadaff8997501abeec7e6e98bee7d360 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/52d61acedadaff8997501abeec7e6e98bee7d360
Authored: 2023-01-28 08:15:21 +0100
Committed: 2023-01-28 08:15:21 +0100

Update l10n files

Files Modified:

  • l10n/be/viewer.properties
  • l10n/cy/viewer.properties
  • l10n/de/viewer.properties
  • l10n/en-GB/viewer.properties
  • l10n/es-AR/viewer.properties
  • l10n/es-MX/viewer.properties
  • l10n/fy-NL/viewer.properties
  • l10n/he/viewer.properties
  • l10n/hsb/viewer.properties
  • l10n/hu/viewer.properties
  • l10n/ia/viewer.properties
  • l10n/id/viewer.properties
  • l10n/it/viewer.properties
  • l10n/kk/viewer.properties
  • l10n/ko/viewer.properties
  • l10n/nl/viewer.properties
  • l10n/oc/viewer.properties
  • l10n/pa-IN/viewer.properties
  • l10n/pt-BR/viewer.properties
  • l10n/skr/viewer.properties
  • l10n/sq/viewer.properties
  • l10n/sr/viewer.properties
  • l10n/sv-SE/viewer.properties
  • l10n/tg/viewer.properties
  • l10n/uk/viewer.properties
  • l10n/vi/viewer.properties
  • l10n/zh-CN/viewer.properties
  • l10n/zh-TW/viewer.properties

07ba3529035debb9fe222aeb124f4a7cea648768 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/07ba3529035debb9fe222aeb124f4a7cea648768
Authored: 2023-01-28 08:13:13 +0100
Committed: 2023-01-28 08:13:13 +0100

Update npm packages

Files Modified:

  • gulpfile.js
  • package-lock.json
  • package.json
  • test/test.js
  • test/testutils.js

6f4d037a8eed3fc8d1f0d824a57784533abe9a72 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/6f4d037a8eed3fc8d1f0d824a57784533abe9a72
Authored: 2023-01-26 13:04:48 +0100
Committed: 2023-01-26 14:57:02 +0100

[JS] Correctly format field with numbers (bug 1811694, bug 1811510)

In PR #15757, a value is automatically converted into a number when it's possible
but the case of numbers like "000123" has been overlooked and their format must
be preserved.
When a script is doing something like "foo.value + bar.value" and the values are
numbers then "foo.value" must return a number but the displayed value must be what
the user entered or what a script set, so this patch is just adding a a field
_orginalValue in order to track the value has it has defined.
Some people are used to use a comma as decimal separator, hence it must be considered
when a value is parsed into a number.
This patch is fixing a regression introduced by #15757.

Files Added:

Files Modified:

  • src/scripting_api/event.js
  • src/scripting_api/field.js
  • src/scripting_api/proxy.js
  • test/integration/scripting_spec.js
  • test/pdfs/.gitignore
  • test/unit/scripting_spec.js

1c4af2727c6d8ed7fa1c4dd73d8f80e4cb3db6c3 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/1c4af2727c6d8ed7fa1c4dd73d8f80e4cb3db6c3
Authored: 2023-01-26 14:08:40 +0100
Committed: 2023-01-26 14:16:01 +0100

Simplify setting the GlobalWorkerOptions default values (PR 9480 follow-up)

There's really no need for these "complicated" default value assignments, since GlobalWorkerOptions is a local variable at this point, and this is rather a case of too much copy-and-paste.
Note that years ago, when all options were set using a global PDFJS object, it's possible that options had been set (from the outside) before the object had been properly initialized; see e.g. https://github.com/mozilla/pdf.js/blob/a89071bdefb90733fc2e671fcca61f6d03964e04/src/display/global.js

Files Modified:

  • src/display/worker_options.js

4758e6649cfdcbffb029fae5ec7091444135df36 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/4758e6649cfdcbffb029fae5ec7091444135df36
Authored: 2023-01-26 10:48:58 +0100
Committed: 2023-01-26 10:48:58 +0100

Only accept non-objects passed to getDocument in GENERIC builds

In general it's always recommended to pass a parameter object when calling the getDocument-function in the API, since that's the only way to provide additional options, and the fact that it also accepts a URL or TypedArray directly is now mostly for backwards compatibility reasons.
Unfortunately we cannot really remove this, since that code has existed since "forever", however we can limit it to only the GENERIC build to avoid completely unnecessary checks in e.g. the Firefox PDF Viewer.

Finally, note that the default-viewer always provides a parameter object when calling the getDocument-function and it's thus completely unaffected by these changes.

Files Modified:

  • src/display/api.js

c0a023eaf97bd764ac0d226093c30bd87015a563 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/c0a023eaf97bd764ac0d226093c30bd87015a563
Authored: 2023-01-25 15:46:53 +0100
Committed: 2023-01-25 15:46:53 +0100

Update various README files to be less specific about the supported JavaScript features

By being less specific about which exact JavaScript features are required for the default vs legacy build, we don't need to worry about keeping multiple README files up-to-date.
These README files will now refer back to the FAQ for current browser/environment support information.

Files Modified:

  • README.md
  • external/dist/README.md

9d5085347af995d2bb5a690e8b8362302983f0ff by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/9d5085347af995d2bb5a690e8b8362302983f0ff
Authored: 2023-01-25 11:09:28 +0100
Committed: 2023-01-25 11:09:28 +0100

Move ProgressBar-related CSS variables into the loadingBar DOM-element (issue 15958)

This way we avoid reflowing the entire viewer when e.g. updating the loading progress.

Files Modified:

  • examples/mobile-viewer/viewer.css
  • web/ui_utils.js
  • web/viewer.css

85fd76546271b0d6025e4a35ca125524e700ac59 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/85fd76546271b0d6025e4a35ca125524e700ac59
Authored: 2023-01-25 10:47:03 +0100
Committed: 2023-01-25 10:47:03 +0100

Tweak the normalizeWheelEventDelta helper function

This function is only used in PresentationMode these days, but we can still improve it a little bit:

  • Use the existing web-platform deltaMode constants, rather than defining our own constants for those values.
  • Access the deltaMode first, before the delta{X, Y} properties, to avoid being affected by bug 1392460 (similar to the default viewer).

Files Modified:

  • web/ui_utils.js

1cb482be6afa340412e97e4a20eee32113c257c9 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/1cb482be6afa340412e97e4a20eee32113c257c9
Authored: 2023-01-24 18:35:15 +0100
Committed: 2023-01-24 20:12:12 +0100

Try to avoid to interpret wheel events as pinch-to-zoom ones (bug 1810800)

Files Modified:

  • web/app.js

755319130e6d3135a286cab86bd12de9d4c6ff41 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/755319130e6d3135a286cab86bd12de9d4c6ff41
Authored: 2023-01-24 10:40:45 +0100
Committed: 2023-01-24 11:18:41 +0100

Tweak the internal handling of the url-parameter in getDocument (PR 13166 follow-up)

  • Use a URL-instance directly, since it's by definition an absolute URL.
  • Actually limit the "raw" url-string handling to Node.js environments, as intended.
  • Skip the warning, since we're already throwing an Error if the url-parameter is invalid.

Files Modified:

  • src/display/api.js

be93a2a7d4487cd5c69b03384de2445d5cc7d150 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/be93a2a7d4487cd5c69b03384de2445d5cc7d150
Authored: 2023-01-22 19:39:31 +0100
Committed: 2023-01-22 19:39:31 +0100

Set up automated l10n review for new English strings

Files Added:

  • .github/CODEOWNERS

Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Pushed by cdenizet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e6e21353ce69
Update PDF.js to 5620456072246f4f9f9eda37137b580863e6526c r=calixte
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

The try push is done, we found jobs with unclassified failures.

Needs Investigation (From Push Health):

  • No tests were found for flavor 'plain' and the following manifest filters:
    skip_if, run_if, fail_if, subsuite(name=None), tags(['condprof']), pathprefix(['toolkit/components/pdfjs/test'])

    Make sure the test paths (if any) are spelt correctly and the corresponding
    --flavor and --subsuite are being used. See mach mochitest --help for a
    list of valid flavors.

    • 2 of 2 failed on different tasks
      - test-linux1804-64-qr/opt-mochitest-plain-condprof-1 (SWkTFbstSI6YUFaDEehDOg)
      - test-windows10-64-2004-qr/opt-mochitest-plain-condprof-1 (HrQcOLpzSIK-n7XL0xE1hw)

Needs Investigation (Other Failed Jobs):

  • test-macosx1015-64-qr/debug-mochitest-devtools-chrome-1
    • 4 of 4 failed on the same (retriggered) task (DVO4Z5eXShiR4eQVTksBBA, ePASrfCLRWW7aHFEiTiVeA, LSSU1H_VQteoNw7yAN4I5w, BbpCiSvqQHqgRzLjkTjy7A)
  • test-windows10-64-2004-qr/debug-mochitest-devtools-chrome-spi-nw-1
    • 4 of 4 failed on the same (retriggered) task (Fdm8TcDcS6q_W9ofDLxXzQ, K77eqF6-SImSJch9vs-5EQ, efFr0rCxTWGeYWexd-d2vQ, AVGhTfOdS8mxvRdRkVbsIg)
  • test-windows10-64-2004-qr/debug-mochitest-devtools-chrome-1
    • 4 of 4 failed on the same (retriggered) task (FgRjH0BLTOag1hUB33d94A, JNGQs9bPR0uH2u93uUEeug, ZCUOVZabQsaoMS3Cr7f5KA, bi8jWMoXQm2rHBEZu-beLA)
  • test-linux1804-64-qr/debug-mochitest-devtools-chrome-1
    • 4 of 4 failed on the same (retriggered) task (H6XrIzduTe2WlYYuGEeiPA, S5LCZoEHQ9iaTkwecb4wXg, UariPlnmRc218Qbr4y6fnw, LoVVqUCwQD6gUrQqR_2JPw)
  • test-linux1804-64-qr/debug-mochitest-devtools-chrome-swr-1
    • 4 of 4 failed on the same (retriggered) task (HlTx2V3zRD-wRz3-LHeFeg, M5kX_a-BQsSm3YsM9RarUQ, PdPX9THUTgSEKRWBx88iMg, AzsWBv1_ReO7zivIjaY94Q)
  • test-macosx1015-64-qr/debug-mochitest-devtools-chrome-spi-nw-1
    • 4 of 4 failed on the same (retriggered) task (cBhTQJAzS32S_c2TphFdLg, MfIApJsdSv26hJsDQl9Sig, HlkaIYzoSBCxW7ZIrb5k5A, UuYHVSJ-Q0eEzAGTiZqVtw)
  • test-linux1804-64-qr/debug-mochitest-devtools-chrome-spi-nw-1
    • 4 of 4 failed on the same (retriggered) task (RIRpLxn4Sl2FU9YebHLmmw, TWUKheC8QOS2Ru13CwAyXw, ZZL8yIoRTCesQfOMda_VEg, AOquG5qQTD6dQ85tsrCdEg)

These failures could mean that the library update changed something and caused
tests to fail. You'll need to review them yourself and decide where to go from here.

In either event, I have done all I can and you will need to take it from here. If you
don't want to land my patch, you can replicate it locally for editing with
./mach vendor toolkit/components/pdfjs/moz.yaml

When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.

No longer blocks: 1392460
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: