Closed Bug 1803630 Opened 1 year ago Closed 1 year ago

Update PDF.js to new version 6e4968225e3e4901ef08e47d2787c8d0afb72df7 from 2022-12-01 17:56:02

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: update-bot, Assigned: calixte)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

This update covers 20 commits:


eed9bf71c5ee16268986a743a992c61bdbcc89da by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/eed9bf71c5ee16268986a743a992c61bdbcc89da
Authored: 2022-11-21 17:15:39 +0100
Committed: 2022-12-01 18:42:43 +0100

Refactor the text layer code in order to avoid to recompute it on each draw

The idea is just to resuse what we got on the first draw.
Now, we only update the scaleX of the different spans and the other values
are dependant of --scale-factor.
Move some properties in the CSS in order to avoid any updates in JS.

Files Modified:

  • src/display/text_layer.js
  • src/pdf.js
  • test/driver.js
  • test/text_layer_test.css
  • test/unit/text_layer_spec.js
  • web/app.js
  • web/default_factory.js
  • web/interfaces.js
  • web/pdf_page_view.js
  • web/pdf_viewer.js
  • web/text_highlighter.js
  • web/text_layer_builder.css
  • web/text_layer_builder.js

0cf4e6620d2ef7cfcd6481d19686d7846fc16464 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/0cf4e6620d2ef7cfcd6481d19686d7846fc16464
Authored: 2022-12-01 15:43:17 +0100
Committed: 2022-12-01 15:43:17 +0100

Prevent the debugger from breaking on unbalanced save/restore OPS (issue 15767)

Files Modified:

  • web/debugger.js

7c25b1b455e262baa79b38c6563117d91d646aa3 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/7c25b1b455e262baa79b38c6563117d91d646aa3
Authored: 2022-11-29 19:57:38 +0100
Committed: 2022-11-29 19:57:38 +0100

[api-minor] Remove the TextLayer timeout parameter (PR 15742 follow-up)

The deprecation is included in the current release, i.e. version 3.1.81, and given the edge-case nature of this option I really don't think that we need to keep it deprecated for multiple releases.

Files Modified:

  • src/display/text_layer.js
  • web/text_layer_builder.js

20fd9099f8319a9272ac57342317172048e95c72 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/20fd9099f8319a9272ac57342317172048e95c72
Authored: 2022-11-29 16:37:02 +0100
Committed: 2022-11-29 17:34:06 +0100

[Annotation] Send correctly the updated values to the JS sandbox

Files Added:

  • test/pdfs/issue15753.pdf

Files Modified:

  • src/display/annotation_layer.js
  • test/integration/scripting_spec.js
  • test/pdfs/.gitignore

8689905a197ab3c338c1cc4cffb34c490df0b5cb by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/8689905a197ab3c338c1cc4cffb34c490df0b5cb
Authored: 2022-11-21 19:43:12 +0100
Committed: 2022-11-29 15:48:55 +0100

[Editor] Change the text annotation cursor for the high dpi screens.

Files Added:

  • web/images/cursor-editorFreeText.svg

Files Modified:

  • web/annotation_editor_layer_builder.css

0d648f531bad45af13df443efeba5a9e8f8e2e7c by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/0d648f531bad45af13df443efeba5a9e8f8e2e7c
Authored: 2022-11-29 13:51:40 +0100
Committed: 2022-11-29 14:08:01 +0100

Ignore PDF documents opened from "data:"-URLs when handling internal links (bug 1803050)

This patch has been successfully tested in a local, artifact, Firefox build.

Please note: The only thing that'll no longer work for PDF documents opened using "data:"-URLs is middle-clicking on internal/outline links, in order to open the destination in a new tab. This is however an extremely small loss of functionality, and as can be seen in the bug the alternative (i.e. doing nothing) is surely much worse.

Files Modified:

  • src/pdf.js
  • web/app.js
  • web/viewer.html

