1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 09:08:07 +02:00
Commit graph

20151 commits

Author SHA1 Message Date
calixteman
44421d36f6
Merge pull request #19201 from calixteman/fix_resize_stamp
[Editor] When resizing a stamp annotation, the opposite corner must stay fixed
2024-12-10 11:00:01 +01:00
calixteman
f9ae9b06e8
Merge pull request #19204 from calixteman/set_canvas_as_first_child
Make sure the canvas is always the first child of its wrapper
2024-12-09 21:28:21 +01:00
Calixte Denizet
3402b727ee Make sure the canvas is always the first child of its wrapper
While drawing, in zooming fast enough, it's possible, intermittently, to have the canvas
after the svg which makes the svg invisible.
So this patch makes sure to have the canvas at the right position.
2024-12-09 19:55:37 +01:00
calixteman
898be9ef5e
Merge pull request #19202 from calixteman/avoid_to_lose_focus
[Editor] Don't commit the current drawing while zooming
2024-12-09 19:00:26 +01:00
calixteman
438c641da2
Merge pull request #19203 from calixteman/update_openjpeg_2.5.3
Update OpenJPEG to 2.5.3
2024-12-09 18:59:26 +01:00
Jonas Jenwald
39bfc92b8e
Merge pull request #19200 from Snuffleupagus/delete-raw-path
Remove the raw path-strings after creating the actual `Path2D` glyph-objects
2024-12-09 18:46:34 +01:00
Calixte Denizet
19ea64c6d7 Update OpenJPEG to 2.5.3 2024-12-09 18:02:18 +01:00
Calixte Denizet
166a529ddd [Editor] Don't commit the current drawing while zooming 2024-12-09 17:25:36 +01:00
Calixte Denizet
99f3e6b4ec [Editor] When resizing a stamp annotation, the opposite corner must stay fixed
It was due the resize observer which is removed thanks to this patch.
In order to reuse the dragAndDrop function in test, this patch slighty refactors it
in order to make it easier to use.
2024-12-09 16:07:43 +01:00
Jonas Jenwald
6153b15231 Remove the raw path-strings after creating the actual Path2D glyph-objects
The `Path2D` glyph-objects are cached on the `FontFaceObject`-instance, so we can save a little bit of memory by removing the raw path-strings once they're no longer needed.
2024-12-09 15:09:18 +01:00
calixteman
99eefb7b71
Merge pull request #19189 from calixteman/improve_font_drawer
Improve perfs of the font renderer
2024-12-09 14:15:15 +01:00
Jonas Jenwald
5dc2d257ad
Merge pull request #19196 from Snuffleupagus/issue-19176
Take the `userUnit` into account in the `PageViewport` class (issue 19176)
2024-12-09 13:38:31 +01:00
Calixte Denizet
2b05924504 Improve perfs of the font renderer
Some SVG paths are generated from the font and used in the main thread
to render the glyphs.
2024-12-08 17:12:10 +01:00
calixteman
6177bb5aa8
Merge pull request #19197 from calixteman/test_disableFontFace
Add a ref test for setting disableFontFace to true
2024-12-08 16:17:42 +01:00
Calixte Denizet
f6662d3f7c Add a ref test for setting disableFontFace to true 2024-12-08 16:06:25 +01:00
Jonas Jenwald
c6e3fc4fe6 Take the userUnit into account in the PageViewport class (issue 19176) 2024-12-08 15:51:04 +01:00
Tim van der Meij
35573cb8e8
Merge pull request #19192 from timvandermeij/scripting-intermittent
Fix intermittent issues in the `issue14307.pdf` integration tests
2024-12-08 14:59:24 +01:00
Tim van der Meij
e74080915d
Fix intermittent issues in the issue14307.pdf integration tests
The `must check input for US zip format` integration test fails pretty
consistently in Puppeteer 23.4.0+ with `Expected '12341' to equal
'12345'`. This is reproducible with the `pdf.sandbox.external.js` hack
from https://github.com/mozilla/pdf.js/issues/18396#issuecomment-2211273743.
Investigation uncovered two issues at play here:

