Update PDF.js to new version f2c9b64cb2001fd36ccabed09f32d43420f03b50 from 2023-10-07 16:26:28
Categories
(Firefox :: PDF Viewer, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox120 | --- | affected |
People
(Reporter: update-bot, Assigned: update-bot)
Details
(Whiteboard: [3pl-filed][task_id: RSS1uzGRQSC81ZbqKRiaew])
Attachments
(1 obsolete file)
This update covers 25 commits. Here are the overall diff statistics, and then the commit information.
browser/locales/en-US/pdfviewer/viewer.properties | 18 +
toolkit/components/pdfjs/content/build/pdf.js | 15332 --
toolkit/components/pdfjs/content/build/pdf.mjs | 14895 ++
toolkit/components/pdfjs/content/build/pdf.scripting.js | 4260 -
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4003 +
toolkit/components/pdfjs/content/build/pdf.worker.js | 58303 -----------
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 56912 ++++++++++
toolkit/components/pdfjs/content/web/debugger.css | 28 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 70 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.html | 4 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.js | 9786 -
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 9487 +
toolkit/components/pdfjs/content/web/viewer.css | 220 +-
toolkit/components/pdfjs/content/web/viewer.html | 4 +-
toolkit/components/pdfjs/content/web/viewer.js | 13134 --
toolkit/components/pdfjs/content/web/viewer.mjs | 12707 ++
toolkit/components/pdfjs/moz.yaml | 4 +-
17 files changed, 98187 insertions(+), 100980 deletions(-)
8bd3cc031359eab0ec175f677bfc62a1a9886f2f by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/8bd3cc031359eab0ec175f677bfc62a1a9886f2f
Authored: 2023-10-07 16:30:27 +0200
Committed: 2023-10-07 16:52:47 +0200
[api-minor] Stop polyfilling structuredClone
in legacy builds
Comparing the currently supported browsers/environments, see the FAQ and the MDN compatibility data, the structuredClone
polyfill is only needed in Google Chrome versions < 98. Because of some limitations in the core-js polyfill we're currently forced to special-case the transfer
handling to prevent bugs, and it'd be nice to avoid that.
Note that structuredClone
, with transfers, is only used in two spots:
- The
LoopbackPort
class, which is only used with fake workers. Given that fake workers should never be used in browsers, breaking that edge-case in older Google Chrome versions seem fine. - The
AnnotationStorage
class, when Stamp-annotations have been added to the document. Given that Google Chrome isn't the main focus of development, breaking part of the editing-functionality in older Google Chrome versions should hopefully be acceptable.
Files Modified:
- gulpfile.mjs
- src/display/annotation_storage.js
- src/display/api.js
4b489cd4e68591063fe81ca908401c18d8dd56e9 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/4b489cd4e68591063fe81ca908401c18d8dd56e9
Authored: 2023-10-06 17:26:14 +0200
Committed: 2023-10-07 15:27:26 +0200
Output pdf.scripting.js
as a JavaScript module (PR 17055 follow-up)
To avoid problems with export
statements in the QuickJS Javascript Engine, we can work-around that by explicitly exposing pdfjsScripting
globally instead.
Files Modified:
- gulpfile.mjs
- src/pdf.scripting.js
927e50f5d48a67e76f2a51c112ea5a98867822fe by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/927e50f5d48a67e76f2a51c112ea5a98867822fe
Authored: 2023-09-28 13:00:10 +0200
Committed: 2023-10-07 09:31:08 +0200
[api-major] Output JavaScript modules in the builds (issue 10317)
At this point in time all browsers, and also Node.js, support standard import
/export
statements and we can now finally consider outputting modern JavaScript modules in the builds.[1]
In order for this to work we can only use proper import
/export
statements throughout the main code-base, and (as expected) our Node.js support made this much more complicated since both the official builds and the GitHub Actions-based tests must keep working.[2]
One remaining issue is that the pdf.scripting.js
file cannot be built as a JavaScript module, since doing so breaks PDF scripting.
Note that my initial goal was to try and split these changes into a couple of commits, however that unfortunately didn't really work since it turned out to be difficult for smaller patches to work correctly and pass (all) tests that way.[3]
This is a classic case of every change requiring a couple of other changes, with each of those changes requiring further changes in turn and the size/scope quickly increasing as a result.
One possible "issue" with these changes is that we'll now only output JavaScript modules in the builds, which could perhaps be a problem with older tools. However it unfortunately seems far too complicated/time-consuming for us to attempt to support both the old and modern module formats, hence the alternative would be to do "nothing" here and just keep our "old" builds.[4]
[1] The final blocker was module support in workers in Firefox, which was implemented in Firefox 114; please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
[2] It's probably possible to further improve/simplify especially the Node.js-specific code, but it does appear to work as-is.
[3] Having partially "broken" patches, that fail tests, as part of the commit history is really not a good idea in general.
[4] Outputting JavaScript modules was first requested almost five years ago, see issue 10317, and nowadays there should be much better support for JavaScript modules in various tools.
Files Modified:
- external/dist/webpack.js
- gulpfile.mjs
- src/display/api.js
- src/display/display_utils.js
- src/display/node_stream.js
- src/display/node_utils.js
- src/pdf.js
- src/pdf.worker.entry.js
- test/driver.js
- test/test_slave.html
- test/unit/api_spec.js
- test/unit/jasmine-boot.js
- test/unit/pdf_spec.js
- test/unit/scripting_spec.js
- web/app.js
- web/app_options.js
- web/generic_scripting.js
- web/pdfjs.js
- web/viewer-geckoview.html
- web/viewer-snippet-chrome-extension.html
- web/viewer-snippet-firefox-extension.html
- web/viewer-snippet.html
- web/viewer.html
0a970ee4434e62ed9ab5f134a9fc86ba8da81247 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/0a970ee4434e62ed9ab5f134a9fc86ba8da81247
Authored: 2023-09-30 13:25:47 +0200
Committed: 2023-10-06 12:12:30 +0200
[api-major] Remove the fallbackWorkerSrc
functionality in browsers
The user should always provide a correct GlobalWorkerOptions.workerSrc
value when using the PDF.js library in browser environments. Note that the fallback:
- Has been deprecated ever since PR 11418, first released in version
2.4.456
over three years ago. - Was always a best-effort solution, with no guarantees that it'd actually work correctly.
- With upcoming changes, w.r.t. outputting JavaScript modules, it'd now be more diffiult to determine the correct value.
Files Modified:
- src/display/api.js
8158628a9085c6c989e82c9b2631c8ecc819e0a7 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/8158628a9085c6c989e82c9b2631c8ecc819e0a7
Authored: 2023-09-28 10:07:26 +0200
Committed: 2023-10-06 12:12:30 +0200
[api-minor] Stop building a minified default viewer
The minified default viewer has never been distributed in either official releases or through pdfjs-dist, which means that it's most likely unused, and it's has never been tested nor actively maintained.
Files Deleted:
- web/viewer-snippet-minified.html
Files Modified:
- gulpfile.mjs
- web/viewer.html
4ebddcb09252e26ce299207b32df02b784191c9b by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/4ebddcb09252e26ce299207b32df02b784191c9b
Authored: 2023-10-06 09:50:03 +0200
Committed: 2023-10-06 09:50:03 +0200
Remove unnecessary alpha-value from CSS rgb
colors
Setting the alpha-value explicitly to 1
in rgb
colors is unnecessary, since that's the default value, and this way we ever so slightly reduce the size of our CSS files.
Unfortunately I've not found a Stylelint rule to enforce this automatically, and the patch was generated using search and replace.
Files Modified:
- test/annotation_layer_builder_overrides.css
- test/xfa_layer_builder_overrides.css
- web/annotation_layer_builder.css
- web/debugger.css
- web/pdf_viewer.css
- web/text_layer_builder.css
- web/viewer-geckoview.css
- web/viewer.css
- web/xfa_layer_builder.css
ea5eafa265c2062cb0d7c0a04f05fa193b5939af by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/ea5eafa265c2062cb0d7c0a04f05fa193b5939af
Authored: 2023-10-05 19:25:36 +0200
Committed: 2023-10-05 22:49:15 +0200
[Editor] Add the possibility to create a new editor in using the keyboard (bug 1853424)
When an editing button is disabled, focused and the user press Enter (or space), an
editor is automatically added at the center of the current page.
Next creations can be done in using the same keys within the focused page.
Files Modified:
- src/display/editor/editor.js
- src/display/editor/tools.js
- test/integration/freetext_editor_spec.js
- web/pdf_viewer.js
- web/toolbar.js
3263fd0307d311e1e140d44f454a514fa1003022 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/3263fd0307d311e1e140d44f454a514fa1003022
Authored: 2023-10-05 11:32:07 +0200
Committed: 2023-10-05 18:33:03 +0200
Make the toolbar buttons usable with keyboard when Page Fit is used
Files Modified:
- web/app.js
4277205d7833d6fe89cb43ea3a4d3313cb4157d7 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/4277205d7833d6fe89cb43ea3a4d3313cb4157d7
Authored: 2023-10-05 17:43:56 +0200
Committed: 2023-10-05 17:51:21 +0200
Enable some Stylelint color-related rules to slightly reduce file sizes
- Use a consistent format for all alpha-values (this rule didn't require any code changes); see https://stylelint.io/user-guide/rules/alpha-value-notation
- Use modern and slightly shorter color notation, since according to MDN that should be supported "everywhere" nowadays; see https://stylelint.io/user-guide/rules/color-function-notation/
- Use "short" hexadecimal colors whenever possible; see https://stylelint.io/user-guide/rules/color-hex-length/
- Help avoid adding broken hexadecimal colors (this rule didn't require any code changes); see https://stylelint.io/user-guide/rules/color-no-invalid-hex/
Files Modified:
- .stylelintrc
- examples/mobile-viewer/viewer.css
- test/annotation_layer_builder_overrides.css
- test/text_layer_test.css
- test/xfa_layer_builder_overrides.css
- web/annotation_editor_layer_builder.css
- web/annotation_layer_builder.css
- web/debugger.css
- web/pdf_viewer.css
- web/text_layer_builder.css
- web/viewer-geckoview.css
- web/viewer.css
- web/xfa_layer_builder.css
e737638a404b3aa9d66f73d6a688eccaf6b6ee91 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/e737638a404b3aa9d66f73d6a688eccaf6b6ee91
Authored: 2023-10-05 14:01:34 +0200
Committed: 2023-10-05 14:01:34 +0200
Add a HTML containter for locked FreeText annotations in order to be able to display a popup (follow-up iof #17070)
Files Modified:
- src/core/annotation.js
- src/display/annotation_layer.js
335cea22b32f3cf953b96faf0b415f2f4210344d by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/335cea22b32f3cf953b96faf0b415f2f4210344d
Authored: 2023-10-04 21:30:06 +0200
Committed: 2023-10-04 21:30:06 +0200
[Editor] Add role=spinbutton to resizers when they're used with the keyboard
Files Modified:
- src/display/editor/editor.js
40b1d92044fa0cdd7f98b7b9f5724077cfc5f88e by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/40b1d92044fa0cdd7f98b7b9f5724077cfc5f88e
Authored: 2023-10-04 14:25:05 +0200
Committed: 2023-10-04 18:06:21 +0200
Update the noHTML flag to take into account the hasOwnCanvas one (fixes #17069)
When an element has the hasOwnCanvas flag we must have an HTML container to attach
the canvas where the element will be rendered.
So the noHTML flag must take this information into account:
- in some cases the noHTML flag is resetted depending on the hasOwnCanvas value;
- in some others, the hasOwnCanvas flag is set depending on the value of noHTML.
Files Added:
- test/pdfs/issue17069.pdf
Files Modified:
- src/core/annotation.js
- test/pdfs/.gitignore
- test/test_manifest.json
05ca3fd99b25dbc248ae94b1debaafadd3a9704a by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/05ca3fd99b25dbc248ae94b1debaafadd3a9704a
Authored: 2023-10-03 15:02:54 +0200
Committed: 2023-10-04 12:57:37 +0200
[Editor] Support resizing editors with the keyboard (bug 1854340)
Files Modified:
- l10n/en-US/viewer.properties
- src/display/editor/editor.js
- src/display/editor/tools.js
- test/integration/stamp_editor_spec.js
- web/l10n_utils.js
bf9c33e60f810c328aca152e0548ece44c9fb93f by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/bf9c33e60f810c328aca152e0548ece44c9fb93f
Authored: 2023-10-03 08:01:55 +0200
Committed: 2023-10-04 11:14:23 +0200
Add support for "GoToE" actions with destinations (issue 17056)
This shouldn't be very common in practice, since "GoToE" actions themselves seem quite uncommon; see PR 15537.
Files Added:
- test/pdfs/issue17056.pdf
Files Modified:
- src/core/catalog.js
- src/display/annotation_layer.js
- test/pdfs/.gitignore
- test/unit/api_spec.js
- web/download_manager.js
- web/firefoxcom.js
1be9bbd2e1d0d53d3211d0a9e7d19051dbf77cc9 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/1be9bbd2e1d0d53d3211d0a9e7d19051dbf77cc9
Authored: 2023-10-03 22:46:50 +0200
Committed: 2023-10-03 23:50:59 +0200
Compute correctly the bounding box of a transformed rectangle (fixes #17065)
Files Added:
- test/pdfs/issue17065.pdf
Files Modified:
- src/display/canvas.js
- test/pdfs/.gitignore
- test/test_manifest.json
f113320bd5ce052fe250b5c647446f7d1c994ff0 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/f113320bd5ce052fe250b5c647446f7d1c994ff0
Authored: 2023-10-03 20:06:19 +0200
Committed: 2023-10-03 21:26:08 +0200
Ensure that readonly TextWidget-annotations are rendered when forms are disabled (issue 17064)
To reduced the risk of regressing something else, given that the issue only applies to a (for the default viewer) non-default configuration, this patch is purposely limited to only TextWidget-annotations in the display layer.
Files Added:
- test/pdfs/issue17064_readonly.pdf
Files Modified:
- src/display/annotation_layer.js
- test/pdfs/.gitignore
- test/test_manifest.json
9cca13bb039a4da220ac30827187a397856b0c2f by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/9cca13bb039a4da220ac30827187a397856b0c2f
Authored: 2023-10-03 15:57:54 +0200
Committed: 2023-10-03 15:57:54 +0200
Bump library version to 4.0
Files Modified:
- pdfjs.config
bb59f445a999de779d3839dfed571d70a4831881 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/bb59f445a999de779d3839dfed571d70a4831881
Authored: 2023-10-02 22:45:36 +0200
Committed: 2023-10-03 11:55:18 +0200
Remove timeouts from the copy_paste integration test
Files Modified:
- test/integration/copy_paste_spec.js
- test/integration/test_utils.js
e3fbe2908aa823a47950a631163e26132b7f117a by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/e3fbe2908aa823a47950a631163e26132b7f117a
Authored: 2023-10-02 20:30:27 +0200
Committed: 2023-10-02 23:28:11 +0200
[Editor] Use the alt text to descibe the canvas used to display the image
Files Modified:
- src/display/editor/editor.js
- src/display/editor/stamp.js
- test/integration/stamp_editor_spec.js
eebd251552ff2435352a0fb4e0f16e0225d235e1 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/eebd251552ff2435352a0fb4e0f16e0225d235e1
Authored: 2023-09-25 17:25:08 +0200
Committed: 2023-10-02 20:34:30 +0200
[Editor] Don't show the alt-text button when the alt-text dialog is visible
This way, the button doens't cover the image.
Files Modified:
- src/display/editor/editor.js
- test/integration/stamp_editor_spec.js
- web/alt_text_manager.js
077d239b96c51e1fe8f5f8550751ec25ded85bc1 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/077d239b96c51e1fe8f5f8550751ec25ded85bc1
Authored: 2023-09-29 22:36:01 +0200
Committed: 2023-10-02 15:04:44 +0200
Fix new intermittent failures with ink and stamp tests
It happens only on windows with chrome.
For any reason, click event isn't correctly triggered and it seems work correctly
with pointerup.
And it seems that when drawing a svg on an OffscreenCanvas we need to wait
a little in order to be able to transfer it: it's why this patch adds
a check on the canvas content.
Files Modified:
- test/integration/ink_editor_spec.js
- test/integration/stamp_editor_spec.js
- test/integration/test_utils.js
3ced0dec1ba41dbf4da1ef6cfd6b3cfe4122d29c by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/3ced0dec1ba41dbf4da1ef6cfd6b3cfe4122d29c
Authored: 2022-01-19 11:43:41 +0100
Committed: 2023-10-01 23:14:29 +0200
[api-major] Remove the SVG back-end (PR 15173 follow-up)
This has been deprecated since version 2.15.349
, which is a year ago.
Removing this will also simplify some upcoming changes, specifically outputting of JavaScript modules in the builds.
Files Deleted:
- examples/node/domstubs.js
- examples/node/pdf2svg.js
- src/display/svg.js
- test/unit/display_svg_spec.js
Files Modified:
- gulpfile.mjs
- src/display/api.js
- src/display/stubs.js
- src/pdf.js
- test/unit/clitests.json
- test/unit/jasmine-boot.js
- test/unit/pdf_spec.js
- test/unit/unit_test.html
- tsconfig.json
- web/pdfjs.js
- web/viewer-geckoview.html
- web/viewer.html
0d9aef1a5ef6e0008e08d323446ce3206bd76024 by Calixte Denizet
https://github.com/mozilla/pdf.js/commit/0d9aef1a5ef6e0008e08d323446ce3206bd76024
Authored: 2023-10-01 16:47:34 +0200
Committed: 2023-10-01 16:47:34 +0200
Add alt-text svg images to the dist (issue #17044)
Files Modified:
- gulpfile.mjs
9624505f0fa884c2f53b41b2c03864098421a9c1 by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/9624505f0fa884c2f53b41b2c03864098421a9c1
Authored: 2023-09-30 11:56:27 +0200
Committed: 2023-09-30 12:10:02 +0200
Use a standard export
statement in the web/pdfjs.js
file
This removes the only remaining old and non-standard handling of exports in the web/
-folder, since some initial attempts at outputting JavaScript modules in the builds have identified this file as a potential problem.
While this uses a hard-coded list, for overall simplicity, I don't believe that that's a big problem since:
- Generating this file automatically would require a bunch more parsing every single time that the library is built.
- The official API-surface doesn't change often enough for this to really impede development in any significant way.
- The added unit-test helps ensure that this list cannot accidentally become outdated.
Files Modified:
- test/unit/pdf_spec.js
- web/pdfjs.js
f87ec67ab1f0280631918a035d460e46eee7622a by Jonas Jenwald
https://github.com/mozilla/pdf.js/commit/f87ec67ab1f0280631918a035d460e46eee7622a
Authored: 2023-07-31 11:20:14 +0200
Committed: 2023-09-23 17:44:09 +0200
[api-major] Remove various deprecated functionality and options
Files Modified:
- src/display/api.js
- src/display/text_layer.js
- web/app.js
- web/pdf_find_controller.js
- web/pdf_page_view.js
- web/pdf_viewer.js
Assignee | ||
Comment 1•1 year ago
|
||
RSS1uzGRQSC81ZbqKRiaew |
I've submitted a try run for this commit: https://treeherder.mozilla.org/jobs?repo=try&revision=e912ccd166f70577f67b8a740b41800d361dc1f9
Assignee | ||
Comment 2•1 year ago
|
||
Updated•1 year ago
|
Comment 3•1 year ago
|
||
I don't see debugger.mjs in the patch.
:Snuflleupagus, is it on purpose or an oblivion ?
Comment 4•1 year ago
|
||
(In reply to Calixte Denizet (:calixte) from comment #3)
I don't see debugger.mjs in the patch.
:Snuflleupagus, is it on purpose or an oblivion ?
That file has always been included as-is, without any building, hence it keeps its original file extension (i.e. debugger.js
in this case).
However, if you think it's better we can obviously rename that file upstream; I can write a patch for that if you want.
Assignee | ||
Comment 5•1 year ago
|
||
KIlfh7o3RT6iZ_b9Kfq4fA |
It looks like we experienced one or more build failures when trying to apply this
update. You will need to apply this update manually; you can replicate the patch
locally with ./mach vendor toolkit/components/pdfjs/moz.yaml
. I'm going to abandon the Phabricator patch and
let you submit a new one.
If the build failure wasn't caused by a library change, and was instead caused by
something structural in the build system please let my maintainers know in
Slack:#secinf.
I do my best to automatically add new files to the build, but some moz.build files
are complicated and you may need to fix them manually.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Description
•