Commit Graph

17797 Commits

Author SHA1 Message Date
calixteman
1e69b6a03d
Merge pull request #16726 from calixteman/gv_fix_dl_button
[GeckoView] Fix string for download button
2023-07-24 09:54:41 +02:00
Tim van der Meij
4a0468a601
Merge pull request #16730 from timvandermeij/vinyl-fs
Remove the `vinyl-fs` dependency
2023-07-23 18:43:28 +02:00
Tim van der Meij
b7b3636ec2
Remove the vinyl-fs dependency
In Gulp 4, which we use for years now, the `gulp.src()` function
supports the `removeBOM` option to disable the default BOM stripping,
so this commit uses that to get rid of our `vinyl-fs` dependency.

Note that this actually makes disabling BOM stripping work again. It's
currently broken because in `vinyl-fs` 3, that we already use since 2018
in commit 95de23e, the `stripBOM` option was renamed to `removeBOM`, so
the current code doesn't actually disable BOM stripping which we now
confirmed and sadly broke for years without anyone noticing. Most likely
this is because the BOM is not required for UTF-8 documents, but while
not necessary it also can't hurt to have it for tools that use it to
determine if a document is UTF-8.
2023-07-23 18:33:20 +02:00
Tim van der Meij
8b2380823c
Merge pull request #16729 from Snuffleupagus/rm-useOnlyCssZoom-pref
Remove the `useOnlyCssZoom` preference
2023-07-23 13:32:09 +02:00
Tim van der Meij
7e8ee4f0b9
Merge pull request #16728 from Snuffleupagus/update-packages
Update packages and translations
2023-07-23 13:30:34 +02:00
Jonas Jenwald
66645d30cc Remove the useOnlyCssZoom preference
*Please note:* This only removes the preference itself, however both the viewer-option and the actual implementation is still available.

The `useOnlyCssZoom` functionality was only ever used, by default, in the PDF Viewer for the B2G/FirefoxOS project (which was abandoned years ago). Given that CSS-only zooming can easily make the document look blurry even at low zoom levels, this functionality was only intended for low-powered mobile devices.
Hence it seems reasonable to remove the `useOnlyCssZoom` preference now, since neither the default viewer nor the GeckoView-specific viewer uses this functionality.
2023-07-23 11:20:36 +02:00
Jonas Jenwald
fd6b9d7b48 Update l10n files 2023-07-23 09:54:11 +02:00
Jonas Jenwald
c073484241 Update npm packages 2023-07-23 09:49:53 +02:00
Calixte Denizet
33fdec1392 Don't replace Acroform dictionary if nothing has changed when saving (bug 1844572) 2023-07-22 17:51:06 +02:00
Calixte Denizet
74642b59af [GeckoView] Fix string for download button 2023-07-22 16:54:48 +02:00
Tim van der Meij
aed7f6edcf
Merge pull request #16725 from Snuffleupagus/stylelint-update
Update Stylelint to the latest version
2023-07-22 13:55:52 +02:00
Tim van der Meij
4f72251322
Merge pull request #16724 from Snuffleupagus/eslint-no-var-firefox
Enable the ESLint `no-var rule` in the `extensions/firefox/` folder
2023-07-22 13:53:58 +02:00
Jonas Jenwald
198f89ffce Update Stylelint to the latest version
Trying to update Stylelint to version `15.10.1`, and beyond, broke linting. Looking at the changes the issue appears to be that the `bin/stylelint.js` file was replaced with `bin/stylelint.mjs` instead, which our `gulp lint` runner wasn't able to automatically find; see https://github.com/stylelint/stylelint/compare/15.10.0...15.10.1
2023-07-22 11:34:14 +02:00
Jonas Jenwald
8a2320bd18 Use modern JavaScript more in the extensions/firefox/tools/l10n.js file
- Introduce optional chaining in a few spots.
 - Use more logical OR assignment in the code.