1. We do two `clearInput` calls, but don't await processing of the two
   sandbox events that are triggered by that action. The three tests that
   use `issue14307.pdf` are in different `describe` blocks and therefore
   reload the PDF file, so we can simply remove those calls because the
   inputs are already empty by default.

2. We don't await processing of the sandbox events that occur after
   switching to another text field. This causes the expectation failure
   because the typing actions will happen too soon and interfere with
   the sandbox event processing. We solve the issue by explicitly
   awaiting the sandbox roundtrip.

Moreover, similar to PR #19001 and #18399 we remove any remaining room
for intermittent issues by directly checking for the expected value,
which also results in shorter code.
2024-12-07 19:28:26 +01:00
Tim van der Meij
3f1d07a35e
Merge pull request #19191 from Snuffleupagus/Node-legacy-warn
Print more warnings about potential problems in Node.js environments
2024-12-07 14:54:57 +01:00
Tim van der Meij
67076b6220
Merge pull request #19190 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-12-07 14:52:40 +01:00
Jonas Jenwald
c60a6d1ebd Print more warnings about potential problems in Node.js environments
- Warn if the "regular" PDF.js build is used in Node.js environments, since that won't load any of the relevant polyfills.

 - Warn if the `require` function cannot be accessed, since currently we're just "swallowing" any errors.
2024-12-07 14:08:09 +01:00
Tim van der Meij
2738d1e4f6
Update translations to the most recent versions 2024-12-07 13:44:57 +01:00
Tim van der Meij
129fc66f65
Upgrade eslint-plugin-perfectionist to version 4.2.0
This requires two changes on our side:

- The order of exports in `web/viewer{-geckoview}.js` changes slightly
  because `eslint-plugin-perfectionist` aligned the sorting order with
  the `eslint-plugin-sort-exports` plugin we used before. This restores
  the change from commit 347f155.
- The `eslint-plugin-import` plugin contains a bug that causes the new
  version of `eslint-plugin-perfectionist` to be reported as unresolved.
  This issue is tracked upstream, and since the plugin works fine we
  can simply extend the ignore list we already have to avoid this error
  until the upstream bug is fixed.
2024-12-07 13:44:48 +01:00
Tim van der Meij
7d1ca73acc
Update dependencies to the most recent versions 2024-12-07 13:22:44 +01:00
Jonas Jenwald
b870c5d2ad
Merge pull request #19185 from Snuffleupagus/issue-19175
Support toggling the `PDFFindBar` options with the `Enter` key (issue 19175)
2024-12-06 23:32:58 +01:00
calixteman
23c42f891b
Merge pull request #19184 from calixteman/issue19182
Get the first codepoint instead of the first char when using the toUnicode map
2024-12-06 18:31:30 +01:00
Calixte Denizet
6fe6b6d6b7 Get the first codepoint instead of the first char when using the toUnicode map
It fixes #19182.
2024-12-06 18:25:13 +01:00
Jonas Jenwald
49326f71c2 Support toggling the PDFFindBar options with the Enter key (issue 19175)
These DOM elements are `input type="checkbox"` and (natively) only support being toggled with the `Space` key, however we can extend an existing event-listener to "manually" support the `Enter` key as well.
2024-12-06 17:53:28 +01:00
Jonas Jenwald
c198e0b446
Merge pull request #19148 from nicolo-ribaudo/error-preserve-trace
Do not stringify errors when logging them
2024-12-06 17:11:33 +01:00
Nicolò Ribaudo
202b26487f
Do not stringify errors when logging them
Converting errors to string drops their stack trace, making it more
difficult to debug their actual reason. We can instead pass the error
objects as-is to console.warn/error, so that Firefox/Chrome devtools
will show both the stack trace of the console.warn/error call, and the
original stack trace of the error.

This commit also enables the `unicorn/no-console-spaces` ESLint rule,
which avoids accidental extra spaces when passing multiple parameters to
`console.*` methods.
2024-12-06 14:47:22 +01:00
Jonas Jenwald
60eba287d4
Merge pull request #19114 from Snuffleupagus/issue-19075
Ensure that a missing/invalid "Content-Range" header is handled in `PDFNetworkStream` (issue 19075)
2024-12-06 12:31:18 +01:00
Jonas Jenwald
eff8ede33e Make the onError callback required in NetworkManager
This helps ensure that loading errors are always handled correctly, and note that both `PDFNetworkStreamFullRequestReader` and `PDFNetworkStreamRangeRequestReader` already provided such a callback.
2024-12-06 12:09:36 +01:00
Jonas Jenwald
2661d0623b Ensure that a missing/invalid "Content-Range" header is handled in PDFNetworkStream (issue 19075)
In the event that the "Content-Range" header is missing/invalid, loading will now be aborted rather than hanging indefinitely.
2024-12-06 12:09:34 +01:00
calixteman
e04b62ba2d
Merge pull request #19164 from calixteman/issue18622
When zooming replace the css-zoomed canvas by the new one only when rendering is finished
2024-12-06 11:44:32 +01:00
Calixte Denizet
f3038406b1 When zooming replace the css-zoomed canvas by the new one only when rendering is finished
It fixes #18622.

It avoids to recreate a canvasWrapper element in order minimize the DOM operations.
2024-12-05 23:15:04 +01:00
Tim van der Meij
ef6ecee34c
Merge pull request #19178 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-12-05 22:30:35 +01:00
Tim van der Meij
34390ca53a
Bump the stable version in pdfjs.config 2024-12-05 22:25:31 +01:00
Tim van der Meij
a4eb8407c1
Merge pull request #19149 from Snuffleupagus/issue-19145
Prevent Webpack from resolving `import.meta.url` statements during building (issue 19145)
2024-12-05 21:38:26 +01:00
Tim van der Meij
f0a8a799a7
Merge pull request #19177 from calixteman/issue19171
Avoid to display an alert or a confirm dialog if the message is empty
2024-12-05 21:36:54 +01:00
Calixte Denizet
d1db8d6294 Avoid to display an alert or a confirm dialog if the message is empty
It fixes #19171.
2024-12-05 21:04:07 +01:00
calixteman
f180de41f3
Merge pull request #19174 from calixteman/ink_update_width
[Editor] Correctly update the current drawing when zooming
2024-12-05 16:06:34 +01:00
Jonas Jenwald
28d801e081
Merge pull request #19172 from Snuffleupagus/toggleButton-hover
Ensure that the `.toggleButton`, as used in the findbar, always have visible hover/focus state (issue 19165)
2024-12-05 15:24:46 +01:00
Calixte Denizet
dfa0e79553 [Editor] Correctly update the current drawing when zooming
We were trying to update the drawing on the current page but if the drawing is an another
page then it wasn't updated.
2024-12-05 14:22:02 +01:00
calixteman
9cbc5baafd
Merge pull request #19163 from calixteman/fix_new_ink_itest
Correctly wait for the editor mode when double clicking on an annotation in integration tests
2024-12-05 13:38:12 +01:00
Jonas Jenwald
61e2eceff6 Ensure that the .toggleButton, as used in the findbar, always have visible hover/focus state (issue 19165)
Similar to the regular toolbarButtons that can be toggled, this ensure that it's always possible to tell when the findbar "buttons" are hovered/focused.
2024-12-05 13:07:57 +01:00
Jonas Jenwald
2ad8f6155c
Merge pull request #19161 from Snuffleupagus/Promise-try
Introduce `Promise.try()` usage in the code-base
2024-12-05 10:48:29 +01:00
Calixte Denizet
3ac55501e9 Correctly wait for the editor mode when double clicking on an annotation in integration tests 2024-12-04 18:42:49 +01:00
Jonas Jenwald
ef0331877d Introduce Promise.try() usage in the code-base
This simplifies the creation of Promises in some cases; see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try
2024-12-04 10:31:42 +01:00
calixteman
11ce57ac22
Merge pull request #19160 from calixteman/fix_css_message_bar
Fix unused css variables (follow-up of #18900)
2024-12-04 09:45:17 +01:00
Calixte Denizet
1cd3eb75d5 Fix unused css variables (follow-up of #18900) 2024-12-04 09:15:01 +01:00