82d127883d0e9369e8227cb34ad2a859df6130ee by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/82d127883d0e9369e8227cb34ad2a859df6130ee
Authored: 2022-11-29 12:14:40 +0100
Committed: 2022-11-29 12:14:40 +0100

Stop duplicating the platform getter in multiple files

Currently both of the AnnotationElement and KeyboardManager classes contain identical platform getters, which seems like unnecessary duplication.
With the pre-processor we can also limit the feature-testing to only GENERIC builds, since navigator should always be available in browsers.

Files Modified:

  • src/display/annotation_layer.js
  • src/display/editor/annotation_editor_layer.js
  • src/display/editor/editor.js
  • src/display/editor/tools.js
  • src/shared/util.js

ea1995991ba7d268f95a8d02a42e678db714621f by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/ea1995991ba7d268f95a8d02a42e678db714621f
Authored: 2022-11-29 10:46:48 +0100
Committed: 2022-11-29 10:46:48 +0100

Don't add an extra space after a Katakana or a Hiragana at the eol when searching

Files Added:

  • test/pdfs/issue15759.pdf

Files Modified:

  • test/pdfs/.gitignore
  • test/unit/pdf_find_controller_spec.js
  • web/pdf_find_controller.js

b9cb651c44f0012ac90b8c24e5b38acc840a8a29 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/b9cb651c44f0012ac90b8c24e5b38acc840a8a29
Authored: 2022-11-28 18:24:26 +0100
Committed: 2022-11-28 20:55:15 +0100

[api-minor] Remove all the useless telemetry stuff in the viewer (bug 1802468)

