Commit Graph

17606 Commits

Author SHA1 Message Date
calixteman
e00629966d
Merge pull request #16732 from calixteman/editor_resize
[Editor] Add some resizers all around an editor (bug 1843302)
2023-07-25 14:17:09 +02:00
Calixte Denizet
2688bf2ebd [Editor] Add some resizers all around an editor (bug 1843302)
- it'll improve the way to resize images: diagonally (in keeping ratio between dimensions)
  or horizontally/vertically.
- the resizer was almost invisible in HCM.
- make a resize undoable/redoable.
2023-07-25 13:53:30 +02:00
Jonas Jenwald
24d01ec682
Merge pull request #16735 from Snuffleupagus/reduced-Planck-constant-copy
Fix copying of the reduced Planck constant
2023-07-24 21:57:12 +02:00
calixteman
f508084c21
Merge pull request #16736 from calixteman/editor_avoid_text_selection
[Editor] Avoid spurious text selection when double clicking to add a FreeText
2023-07-24 21:03:45 +02:00
Calixte Denizet
3f58e25961 [Editor] Avoid spurious text selection when double clicking to add a FreeText
In order to reproduce the original issue:
 - switch to freetext mode
 - add a text somewhere
 - double click outside and add some text
 - repeat the previous step several times

no text is selected during the edition.
2023-07-24 19:38:00 +02:00
Jonas Jenwald
3b6d2554a8 Fix copying of the reduced Planck constant
Please see https://en.wikipedia.org/wiki/H_with_stroke
2023-07-24 18:42:46 +02:00
Jonas Jenwald
fb3ae82820
Merge pull request #16733 from Snuffleupagus/node-polyfills-catch
[api-minor] Attempt to prevent Node.js-specific polyfill errors from completely breaking the library
2023-07-24 14:50:56 +02:00
Jonas Jenwald
d188b66af6 [api-minor] Attempt to prevent Node.js-specific polyfill errors from completely breaking the library
The existing Node.js-specific polyfills depend on the `node-canvas` package, which has unfortunately (repeatedly) shown to cause trouble for many users. We attempted to improve the situation by listing the relevant packages as `optionalDependencies`, but that didn't seem to really fix the problem.

With this patch the library should be able to load in Node.js-environments even if polyfilling fails, and any errors will instead occur during rendering. Obviously this is *not* a proper solution, since it basically moves the problem to another part of the code-base.
However for certain "simpler" use-cases, such as e.g. text-extraction, these changes should hopefully improve general usability of the PDF.js library in Node.js-environments.

*Please note:* For most PDF documents rendering should still work though, since `DOMMatrix` is *currently* only used with Patterns and `Path2D` only with Type3-fonts and Patterns.
2023-07-24 13:00:34 +02:00
calixteman
71f113bf85
Merge pull request #16718 from calixteman/bug1844572
Don't replace Acroform dictionary if nothing has changed when saving (bug 1844572)
2023-07-24 10:00:43 +02:00
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