Commit Graph

16253 Commits

Author SHA1 Message Date
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
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
calixteman
bf78ccac30
Merge pull request #15459 from calixteman/1774427
Don't use window.print in the Firefox builtin viewer (bug 1774427)
2022-09-19 15:07:10 +02:00
Calixte Denizet
620f1ef1a9 Don't use window.print in the Firefox builtin viewer (bug 1774427)
Currently, it's impossible to print a pdf in a sandboxed iframe in using window.print.
2022-09-19 14:22:40 +02:00
Jonas Jenwald
2642573702
Merge pull request #15458 from Snuffleupagus/rm-some-search
Replace some unnecessary `String.prototype.search` usage
2022-09-19 14:14:41 +02:00
Jonas Jenwald
bb75b36b77 Replace some unnecessary String.prototype.search usage
Most of the `String.prototype.search` call-sites found throughout the code-base is actually not necessary, since we usually only want a *boolean*, and those can be replaced with `RegExp.prototype.test` instead.
2022-09-19 12:51:46 +02:00
calixteman
dc6c3eacbc
Merge pull request #15438 from calixteman/1726183
Improve CSS for HCM (bug 1726183)
2022-09-18 16:04:56 +02:00
Calixte Denizet
07cd7cb3dc Improve CSS for HCM (bug 1726183)
The default outline for a focused text input is not that bad but for any reason when changing
the background color, all the good default border/outline properties are lost (it's the same
behaviour in Edge).
So in order have something consistent in HCM/non-HCM, a 2px-border+1px-outline (on @MReschenberg
advices) is added when an input is focused with different colors depending on HCM.
While working on the above issue, I noticed few bugs I fixed when in HCM:
 - input, button and select have some default properties which have been created at a time where
   annotation layer didn't exist, hence this patch remove them and set those properties where
   they should live;
 - some elements (like the main toolbar) is using a box-shadow which is invisible in HCM, hence
   it's replaced by a border-bottom in HCM;
 - some separators are invisible in HCM, hence use GrayText color to render them correctly;
 - the options for the zoom selection were invisible in HCM with Desert (one of the Windows 11
   themes).
