Commit Graph

16578 Commits

Author SHA1 Message Date
calixteman
da1780f826
Merge pull request #15486 from nmtigor/fix_orders_of_prop
Fix property chain orders of Operators in isDotExpression
2022-09-25 04:13:25 -10:00
Tim van der Meij
dab81f5981
Merge pull request #15507 from Snuffleupagus/FontLoader-cleanup
Improve the `FontLoader` code
2022-09-25 13:31:33 +02:00
Jonas Jenwald
ad83fbe2a1 Replace the BaseFontLoader classes with one FontLoader class
By having just *one* class, and using pre-processor blocks directly in the relevant methods, we reduce the size of this code in the *built* `pdf.js` file.
Originally, when the `BaseFontLoader` abstraction was added in PR 9982, the idea was probably that additional build-targets would get their own implementations. Given that this hasn't happened in the four years since that landed, it doesn't seem meaningful to keep it around.
2022-09-25 12:31:58 +02:00
Jonas Jenwald
9a03d36af4 Remove some unused code from the _queueLoadingCallback method (PR 3477 follow-up)
The existing `loadingContext` class-property can be simplified slightly, since we've not been using the `id`-property on the requests ever since PR 3477 (which landed nine years ago).
Furthermore, by default we're also not even using that code-path now since the Font Loading API will always be used when available.
2022-09-25 10:41:06 +02:00
Tim van der Meij
5f65df774f
Merge pull request #15504 from Snuffleupagus/rm-stopImmediatePropagation-checks
Use `stopImmediatePropagation` without checking for its existence first
2022-09-24 15:15:04 +02:00
Jonas Jenwald
b420f0165a Use stopImmediatePropagation without checking for its existence first
These checks were added years ago, but given the following compatibility data we should just be able to call the method directly: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation#browser_compatibility
2022-09-24 15:02:12 +02:00
Tim van der Meij
907ef467ea
Merge pull request #15503 from Snuffleupagus/consistent-outline
Use a consistent `outline` for all UI buttons (PR 15438 follow-up)
2022-09-24 14:48:21 +02:00
Tim van der Meij
27a1ab52b1
Merge pull request #15501 from Snuffleupagus/errorWrapper-font
Restore the old fonts in the `errorWrapper` (PR 15438 follow-up)
2022-09-24 14:46:54 +02:00
Tim van der Meij
4cedbca365
Merge pull request #15500 from Snuffleupagus/LoopbackPort-rm-export
[api-minor] Stop exposing the `LoopbackPort` class in the API
2022-09-24 14:45:59 +02:00
Tim van der Meij
369f23ff3d
Merge pull request #15499 from Snuffleupagus/support-docs
Reference supported browsers Wiki-page in more README files
2022-09-24 14:43:45 +02:00
Tim van der Meij
10f6a0154f
Merge pull request #15485 from Snuffleupagus/more-optional-chaining-2
Use more optional chaining in the code-base (PR 15398 follow-up)
2022-09-24 14:41:43 +02:00
Jonas Jenwald
5296fc991c Restore the old fonts in the errorWrapper (PR 15438 follow-up)
This only applies to the GENERIC viewer, hence we use the pre-processor to exclude it from the Firefox PDF Viewer.
2022-09-24 13:54:34 +02:00
Jonas Jenwald
616535b7a7 Use a consistent outline for all UI buttons (PR 15438 follow-up)
Currently the `viewBookmark`-button, which is actually a `href`-element, gets an inconsistent `outline`.
Similarly, the `dialog`-buttons also have an inconsistent `outline` after the changes in PR 15438.

Finally, simplifies a couple of `border` rules since setting a border-width when "none" is being used doesn't seem meaningful.
2022-09-24 13:42:27 +02:00
Jonas Jenwald
cf038d0368 [api-minor] Stop exposing the LoopbackPort class in the API
This was done all the way back in PR 8361, for a mozilla-central test that's since been removed. As can be seen in the following search results, there's no `LoopbackPort` invocation outside of the PDF.js code itself: https://searchfox.org/mozilla-central/search?q=LoopbackPort&path=

