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

19839 commits

Author SHA1 Message Date
Tim van der Meij
ed100f2ef2
Update translations to the most recent versions 2024-09-22 20:27:10 +02:00
Tim van der Meij
3753387e9d
Update dependencies to the most recent versions 2024-09-22 20:27:10 +02:00
Tim van der Meij
ddd7b63406
Merge pull request #18772 from Snuffleupagus/Node-unit-test-fs-promise
Use `fs/promises` in the Node.js unit-tests (PR 17714 follow-up)
2024-09-22 20:21:37 +02:00
Jonas Jenwald
1a1dfe60bf Add more optional chaining in the test/ directory 2024-09-22 13:00:57 +02:00
Jonas Jenwald
0a621ba73a Use fs/promises in the Node.js unit-tests (PR 17714 follow-up)
This is available in all Node.js versions that we currently support, and using it allows us to remove callback-functions; please see https://nodejs.org/docs/latest-v18.x/api/fs.html#promises-api
2024-09-22 12:57:23 +02:00
Jonas Jenwald
ea2172e754
Merge pull request #18766 from Snuffleupagus/issue-18765
Ignore non-existing /Shading resources during parsing (issue 18765)
2024-09-21 21:11:53 +02:00
Jonas Jenwald
67af371e58 Ignore non-existing /Shading resources during parsing (issue 18765) 2024-09-19 21:55:02 +02:00
Jonas Jenwald
96cdff4a73
Merge pull request #18763 from Snuffleupagus/readme-update-issue-link
Link to the new issue templates from the README (PR 18308 follow-up)
2024-09-19 16:31:48 +02:00
Jonas Jenwald
9e001f8513 Link to the new issue templates from the README (PR 18308 follow-up) 2024-09-19 16:14:39 +02:00
calixteman
6222359c5f
Merge pull request #18761 from calixteman/fix_separator_color
Fix the rendering of the different separators we've in the UI
2024-09-19 15:37:17 +02:00
Calixte Denizet
b29278efb8 Fix the rendering of the different separators we've in the UI
Currently, the css for a separator is something like { height: 1px; background-color: ... }.
But its rendering depends on its position on the screen.
So instead of setting the height to 1px, we just set something like { border-top: 1px solid ...; },
this way the final rendering is exactly the same for all the separators.
2024-09-19 15:24:01 +02:00
calixteman
652e3e0d76
Merge pull request #18760 from calixteman/bug1919513
Read a signed integer when using PUSHW in sanitizing a font (bug 1919513)
2024-09-19 13:33:50 +02:00
Calixte Denizet
78dd35483c Read a signed integer when using PUSHW in sanitizing a font (bug 1919513) 2024-09-18 22:09:17 +02:00
calixteman
19151feb5f
Merge pull request #18757 from calixteman/rename_toolbar_buttons
Rename the toolbar buttons in order to free their current names
2024-09-17 21:20:38 +02:00
Calixte Denizet
ee89bd1c39 Rename the toolbar buttons in order to free their current names
which can then be used for their future parent container.
This patch aims to simplify a bit the patch in #18385.
2024-09-17 20:34:38 +02:00
Tim van der Meij
a58cd6851e
Merge pull request #18756 from Snuffleupagus/api-NetworkStream
Simplify the code that picks the appropriate NetworkStream-implementation
2024-09-17 19:19:19 +02:00
Jonas Jenwald
f77a29d675 Simplify the code that picks the appropriate NetworkStream-implementation
This code is quite old and has been moved/re-factored a few times over the years, however we can simplify this even further since we don't actually need a function to determine what NetworkStream-implementation to use.
2024-09-17 12:23:43 +02:00
calixteman
f68310b7b1
Merge pull request #18749 from calixteman/issue18626
[Editor] Take into account the device pixel ratio when drawing an added image
2024-09-16 15:01:38 +02:00
Calixte Denizet
46fac8b2c1 [Editor] Take into account the device pixel ratio when drawing an added image
Fixes #18626.
2024-09-16 14:48:26 +02:00
Tim van der Meij
014ce7c1db
Merge pull request #18728 from Rob--W/crx-mv3-fallback-detect-fixup
[CRX] Fix feature detect of DNR responseHeaders option
2024-09-15 15:43:23 +02:00
Tim van der Meij
bf5c987fee
Merge pull request #18748 from Rob--W/crx-mv3-enable-wasm
[CRX] Enable WebAssembly in Chrome extension
2024-09-15 15:42:38 +02:00
Rob Wu
3170bf3f69 [CRX] Enable WebAssembly in Chrome extension
After the removal of 'unsafe-eval' CSP in #18651, WebAssembly fails to
load, resulting in issues such as seen in #18457.

