Commit Graph

18604 Commits

Author SHA1 Message Date
Calixte Denizet
bb19cf9b64 [Editor] In caret browsing mode, get the caret position in the text layer (bug 1881692)
The function caretPositionFromPoint return the position within the last visible element
and sometimes there are some elements on top of the ones in the text layer.
So the idea is to hide the visible elements which aren't in the text layer in order
to get the right caret position.
2024-02-23 16:50:19 +01:00
calixteman
101e8efad7
Merge pull request #17708 from calixteman/editor_highlight_context_menu
[Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739)
2024-02-23 16:39:03 +01:00
Calixte Denizet
e1f6f5179f [Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739) 2024-02-23 16:18:03 +01:00
calixteman
72b8b29147
Merge pull request #17701 from calixteman/alt_text_ai
[Editor] Add the possibility to query some ML stuff to guess an alt text for an image
2024-02-21 10:14:40 +01:00
calixteman
0fb8a23051
Merge pull request #17702 from calixteman/bug1868759
[Editor] Disable annotation layer when highlighting (bug 1868759)
2024-02-21 09:49:48 +01:00
Calixte Denizet
46416bb131 [Editor] Add the possibility to query some ML stuff to guess an alt text for an image
It's only for an experimental purpose.
2024-02-20 21:29:33 +01:00
Calixte Denizet
95f9bedc7c [Editor] Disable annotation layer when highlighting (bug 1868759)
When highlighting, the annotation editor layer is disabled to get pointer events
from the text layer, but the annotation layer must be then disabled either in
order to avoid bad interactions.
2024-02-20 21:17:05 +01:00
calixteman
70015ffe6b
Merge pull request #17688 from calixteman/editor_no_scroll_unselect
[Editor] Avoid to scroll when an editor is unselected
2024-02-20 17:00:43 +01:00
calixteman
99fa713fba
Merge pull request #17690 from calixteman/issue17689
Avoid to access to a missing cidSystemInfo property
2024-02-19 12:04:07 +01:00
Calixte Denizet
a6eadf8150 Avoid to access to a missing cidSystemInfo property
Fixes #17689.
2024-02-19 09:55:23 +01:00
Calixte Denizet
c2fcc66302 [Editor] Avoid to scroll when an editor is unselected 2024-02-18 19:21:45 +01:00
Tim van der Meij
d96fd80ca0
Merge pull request #17687 from Snuffleupagus/pr-17686-followup
Disable source-map generation in the minified builds (PR 17686 follow-up)
2024-02-18 13:35:23 +01:00
Jonas Jenwald
673639c54b Disable source-map generation in the minified builds (PR 17686 follow-up)
As part of the changes in PR 17686 we "accidentally" enabled source-maps for the *minified* builds, which seems unnecessary since those have never been included in the `pdfjs-dist` output.
Locally this patch reduces the run-time of `gulp minified` by ~15 percent.
2024-02-17 22:14:37 +01:00
Tim van der Meij
4ac8ee8b6d
Merge pull request #17686 from Snuffleupagus/Webpack-TerserPlugin
Run minification directly during Webpack building
2024-02-17 19:42:35 +01:00
Jonas Jenwald
091e861531 Run minification directly during Webpack building
Rather than first building the library and then use Terser "manually" to minify the files, we can utilize a Webpack plugin to combine these steps which helps to simplify the gulpfile.
2024-02-17 18:51:34 +01:00
Tim van der Meij
8487c67cb8
Merge pull request #17684 from timvandermeij/modernize-webserver-pt2
Modernize the webserver code (part 2)
2024-02-17 18:22:51 +01:00
Tim van der Meij
33955980c8
Merge pull request #17685 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-02-17 18:09:51 +01:00
Tim van der Meij
2e6fa797d9
Improve the webserver's constructor
This makes the webserver configurable during instantiation rather than
having to set the parameters afterwards.
2024-02-17 16:22:10 +01:00
Tim van der Meij
985ba77579
Modernize the remainder of the webserver's code and enable the no-var ESLint rule
This commit also moves the content type logic into a helper method to
ever so slightly reduce duplication.
2024-02-17 16:22:10 +01:00
Tim van der Meij
0015eb2431
Modernize the webserver's handler method
This commit converts `var` to `const`/`let`, gives the variables more
readable names and annotates the code to make the flow clearer.
2024-02-17 16:22:10 +01:00
Tim van der Meij
6ef813af01
Extract and modernize the webserver's request checking code
The `handler` method contained this code in two inline functions,
triggered via callbacks, which made the `handler` method big and harder
to read. Moreover, this code relied on variables from the outer scope,
which made it harder to reason about because the inputs and outputs
weren't easily visible.