Given that the `LoopbackPort` is only used in connection with "fake workers", which is something that we don't officially recommend/support, this doesn't seem like functionality that we want to keep exposing in the public API.
2022-09-23 13:44:35 +02:00
Jonas Jenwald
499610779e Re-factor the LoopbackPort class to use *proper* private fields 2022-09-23 13:25:15 +02:00
Jonas Jenwald
c1c78f9e8c Reference supported browsers Wiki-page in more README files
I've just updated https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support to hopefully provide better support data, and it cannot hurt to explicitly link that from a couple of places.
2022-09-23 11:06:47 +02:00
Jonas Jenwald
7404091787
Merge pull request #15498 from Snuffleupagus/more-spread
Replace some `Array.prototype`-usage with spread syntax
2022-09-23 10:23:14 +02:00
Jonas Jenwald
6538409282 Replace some Array.prototype-usage with spread syntax
We have a few, quite old, call-sites that use the `Array.prototype`-format and which can now be replaced with spread syntax instead.
2022-09-23 09:35:30 +02:00
Jonas Jenwald
91bdcd8b20
Merge pull request #15495 from mozilla/revert-15459-1774427
Revert "Don't use window.print in the Firefox builtin viewer (bug 1774427)"
2022-09-22 17:07:21 +02:00
calixteman
034017d526
Merge pull request #15494 from Snuffleupagus/issue-15492
Tweak the heuristic that handles JPEG images with a wildly incorrect SOF (Start of Frame) `scanLines` parameter (issue 15492)
2022-09-22 17:05:49 +02:00
calixteman
9ded9dd4e5
Revert "Don't use window.print in the Firefox builtin viewer (bug 1774427)" 2022-09-22 16:58:49 +02:00
calixteman
9bdcdeef67
Merge pull request #15493 from calixteman/15490
[JS] Try to guess what the date is when it doesn't follow the given format (issue #15490)
2022-09-22 16:54:33 +02:00
Calixte Denizet
9e40938a29 [JS] Try to guess what the date is when it doesn't follow the given format (issue #15490)
We use the format to guess in which order we can find month, day, ... we get the numbers
in the date and consider them as month, day, ...
2022-09-22 16:30:39 +02:00
Jonas Jenwald
f1b0dc6f04 Tweak the heuristic that handles JPEG images with a wildly incorrect SOF (Start of Frame) scanLines parameter (issue 15492) 2022-09-22 14:09:04 +02:00
Jonas Jenwald
784ec3978a
Merge pull request #15491 from Snuffleupagus/annotationLayer-input-hover-border
Set a `border-radius` when hovering annotationLayer-inputs (PR 15438 follow-up)
2022-09-22 10:26:56 +02:00
Jonas Jenwald
1558c0e85e Set a border-radius when hovering annotationLayer-inputs (PR 15438 follow-up)
The changes in PR 15438 added a `border-radius` when input-elements are focused, however there's no radius when the same elements are hovered. Having the radius change, and not just the `border-color`, when input goes from hovered to focused feels a bit inconsistent (at least to me).
2022-09-22 10:01:24 +02:00
Jonas Jenwald
547fa3ed2c
Merge pull request #15489 from Snuffleupagus/debugger-fonts
Restore the old fonts in the debugger (PR 15438 follow-up)
2022-09-21 22:39:53 +02:00
Jonas Jenwald
2a1d536ec6 Restore the old fonts in the debugger (PR 15438 follow-up)
The changes in PR 15438 affected the debugger as well, which means that some of the panels/buttons look (in my opinion) a bit less nice than before.
2022-09-21 21:49:17 +02:00
nmtigor
22cc9b7dc7 Fix property chain orders of Operators in isDotExpression and isSomPredicate 2022-09-21 17:20:23 +02:00
Jonas Jenwald
9f637966f8 Use more optional chaining in the code-base (PR 15398 follow-up)
*Fixes a few cases that I missed in PR 15398.*
2022-09-21 16:47:36 +02:00
Jonas Jenwald
2146d93609
Merge pull request #15483 from Snuffleupagus/rm-app-duplicate-document
[JS] Remove duplicate `this._document` assignment in the `App`-class
2022-09-21 12:13:21 +02:00
nmtigor
01ec5e3b32 [JS] Remove duplicate this._document assignment in the App-class
This property is already being assigned earlier in the constructor, see ea1d359767/src/scripting_api/app.js (L42)
2022-09-21 11:40:28 +02:00
Jonas Jenwald
ea1d359767
Merge pull request #15478 from calixteman/1791583
Initialize values in the path bounding box before flushing the operator list (bug 1791583)
2022-09-20 21:12:10 +02:00
Calixte Denizet
198e9a3db1 Initialize values in the path bounding box before flushing the operator list (bug 1791583)
OperatorList.addOp can trigger a flush if it's required, hence the values passed to it must
be correctly initialized in order to avoid some wrong values in the renderer.
Because of that a clip path was considered as empty, nothing was clipped, hence the wrong
rendering in bug 1791583.
2022-09-20 20:01:54 +02:00
Jonas Jenwald
ff8f850936
Merge pull request #15477 from Snuffleupagus/sandbox-destroy-timeout
Access the `setTimeout`-functionRefs correctly in `SandboxSupportBase.destroy`
2022-09-20 15:34:05 +02:00
Jonas Jenwald
fdb7b086bd
Merge pull request #15476 from calixteman/fix_formcalc_lexer
[XFA] Fix an hidden issue in the FormCalc lexer
2022-09-20 14:32:30 +02:00
calixteman
cd7ce6a295
Merge pull request #15468 from calixteman/1791515
[Editor] Make sure to have the annotation editor layer on top of the annotation one (bug 1791515)
2022-09-20 14:17:56 +02:00
Jonas Jenwald
fde1e4996d Access the setTimeout-functionRefs correctly in SandboxSupportBase.destroy
*This effectively replaces PR 15465.*

