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

20225 commits

Author SHA1 Message Date
calixteman
e5ad7ef863
Merge pull request #19295 from calixteman/update_moz_toggle.css
Update the toggle-button css after the changes in m-c (bug 1940085)
2025-01-06 19:00:55 +01:00
Calixte Denizet
6db49bedbe Update the toggle-button css after the changes in m-c (bug 1940085) 2025-01-06 18:34:08 +01:00
calixteman
af5beeb861
Merge pull request #19280 from calixteman/issue19274
Let be more tolerant with predefined phone number format
2025-01-06 17:24:05 +01:00
Calixte Denizet
3dd8752283 Let be more tolerant with predefined phone number format
The long US phone number format should be '(999) 999-9999' but the parenthesis
can be omitted or the space replaced with a dash, ...
2025-01-06 15:24:19 +01:00
Tim van der Meij
3001264801
Merge pull request #19291 from timvandermeij/integration-tests-extract-freetext-commit
Implement a commit helper function for the freetext integration tests
2025-01-05 13:20:12 +01:00
Tim van der Meij
26b0d4f749
Merge pull request #19290 from timvandermeij/integration-tests-use-waitforunselectededitor
Use the `waitForUnselectedEditor` integration test helper function more
2025-01-05 13:19:11 +01:00
Tim van der Meij
e57f2c53a4
Implement a commit helper function for the freetext integration tests
The ink editor integration tests already use a helper function for
committing the editor, so this commit mirrors the approach to the
freetext editor integration tests. This has multiple advantages:

- it improves consistency between the various editor integration tests;
- it makes the code easier to read/understand;
- it reduces code duplication (220 lines of code removed);
- it reduces the number of `getEditorSelector` calls (32 calls removed)
  that contained hardcoded IDs, which helps to isolate the tests and to
  simplify follow-up patches.
2025-01-04 20:22:19 +01:00
Tim van der Meij
5126210fff
Use the waitForUnselectedEditor integration test helper function more
This commit applies the `waitForUnselectedEditor` helper function to the
remaining places, that most likely predate the introduction of the
helper function, to deduplicate the code and to have a unified way of
checking if a given editor is unselected.
2025-01-04 20:15:45 +01:00
Tim van der Meij
4d4e1befeb
Merge pull request #19289 from Snuffleupagus/issue-19281
Skip LinkAnnotations when collecting field objects (issue 19281)
2025-01-04 13:32:18 +01:00
Tim van der Meij
3e822399d8
Merge pull request #19278 from Snuffleupagus/more-Dict-iteration
Use `Dict` iteration more (PR 19051 follow-up)
2025-01-04 13:22:51 +01:00
Tim van der Meij
7f5f4d0e66
Merge pull request #19277 from timvandermeij/integration-tests-remove-getselectededitors
Remove the `getSelectedEditors` integration test helper function
2025-01-04 13:21:45 +01:00
Jonas Jenwald
6f062abb76 Skip LinkAnnotations when collecting field objects (issue 19281)
The `/Root/AcroForm/Fields` array contains a "ridiculous" number of LinkAnnotations, which obviously makes no sense since those are not form fields.
To improve performance we'll thus ignore those when collecting the field objects.
2025-01-04 11:54:45 +01:00
Jonas Jenwald
74c1795c9f Use Dict iteration more (PR 19051 follow-up)
There's a few cases where we're looping through the result of `Dict.prototype.getKeys` and then manually look-up the values, which after PR 19051 can be replaced with direct iteration instead.
2025-01-02 15:09:19 +01:00
Tim van der Meij
9d09c56014
Remove the getSelectedEditors integration test helper function
The `getSelectedEditors` function is largely a copy of the `getEditors`
function, with three small differences:

1. `getEditors` allows getting any kind of editor whereas
   `getSelectedEditors` is harcoded to only getting selected editors.
2. `getEditors` returns editor selectors (strings) whereas
   `getSelectedEditors` returns editor IDs (integers).
3. `getSelectedEditors` returns a sorted array of editor IDs whereas
   `getEditors` does not ensure that the array is sorted.

This commit makes the `getEditors` function a drop-in replacement for
the `getSelectedEditors` function to deduplicate the code and to have a
unified way of getting editors.

