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

20152 commits

Author SHA1 Message Date
Calixte Denizet
1cd3eb75d5 Fix unused css variables (follow-up of #18900) 2024-12-04 09:15:01 +01:00
calixteman
9a4b7c2612
Merge pull request #19155 from calixteman/bug1929311
[Editor] Corrrectly get the words from the alt-text when reporting the telemetry (bug 1929311)
2024-12-03 19:27:15 +01:00
Calixte Denizet
e161826a44 [Editor] Corrrectly get the words from the alt-text when reporting the telemetry (bug 1929311) 2024-12-03 19:02:58 +01:00
calixteman
a5ce71247b
Merge pull request #18900 from ryzokuken/popup-undo-annotation
Annotation deletion popup (bug 1899731)
2024-12-03 16:53:48 +01:00
Aditi
41bf874461 Add tests for annotation delete popup 2024-12-03 11:03:15 +01:00
Ujjwal Sharma
dd82d78a2d Pop open a message when user deletes an annotation
When a user deletes any number of annotations, they are notified of the action
by a popup message with an undo button. Besides that, this change reuses the
existing messageBar CSS class from the new alt-text dialog as much as possible.
2024-12-03 11:03:15 +01:00
Ujjwal Sharma
962eb6206a Break messageBar class out
Move .messageBar out of .dialog into its own standalone class in order
to reuse as much of it for the upcoming feature for an undo message for
annotations.
2024-12-02 23:01:22 +01:00
Jonas Jenwald
f8d11a3a3a
Merge pull request #19074 from Rob--W/issue-12744-test
Add test cases for redirected responses
2024-12-02 19:06:55 +01:00
calixteman
8a2bdb1a05
Merge pull request #19151 from calixteman/edit_inks
[Editor] Make ink annotation editable
2024-12-02 18:30:40 +01:00
Rob Wu
f97b4b9a66 Add test cases for redirected responses
Regression tests for issue #12744 and PR #19028
2024-12-02 17:57:49 +01:00
Rob Wu
28b0220bc2 Replace createTemporaryNodeServer with TestPdfsServer
Some tests rely on the presence of a server that serves PDF files.
When tests are run from a web browser, the test files and PDF files are
served by the same server (WebServer), but in Node.js that server is not
around.

Currently, the tests that depend on it start a minimal Node.js server
that re-implements part of the functionality from WebServer.

To avoid code duplication when tests depend on more complex behaviors,
this patch replaces createTemporaryNodeServer with the existing
WebServer, wrapped in a new test utility that has the same interface in
Node.js and non-Node.js environments (=TestPdfsServer).

This patch has been tested by running the refactored tests in the
following three configurations:

1. From the browser:
   - http://localhost:8888/test/unit/unit_test.html?spec=api
   - http://localhost:8888/test/unit/unit_test.html?spec=fetch_stream

2. Run specific tests directly with jasmine without legacy bundling:
   `JASMINE_CONFIG_PATH=test/unit/clitests.json ./node_modules/.bin/jasmine --filter='^api|^fetch_stream'`

3. `gulp unittestcli`
2024-12-02 17:57:49 +01:00
Calixte Denizet
7e02c77250 [Editor] Make ink annotation editable 2024-12-02 17:15:33 +01:00
calixteman
97c7a8eb7a
Merge pull request #19144 from calixteman/no_focus_if_invisible
[Editor] Don't focus a newly added drawing if it isn't visible on screen
2024-12-02 14:02:01 +01:00
calixteman
36b1ba8eca
Merge pull request #19142 from calixteman/rotated_ink
Fix the clickable area for rotated ink annotations
2024-12-02 14:01:26 +01:00
Jonas Jenwald
a2b889bb9a Prevent Webpack from resolving import.meta.url statements during building (issue 19145)
This fixes a Node.js-specific regression from PR 18959.
2024-12-02 13:38:22 +01:00
Calixte Denizet
673c93e832 [Editor] Don't focus a newly added drawing if it isn't visible on screen 2024-12-02 11:06:13 +01:00
Calixte Denizet
1460a8128a Fix the clickable area for rotated ink annotations 2024-12-02 09:48:22 +01:00
Tim van der Meij
d448953166
Merge pull request #19139 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-12-01 20:07:54 +01:00
Tim van der Meij
33da75fb36
Bump the stable version in pdfjs.config 2024-12-01 20:04:54 +01:00
Jonas Jenwald
867aaf01fa
Merge pull request #19117 from Snuffleupagus/bot-forceNoChrome
Disable the browser-tests in Google Chrome on the bots
2024-12-01 18:28:03 +01:00
Tim van der Meij
2bbf9b432c
Merge pull request #19099 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-12-01 14:54:07 +01:00
Tim van der Meij
eb51dbf296
Update translations to the most recent versions 2024-12-01 14:49:03 +01:00
Tim van der Meij
7784f868fc
Update dependencies to the most recent versions 2024-12-01 14:49:03 +01:00
Tim van der Meij
c40a0a6478
Merge pull request #19137 from Snuffleupagus/PDFDocumentProperties-move-getPage
Move the `getPage` call in `PDFDocumentProperties` class
2024-12-01 14:44:43 +01:00
Tim van der Meij
9f90bc9114
Merge pull request #19136 from Snuffleupagus/WorkerMessageHandler-this
Shorten the `WorkerMessageHandler` class a little bit
2024-12-01 14:40:38 +01:00
Tim van der Meij
1bc6b767c2
Merge pull request #19135 from Snuffleupagus/api-more-optional-chaining
Use even more optional chaining in the `src/display/api.js` file
2024-12-01 14:36:58 +01:00
Jonas Jenwald
e5f744da04 Move the getPage call in PDFDocumentProperties class
This allows us to remove an ESLint disable-statement for `arrow-body-style`, without affecting readability of the code, and fetching the metadata and the page in parallel should be a *tiny* bit more efficient as well.
2024-12-01 12:25:16 +01:00
Jonas Jenwald
ede589dd6e Shorten the WorkerMessageHandler class a little bit
- Use `this` in all scopes where that's possible, to avoid having to spell out `WorkerMessageHandler` everywhere.

 - Inline the `isMessagePort` helper function, since there's only a single call-site.

 - Use a static initialization block to move more code into the `WorkerMessageHandler` class itself.
2024-11-30 14:07:16 +01:00
Jonas Jenwald
4b0900fdfa Use even more optional chaining in the src/display/api.js file
This slightly shortens the code, in various `destroy`-methods, which cannot hurt.
Also, use pre-processor checks to simplify `PDFDocumentLoadingTask.destroy` in the Firefox PDF Viewer since the `PDFWorker.fromPort`-method isn't used there.
2024-11-30 12:06:27 +01:00
calixteman
8f08ca2150
Merge pull request #19131 from calixteman/bug1934157
Build date consistently (in term of tz) when executing some embedded JS (bug 1934157)
2024-11-29 21:44:10 +01:00
calixteman
a09ea8d29a
Merge pull request #19124 from calixteman/simplify_pinching
Simplify the code to zoom in using a pinch gesture
2024-11-29 20:47:59 +01:00
Calixte Denizet
2a337082c0 Build date consistently (in term of tz) when executing some embedded JS (bug 1934157)
The date was create in UTC+0 and then amended in using set-Month/Date which take into account
the user timezone.
With this patch we build all the date in the user timezone.
2024-11-29 19:50:21 +01:00
calixteman
9ecc613c08
Merge pull request #19066 from jarklee/issue19056
Fix #serializeBoxes function not output correct quadPoints values for deserialize (issue19056)
2024-11-29 18:31:28 +01:00
Calixte Denizet
a300b19525 Simplify the code to zoom in using a pinch gesture 2024-11-29 18:29:18 +01:00
calixteman
ffce4c74b5
Merge pull request #19129 from calixteman/issue19126
[Editor] Allow to abort the current drawing
2024-11-29 17:31:28 +01:00
Calixte Denizet
4acc086292 [Editor] Allow to abort the current drawing
It fixes #19126.
2024-11-29 16:22:49 +01:00
calixteman
308ca2a16f
Merge pull request #19123 from calixteman/improve_search_perf
Very slightly improve the performance when searching in a pdf
2024-11-28 17:44:14 +01:00
Calixte Denizet
94d53d5b45 Very slightly improve the performance when searching in a pdf
It helps to slightly decrease memory use in reducing the number of created arrays.
In searching for "a" in pdf.pdf, the time spent in getOriginalIndex is decreased by
around 30%.
2024-11-28 17:37:19 +01:00
Jonas Jenwald
65f20b0392
Merge pull request #19121 from Snuffleupagus/more-stopEvent
Use the `stopEvent` helper function everywhere possible
2024-11-28 17:21:34 +01:00
calixteman
c784a24d45
Merge pull request #19122 from calixteman/issue19120
Correctly compute the mapping between text and normalized text when it contains a compound word on two lines
2024-11-28 17:13:09 +01:00
calixteman
ee0df62bc8
Merge pull request #19093 from calixteman/refactor_ink
[Editor] Add a new base class to allow to add a drawing in the SVG layer.
2024-11-28 16:54:21 +01:00
Calixte Denizet
aa9503e51f Correctly compute the mapping between text and normalized text when it contains a compound word on two lines
It fixes #19120.

The original text doesn't contain the cr so we must take that into account.
2024-11-28 15:56:04 +01:00
Calixte Denizet
cee65fcd4e [Editor] Add a new base class to allow to add a drawing in the SVG layer.
This patch makes a clear separation between the way to draw and the editing stuff.
It adds a class DrawEditor which should be extended in order to create new drawing tools.
As an example, the ink tool has been rewritten in order to use it.
2024-11-28 15:23:03 +01:00
Jonas Jenwald
e1760aab8d Use the stopEvent helper function everywhere possible 2024-11-28 13:25:56 +01:00
calixteman
22babd722f
Merge pull request #19109 from calixteman/click_when_dragging
[Editor] Disallow to have multiple pointers while dragging an editor
2024-11-27 20:26:45 +01:00
Calixte Denizet
e695d04ca2 [Editor] Disallow to have multiple pointers while dragging an editor
It'll let the user dragging with two fingers.
2024-11-27 19:41:13 +01:00
Jonas Jenwald
fd31e728f7 Disable the browser-tests in Google Chrome on the bots
Given that `browsertest` repeatedly timeout in Google Chrome, and considering that Firefox is the primary development target, we stop running them on the bots to avoid having to repeatedly deal with this.

Note that we already disabled these tests *on Windows* almost three years ago, because of stability issues; see PR 14392.
2024-11-27 17:59:51 +01:00
calixteman
052b001f0e
Merge pull request #19111 from calixteman/fix_highlight_test_with_kb
Fix the highlight integration test when highlighting with the keyboard
2024-11-27 16:10:38 +01:00
Calixte Denizet
5d77a64e1f Fix the highlight integration test when highlighting with the keyboard
These tests were failing with Puppeteer 23.9.0.
2024-11-27 15:38:33 +01:00
Jarklee
2200f0523c Fix #serializeBoxes bug inconsistent with deserialize function for highlight editor.
Add test for quadPoints order while serializing.
2024-11-27 14:19:31 +07:00