2023-07-22 10:12:43 +02:00
Jonas Jenwald
25cb4883e9 Enable the ESLint no-var rule in the extensions/firefox/ folder
This was done automatically, using the `gulp lint --fix` command.
2023-07-22 10:05:37 +02:00
Jonas Jenwald
6d783d2722
Merge pull request #16715 from Snuffleupagus/eslint-no-lonely-if
Enable the `no-lonely-if` ESLint rule
2023-07-22 09:33:48 +02:00
Jonas Jenwald
c018070e80 Enable the no-lonely-if ESLint rule
These changes were mostly done automatically, using `gulp lint --fix`, and only a few spots with comments needed manual tweaking; please see https://eslint.org/docs/latest/rules/no-lonely-if
2023-07-21 20:10:44 +02:00
Jonas Jenwald
abb24f82fb
Merge pull request #16714 from TaTo30/xfa-select-storage
XFA - Set storage values to select and option elements
2023-07-21 20:09:32 +02:00
TaTo30
18619ce4c9 [XFA] Update select and option element attributes with the stored data and
removes the 'selected' attribute from option element if it's not actually selected.
2023-07-21 10:32:33 -06:00
calixteman
d74b68cd09
Merge pull request #16722 from calixteman/dont_set_filter
Don't uselessly change the filter when drawing (bug 1508765)
2023-07-21 14:37:54 +02:00
calixteman
d9278200d7
Merge pull request #16721 from calixteman/bug1844583
Don't get the text content for an annotation when /NeedAppearances is true (bug 1844583)
2023-07-21 13:54:50 +02:00
Calixte Denizet
9a4750fee5 Don't uselessly change the filter when drawing
When profiling the pdf in https://bugzilla.mozilla.org/show_bug.cgi?id=1508765,
I noticed that half a second was spent to set the filter to "none".
2023-07-21 13:29:29 +02:00
Calixte Denizet
d470e91223 Don't get the text content for an annotation when /NeedAppearances is true (bug 1844583)
When the flag is set, the appearance has to be generated from the value so it's
useless/meaningless to extract the content from the existing appearance.
2023-07-21 12:26:27 +02:00
calixteman
1a69b6ad64
Merge pull request #16720 from calixteman/bug1844576
Text annotations must use their own canvas when their appearance is generated (bug 1844576)
2023-07-21 10:30:55 +02:00
Calixte Denizet
9277801493 Text annotations must use their own canvas when their appearance is generated (bug 1844576)
When a pdf has /NeedAppearances set to true, the annotation appearance must be
generated from its value and we must take into account the hasOwnCanvas property.
2023-07-21 09:51:50 +02:00
calixteman
2a508b95e1
Merge pull request #16719 from calixteman/bug1844625
[Editor] Allow to delete an editor in using the Delete key (aka fn+backspace) (bug 1844625)
2023-07-20 19:42:38 +02:00
Calixte Denizet
cd97fcb414 [Editor] Allow to delete an editor in using the Delete key (aka fn+backspace) (bug 1844625) 2023-07-20 19:08:54 +02:00
Jonas Jenwald
7220b93911
Merge pull request #16717 from Snuffleupagus/saveDocument-resetNewTemporaryRef
Don't reset temporary XRef-entries during saving (PR 16392 follow-up)
2023-07-20 17:58:18 +02:00
Jonas Jenwald
88524bf9ae Don't reset temporary XRef-entries during saving (PR 16392 follow-up)
*Please note:* I'm not aware of any bugs caused by this, however that might be more luck than anything else.