As outlined in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach, the argument order when iterating through a `Map` is actually `value, key`.
Ignoring the incorrect Array used in the old code, I cannot imagine that this would've worked anyway since we didn't use the actual `setTimeout`-functionRefs to clear the timeouts; please refer to the `setTimeout`/`setInterval` methods in the `SandboxSupportBase.createSandboxExternals` method.
2022-09-20 14:10:44 +02:00
Calixte Denizet
f5b835157b [XFA] Fix an hidden issue in the FormCalc lexer
Since there are no script engine with XFA, the FormCalc parser is not used irl.
The bug @nmtigor noticed was hidden by another one (the wrong check on `match`).
2022-09-20 13:53:55 +02:00
Jonas Jenwald
8dd2b48488
Merge pull request #15474 from nmtigor/fix_bugs_10
Fix #selectEditors typo in the AnnotationEditorUIManager.unselectAll method
2022-09-20 13:15:26 +02:00
Jonas Jenwald
09b54a8c9e
Merge pull request #15473 from nmtigor/fix_bugs_9
Fix commFunc typo in the SandboxSupportBase.destroy method
2022-09-20 12:15:59 +02:00
nmtigor
4348ffee8d Fix #selectEditors typo in the AnnotationEditorUIManager.unselectAll method 2022-09-20 11:55:42 +02:00
nmtigor
d7103a4439 Fix commFunc typo in the SandboxSupportBase.destroy method 2022-09-20 11:39:13 +02:00
Calixte Denizet
3b536f2701 [Editor] Make sure to have the annotation editor layer on top of the annotation one (bug 1791515)
Some z-index have been added in the annotation layer because the elements inside are re-ordered
in order to improve accessibility.
Hence we must add a "high" z-index on the annotation editor layer in order to avoid any bad
interaction between the different layers.
2022-09-20 10:58:35 +02:00
calixteman
e5fc7cf4bd
Merge pull request #15461 from calixteman/1790309
Use AccentColor as background for selected text in the text layer (bug 1790309)
2022-09-19 22:36:37 +02:00
calixteman
5b4a44dbab
Merge pull request #15462 from calixteman/update_xfa
[XFA] - Avoid an exception when zooming on a XFA
2022-09-19 22:22:16 +02:00
Calixte Denizet
403aa5cfa0 [XFA] - Avoid an exception when zooming on a XFA 2022-09-19 21:31:52 +02:00
Calixte Denizet
68977ebc26 Use AccentColor as background for selected text in the text layer (bug 1790309)
and use the default color for the viewer in general.
2022-09-19 21:25:56 +02:00
Jonas Jenwald
d262ca314d
Merge pull request #15460 from Snuffleupagus/prefer-regexp-test
Enable the `unicorn/prefer-regexp-test` ESLint plugin rule
2022-09-19 17:32:21 +02:00
Jonas Jenwald
20b9887476 Enable the unicorn/prefer-regexp-test ESLint plugin rule
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
2022-09-19 16:34:01 +02:00