This commit fixes the problems by extracting the request checking code
into a dedicated private method, and modernizing it to use e.g. `const`/
`let` instead of `var` and using template strings. The logic is now
self-contained in a single method that can be read from top to bottom
without callbacks and with comments annotating each check/section.
2024-02-17 16:22:10 +01:00
Tim van der Meij
43cdc1ca8a
Update translations to the most recent versions 2024-02-17 16:00:18 +01:00
Tim van der Meij
6baa439e15
Update dependencies to the most recent versions 2024-02-17 16:00:18 +01:00
Tim van der Meij
f1a225889b
Merge pull request #17681 from Snuffleupagus/parseMinified-changes
Tweak the `parseMinified` handling slightly in the gulpfile
2024-02-17 15:08:30 +01:00
Tim van der Meij
678c79cc78
Merge pull request #17678 from Snuffleupagus/pr-17637-followup
Remove unneeded `tweakWebpackOutput` usage in the gulpfile (PR 17637 follow-up)
2024-02-17 14:58:24 +01:00
Tim van der Meij
fd5d040073
Merge pull request #17667 from Snuffleupagus/createPrintService-params
Change `PDFPrintServiceFactory.createPrintService` to take a parameter object
2024-02-17 14:54:53 +01:00
Jonas Jenwald
179a3ecee6
Merge pull request #17680 from Snuffleupagus/issue-17679
Add a dummy `beginMarkedContentProps` operator when optional content parsing fails (issue 17679)
2024-02-17 14:29:08 +01:00
Jonas Jenwald
b767e12111
Merge pull request #17676 from Snuffleupagus/app-findBar-optional-chain
Access `PDFViewerApplication.findBar` safely in more spots (PR 15831 follow-up)
2024-02-17 13:54:00 +01:00
Jonas Jenwald
a7bcc81eb1 Add a dummy beginMarkedContentProps operator when optional content parsing fails (issue 17679) 2024-02-17 13:45:16 +01:00
Jonas Jenwald
75a5b2051d Tweak the parseMinified handling slightly in the gulpfile
- Run the minification in "parallel" since that should be a *tiny* bit more efficient.
 - Don't rename the minified files since that seems unnecessary, especially considering that they are only used in the `dist-pre` target where we currently change the name back manually.