In PR 16392 the `incrementalUpdate` function, and all of its various helpers, were made asynchronous. However the call-site in `src/core/worker.js` wasn't updated, which means that we currently reset temporary XRef-entries while saving is ongoing.
2023-07-20 15:49:59 +02:00
calixteman
0702663b7d
Merge pull request #16492 from calixteman/clip_path
[Annotation] Use the clip-path property when an annotation has some quad points
2023-07-20 15:01:27 +02:00
Calixte Denizet
8daf2f1eb1 [Annotation] Use the clip-path property when an annotation has some quad points
This way it'll avoid to split a div in multiple divs having the same id (which
is supposed to be unique).
2023-07-20 10:53:23 +02:00
calixteman
dca4bc0f24
Merge pull request #16713 from calixteman/draw_bg
Draw correctly background images in ref tests
2023-07-19 21:18:04 +02:00
Calixte Denizet
7cd062ec68 Draw correctly background images in ref tests
It's a workaround for bug https://bugzilla.mozilla.org/show_bug.cgi?id=1844414.
It should be reverted (in order to avoid a perf penalty) once the bug is fixed
in Firefox.
2023-07-19 20:29:54 +02:00
calixteman
9f390755b0
Merge pull request #16709 from calixteman/bug1844293
[Editor] Bind redo action on meta+shift+z on mac (bug 1844293)
2023-07-19 12:01:58 +02:00
Calixte Denizet
295eb13a44 [Editor] Bind redo action on meta+shift+z on mac (bug 1844293) 2023-07-19 11:17:50 +02:00
Jonas Jenwald
f19991a36f
Merge pull request #16707 from mozilla/dependabot/npm_and_yarn/word-wrap-1.2.4
Bump word-wrap from 1.2.3 to 1.2.4
2023-07-19 08:41:03 +02:00
dependabot[bot]
186a6fd0cb
Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 20:14:51 +00:00
calixteman
e83febcbb6
Merge pull request #16706 from calixteman/bug1844036
[Editor] Don't forget to generate non-missing images when printing (bug 1844036)
2023-07-18 17:01:10 +02:00
Calixte Denizet
7ac3bf6f17 [Editor] Don't forget to generate non-missing images when printing (bug 1844036) 2023-07-18 15:39:18 +02:00
Jonas Jenwald
43fc78899f
Merge pull request #16698 from Snuffleupagus/src-display-rm-require
Remove most build-time `require`-calls from the `src/display/`-folder
2023-07-18 11:35:57 +02:00
Jonas Jenwald
d9350c3899 Temporarily stop running gulp typestest in GitHub Actions
This is necessary to unblock the previous patch, which removes more build-time `require`-calls from the `src/display/` folder.
2023-07-18 09:07:32 +02:00
Jonas Jenwald
d022912719 Remove most build-time require-calls from the src/display/-folder
By leveraging import maps we can get rid of *most* of the remaining `require`-calls in the `src/display/`-folder, since we should strive to use modern `import`-statements wherever possible.
The only remaining cases are Node.js-specific dependencies, since those seem very difficult to convert unless we start producing a bundle *specifically* for Node.js environments.
2023-07-17 19:47:13 +02:00
Jonas Jenwald
e81c084a92
Merge pull request #16703 from Snuffleupagus/babel-corejs
[api-minor] Let Babel handle the necessary `core-js` polyfills automatically
2023-07-17 19:45:06 +02:00
Jonas Jenwald
3a886e7264 Move the isNodeJS-helper into the src/shared/util.js file
With the changes in the previous patch the `isNodeJS`-helper no longer needs to live in its own file, which helps get rid of a closure in the *built* files.
2023-07-17 16:42:25 +02:00
Jonas Jenwald
67303b16f1 [api-minor] Let Babel handle the necessary core-js polyfills automatically
In the last couple of years we've been quicker to remove support for older browsers/environments, which means that at this point in time we don't bundle that many polyfills. (The polyfills are also generally simpler nowadays, ever since we removed support for e.g. Internet Explorer.)
Rather than having to *manually* handle the polyfills, we can actually let Babel take care of bundling the necessary polyfills for us; please refer to https://babeljs.io/docs/babel-preset-env

The only exception here is the Node.js-specific compatibility-code, which is moved into the `src/display/node_utils.js` file. This ought to be fine since workers are not available/used in Node.js-environments.

*Please note:* For the `legacy`-builds this will increase the size of the *built* files, however that seems like a very small price to pay in order to simplify maintenance of the general PDF.js library.
2023-07-17 16:42:08 +02:00
calixteman
9db65ad083
Merge pull request #16702 from calixteman/editor_2_decimals
[Editor] Use 2 decimals for editor positions and dimensions
2023-07-17 15:43:26 +02:00
Calixte Denizet
983b269e26 [Editor] Use 2 decimals for editor positions and dimensions
I noticed that after adding an image in issue16278.pdf, the image was constantly
resizing itself.
It appears that it's because of rounding errors.
2023-07-17 15:08:09 +02:00
calixteman
67e19171c4
Merge pull request #16689 from calixteman/bug1843303
[Editor] Avoid to have some part of an editor outside its page (bug 1843303)
2023-07-17 14:59:21 +02:00
Calixte Denizet
a8867cf68a [Editor] Avoid to have some part of an editor outside its page (bug 1843303) 2023-07-17 14:27:15 +02:00
Jonas Jenwald
717c766a42
Merge pull request #16701 from Snuffleupagus/gv-fix-toolbar-l10n
[GeckoView] Fix l10n of the download toolbar-button (PR 16340 follow-up)
2023-07-17 13:16:49 +02:00