Manifest Version 3 does not allow 'unsafe-eval', does accept the more
specific 'wasm-unsafe-eval' as of Chrome 103. Note that manifest.json
already sets minimum_chrome_version to 103.

This patch also adds `object-src 'self'` because it was required until
Chrome 110. As of Chrome 111, the default is `object-src 'self'` and
`object-src` is no longer required. We could drop `object-src` in the
future, but for now we need to include it to support Chrome 103 - 110.
2024-09-15 12:58:38 +02:00
Jonas Jenwald
c72fb9b733
Merge pull request #18742 from Snuffleupagus/pageColorsBackground-unloaded-pages
Use the "pageColorsBackground" option as background-color for non-loaded pages (issue 18680)
2024-09-12 22:38:52 +02:00
Jonas Jenwald
d86f94a3db Use the "pageColorsBackground" option as background-color for non-loaded pages (issue 18680)
This should prevent non-loaded pages from flashing white in e.g. high contrast mode (HCM).
2024-09-12 21:15:15 +02:00
calixteman
b915a9c3a5
Merge pull request #18741 from flodolo/fluent_number
Fluent: use explicit NUMBER() in plural variants
2024-09-12 17:03:17 +02:00
calixteman
4275424456
Merge pull request #18740 from calixteman/bug1897909
[Editor] Avoid an extra new line when serializing a FreeText annotation (bug 1897909)
2024-09-12 17:00:38 +02:00
Francesco Lodolo
6e1b4d63e7
Fluent: use explicit NUMBER() in plural variants 2024-09-12 16:53:18 +02:00
Calixte Denizet
85e8bac45d [Editor] Avoid an extra new line when serializing a FreeText annotation (bug 1897909)
The extra new line is added because of using shift+enter to add a new line
in the text editor.
2024-09-12 15:35:19 +02:00
Jonas Jenwald
1ab9ab67ee
Merge pull request #18738 from mozilla/dependabot/npm_and_yarn/dset-3.1.4
Bump dset from 3.1.3 to 3.1.4
2024-09-12 10:35:14 +02:00
dependabot[bot]
edd1dfb699
Bump dset from 3.1.3 to 3.1.4
Bumps [dset](https://github.com/lukeed/dset) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/lukeed/dset/releases)
- [Commits](https://github.com/lukeed/dset/compare/v3.1.3...v3.1.4)

---
updated-dependencies:
- dependency-name: dset
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 23:53:47 +00:00
calixteman
cb20d1b169
Merge pull request #18737 from calixteman/bug1918115
[JS] Correctly format floating numbers when they're close to an integer (bug 1918115)
2024-09-11 18:03:59 +02:00
Calixte Denizet
ca95264e8b [JS] Correctly format floating numbers when they're close to an integer (bug 1918115) 2024-09-11 17:19:34 +02:00
Jonas Jenwald
c52e8485a7
Merge pull request #18731 from Snuffleupagus/TextLayer-ensureCtxFont
Ensure that textLayers can be rendered in parallel, without interfering with each other
2024-09-11 16:29:53 +02:00
Jonas Jenwald
5b3d3c7dd9 Ensure that textLayers can be rendered in parallel, without interfering with each other
Note that the textContent is returned in "chunks" from the API, through the use of `ReadableStream`s, and on the main-thread we're (normally) using just one temporary canvas in order to measure the size of the textLayer `span`s; see the [`#layout`](5b4c2fe1a8/src/display/text_layer.js (L396-L428)) method.

*Order of events, for parallel textLayer rendering:*
 1. Call [`render`](5b4c2fe1a8/src/display/text_layer.js (L155-L177)) of the textLayer for page A.
 2. Immediately call `render` of the textLayer for page B.
 3. The first text-chunk for pageA arrives, and it's parsed/layout which means updating the cached [fontSize/fontFamily](5b4c2fe1a8/src/display/text_layer.js (L409-L413)) for the textLayer of page A.
 4. The first text-chunk for pageB arrives, which means updating the cached fontSize/fontFamily *for the textLayer of page B* since this data is unique to each `TextLayer`-instance.
 5. The second text-chunk for pageA arrives, and we don't update the canvas-font since the cached fontSize/fontFamily still apply from step 3 above.

Where this potentially breaks down is between the last steps, since we're using just one temporary canvas for all measurements but have *individual* fontSize/fontFamily caches for each textLayer.
Hence it's possible that the canvas-font has actually changed, despite the cached values suggesting otherwise, and to address this we instead cache the fontSize/fontFamily globally through a new (static) helper method.

*Note:* Includes a basic unit-test, using dummy text-content, which fails on `master` and passes with this patch.

Finally, pun intended, ensure that temporary textLayer-data is cleared *before* the `render`-promise resolves to avoid any intermittent problems in the unit-tests.
2024-09-11 15:28:51 +02:00
calixteman
870394d22b
Merge pull request #18730 from calixteman/issue18693
Consider foo-\nBar as a compound word
2024-09-11 15:15:16 +02:00
Calixte Denizet
06f9d8002d Consider foo-\nBar as a compound word
Fixes #18693.
2024-09-11 15:01:54 +02:00
calixteman
0ac7f294cd
Merge pull request #18726 from calixteman/issue18058
Consume any pending path before drawing an annotation
2024-09-10 19:00:58 +02:00
Calixte Denizet
518b776e43 Consume any pending path before drawing an annotation
Fixes #18058.
2024-09-10 16:44:30 +02:00
Rob Wu
a91ba11185 [CRX] Fix feature detect of DNR responseHeaders option
Fix regression from #18711. `urlFilter` is a key of `condition`, not of
the `rule`. Consequently, the feature detection method failed to detect
the availability of the feature in Chrome 128+.
2024-09-10 16:05:11 +02:00
Jonas Jenwald
66ed4b9e25
Merge pull request #18724 from Snuffleupagus/highlight-rm-l10nPromise
Remove ununsed static `HighlightEditor._l10nPromise` field
2024-09-10 15:59:25 +02:00
Jonas Jenwald
2883a9460e Remove ununsed static HighlightEditor._l10nPromise field 2024-09-10 10:00:41 +02:00
calixteman
5b4c2fe1a8
Merge pull request #18716 from calixteman/stamp_auto_resize
[Editor] Avoid to have a stamp editor resizing itself
2024-09-09 22:13:49 +02:00
calixteman
f98e6040cd
Merge pull request #18719 from calixteman/bug1917543
[Editor] Avoid to have the ML disclaimer when the ML engine isn't ready (bug 1917543)
2024-09-09 22:12:46 +02:00
calixteman
95cd848e3b
Merge pull request #18718 from calixteman/bug1916714
[JS] Let AFSpecial_KeystrokeEx match a format without 'decoration' (bug 1916714)
2024-09-09 21:50:46 +02:00
Calixte Denizet
6e4b7ee3f8 [Editor] Avoid to have the ML disclaimer when the ML engine isn't ready (bug 1917543) 2024-09-09 21:47:18 +02:00
Calixte Denizet
3f23bcbecc [Editor] Avoid to have a stamp editor resizing itself
Fixes #18715.
2024-09-09 21:31:55 +02:00
Tim van der Meij
5f39b592c5
Merge pull request #18708 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-09-09 21:23:16 +02:00
Calixte Denizet
bae32b4fd2 [JS] Let AFSpecial_KeystrokeEx match a format without 'decoration' (bug 1916714)
It'll let the user enter 1234567 instead of 123-4567 for example.
It works like this in other pdf viewers.
2024-09-09 20:29:14 +02:00
Tim van der Meij
8e5f06d77d
Merge pull request #18711 from Rob--W/crx-mv3-fallback-detect
[CRX] Detect availability of DNR responseHeaders before use
2024-09-09 20:00:44 +02:00
Tim van der Meij
2f2d74ba5c
Update translations to the most recent versions 2024-09-09 19:51:21 +02:00