2022-09-18 16:03:24 +02:00
Tim van der Meij
67160f4cae
Merge pull request #15455 from Snuffleupagus/issue-15453
Don't update the Scroll/Spread-mode in the ViewHistory while PresentationMode is active (issue 15453)
2022-09-18 14:35:00 +02:00
Tim van der Meij
f7ab417757
Merge pull request #15432 from Snuffleupagus/validateFileURL-var
Some *small* viewer clean-up for non-GENERIC builds
2022-09-18 14:32:13 +02:00
Tim van der Meij
d78619cd66
Merge pull request #15452 from Snuffleupagus/chrome-extension
Temporarily stop listing the official Chrome extension in the main README
2022-09-18 14:29:46 +02:00
Tim van der Meij
f91cc3dd5d
Merge pull request #15451 from Snuffleupagus/major-support
[api-major] Update the minimum supported browsers/environments
2022-09-18 14:28:31 +02:00
Tim van der Meij
965713f3e7
Merge pull request #15446 from Snuffleupagus/rm-component-examples-enableScripting
Remove the `enableScripting`-parameter from the component examples (PR 13816 follow-up)
2022-09-18 14:24:27 +02:00
Tim van der Meij
58e30a7048
Merge pull request #15454 from Snuffleupagus/update-packages
Update packages and translations
2022-09-18 14:23:43 +02:00
Jonas Jenwald
2c02a2fc5c Don't update the Scroll/Spread-mode in the ViewHistory while PresentationMode is active (issue 15453)
By force-quitting the browser while the FullScreen API is active, we don't get a chance to exit PresentationMode *cleanly* and some of its state thus remains (via the `ViewHistory`).
To try and improve things here we can skip updating the Scroll/Spread-mode while PresentationMode is active, since they will be changed when entering PresentationMode, which seems to help and is really the best that we can do here (and what the issue describes is very much an edge-case anyway).
2022-09-18 11:42:01 +02:00
Jonas Jenwald
1a04a38a06 Update l10n files 2022-09-18 10:34:53 +02:00
Jonas Jenwald
6a9e584215 Update npm packages 2022-09-18 10:31:32 +02:00
Jonas Jenwald
b7f987a185 [api-major] Update the minimum supported browsers/environments
In the `legacy`-builds we (obviously) support the currently maintained Firefox ESR version, and looking at the [release history](https://wiki.mozilla.org/Release_Management/Calendar) those are officially supported (by Mozilla) for about 1-1.5 years.
However, for non-Firefox browsers the `legacy`-builds currently attempt to "support" browsers that are approximately *three* years old.[1] Historically, in the PDF.js project, trying to support old browsers have caused some maintenance problems and even delayed adoption of new web-platform features/functionality.

To lessen the support burden, given that the primary purpose of the PDF.js library is still to develop the *built-in* Firefox PDF Viewer, this patch proposes that the upcoming *major* release changes the minimum supported browsers/environments as follows:
 - Chrome 85, which was released on 2020-08-25; see https://en.wikipedia.org/wiki/Google_Chrome_version_history
 - Firefox ESR (as before); see https://wiki.mozilla.org/Release_Management/Calendar
 - Safari 14, which was released on 2020-09-16; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_14
 - Node.js 14 (as before), which is now explicitly listed to prevent it from accidentally breaking; see https://en.wikipedia.org/wiki/Node.js#Releases

---
[1] In older browsers some functionality may not be available and generally we'll ask users to update to a modern browser when bugs, specific to old browsers, are being reported.
2022-09-18 01:12:15 +02:00
Jonas Jenwald
afabbc28c5 Temporarily stop listing the official Chrome extension in the main README
The [official Chrome extension](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) has unfortunately not been updated for *three years*, which means that it's currently missing out on years worth of bug fixes, performance improvements, and new features.
In particular, the Chrome extension suffers from a known bug with non-embedded standard fonts; see issue 13669 for details.

For the time being, this patch proposes that we *temporary* make the following changes:
 - Remove the mention of the official Chrome extension from the main README, since it seems unfortunate to somewhat prominently recommend users an old and partially non-working extension.
 - Don't run the `gulp lint-chromium` task as part of the CI, since in addition to the official extension not having been updated its code is also not being actively maintained.[1]

Once the official Chrome extension has been updated, and it's being actively maintained again, this patch should be simple enough to revert.

---
[1] The last commits, which aren't e.g. linting or general code-maintenance related, happened a year ago now.
2022-09-17 16:29:19 +02:00
Jonas Jenwald
2f3417a590 Remove the enableScripting-parameter from the component examples (PR 13816 follow-up)
This became unnecessary with PDF.js version `2.11.338`, which was relasesed almost a year ago and is no longer supported.
2022-09-16 10:19:05 +02:00
Jonas Jenwald
bcdf161967
Merge pull request #15445 from Snuffleupagus/issue-15443
Extend `getSupplementalGlyphMapForCalibri` with more entries (issue 15443)
2022-09-15 22:56:44 +02:00
Jonas Jenwald
7a19def34c Extend getSupplementalGlyphMapForCalibri with more entries (issue 15443) 2022-09-15 22:19:16 +02:00
Jonas Jenwald
9bfd997c12
Merge pull request #15442 from Snuffleupagus/issue-15441
Extend `getGlyphMapForStandardFonts` with some quote-entries (issue 15441)
2022-09-15 13:11:06 +02:00
Jonas Jenwald
2f2ecad8fd Extend getGlyphMapForStandardFonts with some quote-entries (issue 15441) 2022-09-15 11:37:20 +02:00
Jonas Jenwald
c21d00ef44
Merge pull request #15430 from srmagura/webpack5
[api-minor] Use `new Worker()` syntax in webpack entrypoint
2022-09-14 10:32:01 +02:00
Sam Magura
1c2d200918 [api-minor] Use new Worker() syntax in webpack entrypoint
This requires Webpack 5 and will break for anyone using Webpack 4.
worker-loader no longer needs to be installed.
2022-09-13 11:12:00 -04:00
Jonas Jenwald
5e5aa9fb69
Merge pull request #15339 from Snuffleupagus/enable-editor
[api-major] Enable editing by default
2022-09-13 15:57:54 +02:00