2024-02-16 16:54:13 +01:00
Jonas Jenwald
751611f690 Remove unneeded tweakWebpackOutput usage in the gulpfile (PR 17637 follow-up)
After the changes in PR 17637 there's no longer any reason to invoke `tweakWebpackOutput` without an argument, since the `__non_webpack_import__` re-writing was moved into the Babel plugin.
This way we can avoid a (little) bit of unnecessary parsing during building.
2024-02-16 11:42:40 +01:00
Jonas Jenwald
b420bd8b20 Access PDFViewerApplication.findBar safely in more spots (PR 15831 follow-up)
Note that this patch is the result of code-inspection, and the code as written doesn't (currently) cause any bugs in e.g. the GeckoView PDF Viewer.
2024-02-15 11:25:29 +01:00
calixteman
a83a8d7e4f
Merge pull request #17674 from calixteman/issue17671
Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
2024-02-15 10:19:55 +01:00
Jonas Jenwald
dbda3ec5f9
Merge pull request #17637 from Snuffleupagus/babel-plugin-__non_webpack_import__
Move the `__non_webpack_import__` re-writing into the Babel plugin
2024-02-14 22:23:24 +01:00
Calixte Denizet
fcad3718f0 Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
It fixes #17671.
2024-02-14 17:20:04 +01:00
Jonas Jenwald
a204f434f3 Change PDFPrintServiceFactory.createPrintService to take a parameter object
By "modernizing" the method to use a parameter object instead, we avoid having to pass along the needed parameters individually.
2024-02-13 21:28:02 +01:00
calixteman
14874e50b7
Merge pull request #17636 from calixteman/bug1878916
When updating, write the xref table in the same format as the previous one (bug 1878916)
2024-02-13 14:45:14 +01:00
Calixte Denizet
2133da166e When updating, write the xref table in the same format as the previous one (bug 1878916)
The specs are unclear about what kind of xref table format must be used.
In checking the validity of some pdfs in the preflight tool from Acrobat
we can guess that having the same format is the correct way to do.
The pdf in the mentioned bug, after having been changed, wasn't correctly
displayed in neither Chrome nor Acrobat: it's now fixed.
2024-02-13 14:14:37 +01:00
Jonas Jenwald
e60329cea1
Merge pull request #17666 from Snuffleupagus/issue-17665
Skip any whitespace after the first object in linearized PDFs (issue 17665)
2024-02-13 12:39:36 +01:00
Jonas Jenwald
37e98e39f6 Skip any whitespace after the first object in linearized PDFs (issue 17665)
This way the code is now consistent with the non-linearized branch in the `PDFDocument.startXRef` getter.
2024-02-12 22:05:36 +01:00
calixteman
05b035602e
Merge pull request #17664 from calixteman/bug1879281
[Editor] Ends a free highlight where the mouse pointer is (bug 1879281)
2024-02-12 18:39:18 +01:00
Calixte Denizet
750b8e328a [Editor] Ends a free highlight where the mouse pointer is (bug 1879281) 2024-02-12 17:26:33 +01:00
Jonas Jenwald
eb5e6e68d6
Merge pull request #17663 from Snuffleupagus/pr-17428-test
Tweak the issue 11878 unit-test parsing time check (PR 17428 follow-up)
2024-02-12 14:14:29 +01:00
calixteman
f0343dcfdb
Merge pull request #17662 from calixteman/bug1879108
[Editor] Set rotated free highlight at the right position after having changed its thickness (bug 1879108)
2024-02-12 12:41:43 +01:00
Jonas Jenwald
19ef3e367b Tweak the issue 11878 unit-test parsing time check (PR 17428 follow-up)
This unit-test has been failing occasionally in Chrome and Node.js, hence we tweak the parsing time check to reduce the likelihood of that happening.
2024-02-12 12:31:55 +01:00
Jonas Jenwald
18959e80be
Merge pull request #17661 from timvandermeij/modernize-webserver
Modernize the webserver code (part 1)
2024-02-12 11:50:24 +01:00
Jonas Jenwald
4ab0ad3216 Move the __non_webpack_import__ re-writing into the Babel plugin
Note how we're using custom `__non_webpack_import__`-calls in the code-base, that we replace during the post-processing stage of the build, to be able to write `import`-calls that Webpack will leave alone during parsing.
This work-around is necessary since we let Babel discards all comments, given that we generally don't need/want them in the builds, hence why we cannot utilize `/* webpackIgnore: true */`-comments in the source-code.

After the changes in PR 17563 it thus seems to me that we should be able to just move this re-writing into the Babel plugin instead.
2024-02-12 10:49:43 +01:00
Jonas Jenwald
d742daf4b7
Merge pull request #17647 from Snuffleupagus/babel-rm-empty-nodes
Remove empty, top-level, nodes in the Babel plugin
2024-02-12 09:25:59 +01:00
Calixte Denizet
de1985abbb [Editor] Set rotated free highlight at the right position after having changed its thickness (bug 1879108) 2024-02-11 21:06:56 +01:00
Tim van der Meij
ce4fe0c234
Extract and modernize the webserver's directory listing code
The `handler` method contained this code in an inline function, which
made the `handler` method big and harder to read. Moreover, this code
relied on variables from the outer scope, which made it harder to reason
about because the inputs and outputs weren't easily visible.

This commit fixes the problems by extracting the directory listing code
into a dedicated private method, and modernizing it to use e.g. `const`/
`let` instead of `var` and using template strings.
2024-02-11 20:06:21 +01:00