Add a deprecation notification for PDFDocumentLoadingTask.onUnsupportedFeature and PDFDocumentProxy.stats
which are likely useless.
The unsupported feature stuff have initially been added in (#4048) in order to be able to display a
warning bar and to help to have some numbers to know how a feature was used.
Those data are no more used in Firefox.

Files Modified:

  • src/display/api.js
  • web/app.js

ae7da6ae480f97e8a7b14fdadd9deeef0ce8790f by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/ae7da6ae480f97e8a7b14fdadd9deeef0ce8790f
Authored: 2022-11-28 15:53:17 +0100
Committed: 2022-11-28 16:24:01 +0100

[JS] By default, a text field value must be treated as a number (bug 1802888)

Files Added:

Files Modified:

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

4ee0c83548e9cf2fd86a5636fd52cacffc950512 by Calixte Denizet

https://github.com/mozilla/pdf.js/commit/4ee0c83548e9cf2fd86a5636fd52cacffc950512
Authored: 2022-11-28 14:27:50 +0100
Committed: 2022-11-28 14:37:15 +0100

[JS] Fix a rounding issue in printf (bug 1802888)

Files Modified:

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

85f03c0ea447b1c4a4564d086f96c1efea0963fd by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/85f03c0ea447b1c4a4564d086f96c1efea0963fd
Authored: 2022-11-27 12:19:11 +0100
Committed: 2022-11-27 12:19:11 +0100

Slightly modernize the FontLoader.isSyncFontLoadingSupported getter

This is very old code, which is unused (by default) in browsers nowadays since the Font Loading API will always be preferred.
For Node.js environments we use the same constant as elsewhere throughout the code-base, and we can also simplify the Firefox-specific check given that the lowest supported version is 102 (as of this writing).

Finally the old TODO is removed, since the general availability of the Font Loading API has made it redundant.

Files Modified:

  • src/display/font_loader.js

6aa8c3bd3ffd008f45a64c538ef0ca839caf2758 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/6aa8c3bd3ffd008f45a64c538ef0ca839caf2758
Authored: 2022-11-27 10:22:14 +0100
Committed: 2022-11-27 10:22:14 +0100

Update l10n files

Files Modified:

  • l10n/cy/viewer.properties
  • l10n/da/viewer.properties
  • l10n/el/viewer.properties
  • l10n/tg/viewer.properties
  • l10n/th/viewer.properties

69a2e6d3ea93fa2a4a5f9973f83f40ac416c353b by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/69a2e6d3ea93fa2a4a5f9973f83f40ac416c353b
Authored: 2022-11-27 10:18:30 +0100
Committed: 2022-11-27 10:18:30 +0100

Update npm packages

Files Modified:

  • package-lock.json
  • package.json

67f1a5b59a166dce17ca080fe9e80b3fdcafc5d4 by Tim van der Meij

https://github.com/mozilla/pdf.js/commit/67f1a5b59a166dce17ca080fe9e80b3fdcafc5d4
Authored: 2022-11-26 14:52:56 +0100
Committed: 2022-11-26 14:52:56 +0100

Bump versions in pdfjs.config

Files Modified:

  • pdfjs.config

aa5b678f94cb130061c9e19b37d05acfcf8f52b4 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/aa5b678f94cb130061c9e19b37d05acfcf8f52b4
Authored: 2022-11-25 17:00:57 +0100
Committed: 2022-11-26 11:24:59 +0100

Add default icons for FileAttachment annotations (bug 1230933)

Please note: This "borrows" the icons from Thunderbird.

According to the PDF specification, see https://web.archive.org/web/20220309040754if_/https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2096626, we should be providing default icons for FileAttachment annotations without appearances.

Files Added:

  • test/pdfs/bug1230933.pdf.link
  • web/images/annotation-paperclip.svg
  • web/images/annotation-pushpin.svg

Files Modified:

  • src/core/annotation.js
  • src/display/annotation_layer.js
  • test/test_manifest.json

37c2408199974a71f1e7d52bb04ecf3f2ff1fd65 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/37c2408199974a71f1e7d52bb04ecf3f2ff1fd65
Authored: 2022-11-22 10:37:24 +0100
Committed: 2022-11-26 10:06:29 +0100

Ensure that the initial document position is always correct with non-default Scroll/Spread modes (issue 15695)

Please refer to the inline comment for additional details. The patch also improves internal consistency when #scrollIntoView is called directly.

Files Modified:

  • web/pdf_viewer.js

4b02610e8c58d6c3c1f313f2a7c8f1f25bac1f1e by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/4b02610e8c58d6c3c1f313f2a7c8f1f25bac1f1e
Authored: 2022-11-20 18:16:27 +0100
Committed: 2022-11-25 10:40:16 +0100

Re-factor and simplify the getQuadPoints helper function

The use of Array.prototype.reduce() is, in my opinion, hurting overall readability since it's not particularly easy to look at the relevant code and immediately understand what's going on here. Furthermore this code leads to strictly speaking unnecessary allocations and parsing, since we could just track the min/max values directly in the relevant loop instead.

Files Modified:

  • src/core/annotation.js

b3e161c328bf1bce24300e8f23d20c754292e284 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/b3e161c328bf1bce24300e8f23d20c754292e284
Authored: 2022-11-24 22:48:30 +0100
Committed: 2022-11-24 23:08:39 +0100

[api-minor] Deprecate the TextLayer timeout parameter

This has never really been used anywhere within the PDF.js library[1], and when streaming of textContent was introduced this parameter was effectively made redundant.
Note that when streaming of textContent is used, all text-layout has already happened by the time that this timeout-functionality is actually invoked (thus making it pointless).
While the timeout-functionality may still "work" when the textContent is provided upfront, although it's never been used/tested, streaming will generally perform better (in e.g. a viewer setting).

Please note: While unrelated here, also removes a now unused property that I forgot in PR 15259.


[1] At least not since the code was moved into its current file, which happened in PR 6619 and landed seven years ago.

Files Modified:

  • src/display/text_layer.js

d1c01b31648b1e2679a7ad98623b7d25ffb08e09 by Jonas Jenwald

https://github.com/mozilla/pdf.js/commit/d1c01b31648b1e2679a7ad98623b7d25ffb08e09
Authored: 2022-11-23 15:51:18 +0100
Committed: 2022-11-23 15:51:18 +0100

Add a fallback for non-embedded composite Tahoma fonts (issue 15719)

Files Added:

  • test/pdfs/issue15719.pdf.link

Files Modified:

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

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

Lint Jobs Failed:
- source-test-mozlint-file-perm (OqPArj0US-aJo1sRnVGgQA)

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 (TPB0rE8jQ7GIITkfokLeYw)
- test-windows10-64-2004-qr/opt-mochitest-plain-condprof-1 (Ow6m0C0sQbanm8cR7Vi20g)

Needs Investigation (Other Failed Jobs):
test-windows10-64-2004-qr/debug-mochitest-devtools-chrome-spi-nw-1
- 4 of 4 failed on the same (retriggered) task (Tk6vwxV0TFC9K-AdbaV_1Q, FB_0tqnJSs2UUIe4DgaZ7w, b6izc8BQTTmu01JANmUhkA, Q6j-_FaTRwefzG_IMneLvA)
test-macosx1015-64-qr/debug-mochitest-devtools-chrome-1
- 4 of 4 failed on the same (retriggered) task (NPMZXcCWQbOHTP_GoSqXRQ, VqvOa_bdQ5K2ABGd6W0VnQ, ZRvsOJcPTSekb6bYP3p6tQ, f3zV5M3PSxabQ_Gc2hEKPQ)
test-windows10-64-2004-qr/debug-mochitest-devtools-chrome-1
- 4 of 4 failed on the same (retriggered) task (TnN0PzcZTFyUjLsvgllyIg, GhRrn1-RSsWGqQ5-AOdNvA, KhYDexLzQeyvZp--aH3cDw, QdJSicoYRkyrBXTwAIovhw)
test-macosx1015-64-qr/debug-mochitest-devtools-chrome-spi-nw-1
- 4 of 4 failed on the same (retriggered) task (Q8YKTCZwS8e3bJcRPQ3KKg, a59v6cKjSTu7WneH1UAUCA, H5IC_GKCRyqUluHuza7EWg, Lr54XmtHT4Ctg984jdLeBA)
test-linux1804-64-qr/debug-mochitest-devtools-chrome-spi-nw-1
- 4 of 4 failed on the same (retriggered) task (TUQE2UNGT3O3N5GC0BHHXg, Sv2CI8RjRPizLkQqJeKnag, a1lisJA_SZ6YXKFKlDO4nQ, apBnrQsCSf6vPWCjPRVK5w)
test-linux1804-64-qr/debug-mochitest-devtools-chrome-1
- 4 of 4 failed on the same (retriggered) task (U4Ob24vNR4-7CimjDO3DCg, dvbh6hjKR-2PI3PEpdMfhQ, Ka0AmyBtTOK0AWzepr17jA, SjGFeY3pSR6gk2Bt0dOL8g)
test-linux1804-64-qr/debug-mochitest-devtools-chrome-swr-1
- 4 of 4 failed on the same (retriggered) task (XSYXIfJkRwmVJMuFSTs4Ag, E3F4GLTrStClJzZMLAw-ag, F073zwB2RQOPdZS5zqd1lQ, fWqwWUqjR8CWY22S8PuNwg)
source-test-mozlint-file-perm
- 1 of 1 failed on the same (retriggered) task (OqPArj0US-aJo1sRnVGgQA)

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.

Assignee: nobody → cdenizet
Flags: needinfo?(cdenizet)
Attachment #9306276 - Attachment description: Bug 1803630 - Update PDF.js to 6e4968225e3e4901ef08e47d2787c8d0afb72df7 → Bug 1803630 - Update PDF.js to 6e4968225e3e4901ef08e47d2787c8d0afb72df7 r=#pdfjs-reviewers
Pushed by cdenizet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a88ac51c349d
Update PDF.js to 6e4968225e3e4901ef08e47d2787c8d0afb72df7 r=pdfjs-reviewers,marco
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Flags: needinfo?(cdenizet)
Regressions: 1811694
Regressions: 1815391
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: