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

20291 commits

Author SHA1 Message Date
Tim van der Meij
22ad864cc7
Move the reporter file to the test root folder
The reporter is used in both the unit and the font tests, so this commit
moves it to the test root folder to more clearly indicate that this is a
shared resource and so the font tests don't have to reach into the unit
tests folder to import it (which improves separation).
2024-12-22 14:08:56 +01:00
Tim van der Meij
a43fc32bf3
Move the integration tests boot file to the integration tests folder
This file is specific to the integration tests, so this commit moves it
to bundle the integration test logic a bit better and to match the
unit/font tests in terms of folder structure for consistency.
2024-12-22 14:08:55 +01:00
Tim van der Meij
94f425d2cc
Merge pull request #19246 from Snuffleupagus/add-missing-startWorkerTask
Add missing `startWorkerTask` calls in the "SaveDocument" handler
2024-12-21 18:20:33 +01:00
Jonas Jenwald
ec1a05c104 Add missing startWorkerTask calls in the "SaveDocument" handler
Without these calls we'll not actually wait for saving to complete when document destruction runs; compare with other `WorkerTask`-usage in this file.
While I cannot imagine that this has caused any problems for library users, the code is however not technically correct as-is.
2024-12-21 14:22:18 +01:00
Jonas Jenwald
dd5618ebed
Merge pull request #19243 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-12-20 14:22:51 +01:00
Tim van der Meij
d34ac535f0
Update translations to the most recent versions 2024-12-19 21:17:35 +01:00
Tim van der Meij
af0ffd29fa
Fix vulnerability in the nanoid dependency
This patch is generated with `npm audit fix` and fixes GHSA-mwcw-c2x4-8c55.
2024-12-19 21:14:29 +01:00
Tim van der Meij
d70ede4751
Update dependencies to the most recent versions 2024-12-19 21:13:00 +01:00
Tim van der Meij
7d0fe45443
Merge pull request #19232 from nicolo-ribaudo/scroll-to-search-result
Fix left offset when scrolling to search result
2024-12-19 20:52:46 +01:00
Tim van der Meij
7bd168811c
Merge pull request #19237 from Snuffleupagus/pr-19114-followup-2
Disable the `handle reading ranges with missing/invalid "Content-Range" header` unit-test in Google Chrome (PR 19114 follow-up)
2024-12-19 19:19:20 +01:00
calixteman
2df5d8f3ef
Merge pull request #19238 from calixteman/bug1938087
Take the absolute value of the font size when the annotation contents is in xhtml (bug 1938087)
2024-12-18 17:34:06 +01:00
Jonas Jenwald
0b487774d5
Merge pull request #19236 from Snuffleupagus/issue-19234
Add basic support for non-embedded HelveticaLTStd-Bold fonts (issue 19234)
2024-12-18 17:28:41 +01:00
Calixte Denizet
723ee9bc8c Take the absolute value of the font size when the annotation contents is in xhtml (bug 1938087) 2024-12-18 17:00:45 +01:00
Jonas Jenwald
760c4a0297 Disable the handle reading ranges with missing/invalid "Content-Range" header unit-test in Google Chrome (PR 19114 follow-up)
Note that PR 19212 tried to change the test-server to fix the intermittent failure in Google Chrome, however that unfortunately caused *other* unit-tests to start failing.
As long as this unit-test still runs successfully in Mozilla Firefox that should be enough, and it doesn't seem like a good use of our time to hunt down a bug that only happens in Google Chrome.
2024-12-18 10:15:33 +01:00
Jonas Jenwald
189183aa1a Add basic support for non-embedded HelveticaLTStd-Bold fonts (issue 19234) 2024-12-18 09:39:22 +01:00
Nicolò Ribaudo
4e2aabc5cd
Fix left offset when scrolling to search result
When computing the left offset of the highlighted text, we cannot use
.offsetLeft because the text might have been scaled through CSS, and it
needs to be taken into account.

Use `.getClientRects()`/`.getBoundingClientRect()` instead, which will
return measurements scaled appropriately.
2024-12-16 16:04:13 +01:00
Tim van der Meij
8985d80aef
Merge pull request #19226 from Snuffleupagus/pr-19216-followup
Disable touch-zooming, in the viewer, if `AbortSignal.any` is unsupported (PR 19216 follow-up)
2024-12-15 19:15:32 +01:00
Jonas Jenwald
29c3b7bec5 Disable touch-zooming, in the viewer, if AbortSignal.any is unsupported (PR 19216 follow-up)
This way loading of the *entire* viewer won't break in older browsers that lack `AbortSignal.any` support; see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static#browser_compatibility
2024-12-15 18:13:38 +01:00
Jonas Jenwald
b781b55ea0
Merge pull request #19225 from Snuffleupagus/version-4.10
Bump library version to `4.10`
2024-12-15 16:34:52 +01:00
Jonas Jenwald
780692b226 Bump library version to 4.10 2024-12-15 16:30:31 +01:00
Tim van der Meij
ac81de6ab4
Merge pull request #19224 from Snuffleupagus/pr-18776-followup
[api-minor] Remove deprecated `getDocument` options (PR 18776 follow-up)
2024-12-15 15:52:34 +01:00
Tim van der Meij
322616988e
Merge pull request #19214 from Snuffleupagus/issue-19205
Don't remove trailing regular spaces from the "raw" response headers (issue 19205)
2024-12-15 15:51:20 +01:00
Jonas Jenwald
490e740365 [api-minor] Remove deprecated getDocument options (PR 18776 follow-up) 2024-12-15 14:13:44 +01:00
calixteman
a8c35a9e0c
Merge pull request #19219 from calixteman/pinch_editor
[Editor] Add the ability to resize an editor in using a pinch gesture
2024-12-14 21:50:51 +01:00
Calixte Denizet
4ed7f7f1ee [Editor] Add the ability to resize an editor in using a pinch gesture 2024-12-14 19:39:51 +01:00
calixteman
8fa4398266
Merge pull request #19216 from calixteman/extract_pinch
Move the pinch stuff in its own file in order to use for editors
2024-12-12 10:15:05 +01:00
Calixte Denizet
e0b63ecd03 Move the pinch stuff in its own file in order to use for editors 2024-12-11 23:20:01 +01:00
calixteman
a9c5bb25b8
Merge pull request #19215 from calixteman/issue18911
[Editor] Avoid to focus an existing editor when enabling the layer
2024-12-11 22:18:17 +01:00
Calixte Denizet
d61b882888 [Editor] Avoid to focus an existing editor when enabling the layer
It fixes #18911.
2024-12-11 15:06:56 +01:00
Jonas Jenwald
08e54053ff Don't remove trailing regular spaces from the "raw" response headers (issue 19205)
This bug only seems to reproduce in Google Chrome, since browsers apparently sort response headers differently.
When the issue occurs the "raw" response headers string looks like this:
```
content-length: 525404\r\ncontent-type: \r\n
```
and since we trim *any* leading/trailing white-space characters the "content-type" header isn't detected correctly, which thus leads to `new Headers(...)` throwing.

Hence we'll keep regular spaces at the end of the "raw" response headers string, while still removing all other kinds of trailing white-space characters.

*Note:* The response headers parsing was based on https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#examples
2024-12-11 12:16:31 +01:00
calixteman
fbac4ab5f3
Merge pull request #19209 from calixteman/draw_touch_screen
[Editor] Improve drawing on a touch screen.
2024-12-10 22:40:13 +01:00
Calixte Denizet
89f61b4262 [Editor] Improve drawing on a touch screen.
- it's now possible to start a drawing with a pen and use fingers to zoom
  or scroll without interacting with the current drawing;
- it's now possible to draw with a finger and them zoom with two fingers.
2024-12-10 21:54:29 +01:00
calixteman
4d228818a9
Merge pull request #19210 from calixteman/puppeteer_23.10.3
Update Puppeteer to version 23.10.3
2024-12-10 21:10:21 +01:00
Calixte Denizet
b7ab5ee018 Update Puppeteer to version 23.10.3 2024-12-10 19:59:54 +01:00
calixteman
6e33f23757
Merge pull request #19208 from calixteman/puppeteer_23.10.2
Update Puppeteer to version 23.10.2
2024-12-10 19:56:16 +01:00
Calixte Denizet
73701ad873 Update Puppeteer to version 23.10.2 2024-12-10 19:55:55 +01:00
calixteman
b35999d837
Merge pull request #19198 from calixteman/fix_intermittent_itest_chrome
Fix intermittent failures when moving a freetext annotation in integration tests
2024-12-10 16:56:58 +01:00
Calixte Denizet
74a377f72f Fix intermittent failures when moving a freetext annotation in integration tests
When an editor is moved with the keyboard or in dragging it, it is moved in the DOM in order
to make screen readers happy. But this move is slightly postponed thanks to a setTimeout(..., 0).
The failures were very likely due to the fact that intermittently the DOM move was done in
the middle of the next key sequence which was making the move on screen failing.
2024-12-10 16:14:26 +01:00
calixteman
aa589b9068
Merge pull request #19206 from nicolo-ribaudo/canvas-prepend
Simplify logic to insert canvas as first element
2024-12-10 14:59:18 +01:00
Nicolò Ribaudo
62db66dd46
Simplify logic to insert canvas as first element
Instead of conditionally checking if the `.cavnasWrapper` already
has a child element and then inserting the `canvas` before it, we can
use `.prepend` which always injects the new element as the first
child.
2024-12-10 12:00:09 +01:00
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