Note that we don't actually use the contents of the returned array
(only its length), so we can safely change `getEditors` to return a
sorted array of integer editor IDs instead. Sorting the array makes the
return value deterministic, which is a nice property for test stability,
and integer IDs are also easier to handle in test assertions. Note that
the corresponding selector strings can also easily be obtained from the
integer IDs using the `getEditorSelector` function if needed.
2025-01-01 15:58:09 +01:00
Tim van der Meij
5905eb1253
Merge pull request #19276 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2025-01-01 14:45:30 +01:00
Tim van der Meij
9bd03e81dc
Bump the stable version in pdfjs.config 2025-01-01 14:42:42 +01:00
Jonas Jenwald
f9bea397f8
Merge pull request #19273 from Snuffleupagus/NetworkManager-request-methods
Remove the `requestRange`/`requestFull` methods from the `NetworkManager` class
2024-12-31 16:26:13 +01:00
Jonas Jenwald
01240fda89 Remove the requestRange/requestFull methods from the NetworkManager class
Originally the code in this file was used in both the GENERIC and MOZCENTRAL builds, however that's no longer the case.
Hence we can now directly call `NetworkManager.prototype.request` and remove these old "helper" methods that only had a single call-site each.
2024-12-31 15:57:26 +01:00
Jonas Jenwald
f19b0a1804
Merge pull request #19271 from Snuffleupagus/l10n-update
Update l10n files
2024-12-31 15:42:36 +01:00
Jonas Jenwald
93ce29f136 Update l10n files
Let's ensure that the l10n files are up-to-date before the next release.
2024-12-31 13:51:43 +01:00
Jonas Jenwald
61c3ed47c1
Merge pull request #19269 from Snuffleupagus/image-hasMask
For images that include SMask/Mask entries, ignore an SMask defined in the current graphics state (bug 986450)
2024-12-31 09:07:46 +01:00
Jonas Jenwald
20d5332009 For images that include SMask/Mask entries, ignore an SMask defined in the current graphics state
From section [11.6.4.3 Mask Shape and Opacity](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#G10.4848628) in the PDF specification:
 - An image XObject may contain its own *soft-mask image* in the form of a subsidiary image XObject in the `SMask` entry of the image dictionary (see "Image Dictionaries"). This mask, if present, shall override any explicit or colour key mask specified by the image dictionary's `Mask` entry. Either form of mask in the image dictionary shall override the current soft mask in the graphics state.
2024-12-30 14:25:07 +01:00
Tim van der Meij
8a50d2d302
Merge pull request #19259 from Snuffleupagus/more-wrapReason
Reduce duplication when handling "DocException" and "PasswordRequest" messages
2024-12-29 15:47:11 +01:00
Tim van der Meij
91d801728d
Merge pull request #19262 from Snuffleupagus/CompiledFont-assert-fontMatrix
Assert that the `fontMatrix` is always valid in `compileGlyph`
2024-12-29 15:41:04 +01:00
Tim van der Meij
5b94c865e7
Merge pull request #19263 from Snuffleupagus/Type2Compiled-fix-glyphNameMap
Remove the unused `glyphNameMap` parameter from `Type2Compiled`
2024-12-29 15:39:58 +01:00
Tim van der Meij
b4abfec3ac
Merge pull request #19260 from Snuffleupagus/src-core-simplify-ifs
Shorten some `if`-statements in the `src/core/` folder
2024-12-29 15:38:47 +01:00
Tim van der Meij
0c87fce16e
Merge pull request #19258 from Snuffleupagus/pr-15390-followup
Remove mention of Bower from the README (PR 15390 follow-up)
2024-12-29 15:34:13 +01:00
Jonas Jenwald
aba6369638 Remove the unused glyphNameMap parameter from Type2Compiled
As part of the changes in PR 4259, which landed over ten years ago, the `glyphNameMap` property on `Font`-instances was removed.
The reason that this didn't cause any bugs is that we always fallback on `getGlyphsUnicode`, and when using that data we also rely on `StandardEncoding`, hence we should just remove the unused parameter from the `Type2Compiled` constructor.
2024-12-27 14:31:39 +01:00
Jonas Jenwald
2ae5aa08cc Assert that the fontMatrix is always valid in compileGlyph
While [bug 1893645](https://bugzilla.mozilla.org/show_bug.cgi?id=1893645) was fixed some time ago now, it still shouldn't hurt to also assert that the `fontMatrix` is always valid when invoking the `compileGlyph` method.
2024-12-27 11:41:49 +01:00
Jonas Jenwald
3a797317c8 Shorten some if-statements in the src/core/ folder
Thanks to modern JavaScript there's some existing code that can be shortened slightly.
2024-12-26 18:37:25 +01:00
Jonas Jenwald
6bde49a606 Reduce duplication when handling "DocException" and "PasswordRequest" messages
Rather than having to manually implement the exception-handling for the "DocException" message, we can instead re-use (and slightly extend) the existing `wrapReason` function since that one already does what we need.

Furthermore, we can also simplify handling of the "PasswordRequest" message a little bit and again re-use the `wrapReason` function.

Finally, the patch makes the following smaller changes:
 - Avoid needlessly re-creating exceptions in the `wrapReason` function.
 - Use a slightly shorter parameter name in the `wrapReason` function.
 - Remove the unused entries in the `CallbackKind`/`StreamKind` enumerations.
2024-12-26 12:55:49 +01:00
Jonas Jenwald
c58f69dda4 Remove mention of Bower from the README (PR 15390 follow-up) 2024-12-26 11:34:36 +01:00
Tim van der Meij
4547f230ba
Merge pull request #19254 from timvandermeij/refactor-tests
Improve the test folder structure
2024-12-22 20:22:20 +01:00
Tim van der Meij
cdce9c2bee
Update the page title/favicon of the test runner HTML files
This commit makes sure that the font tests are no longer reported as
being unit tests and that the PDF.js logo is shown in the browser tab to
make PDF.js-specific resources/tabs more easily identifyable during e.g.
development.
2024-12-22 14:08:56 +01:00
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