Skip to content

Update master from remote - #49

Merged
jerronjames merged 1071 commits into
masterfrom
update-remote
Sep 1, 2023
Merged

Update master from remote#49
jerronjames merged 1071 commits into
masterfrom
update-remote

Conversation

@jerronjames

Copy link
Copy Markdown

No description provided.

Snuffleupagusand others added 30 commits July 11, 2023 11:38
[ESM] Convert the `external/builder/`-folder to use standard modules
…659 follow-up)
This regressed in PR 16659, when the signature of the `PDFViewer.annotationEditorMode`-setter was changed, and it currently leads to an Error being thrown when exiting PresentationMode.
 - Do the /Filter and /DecodeParms lookup in parallel, since that ought to be a *tiny* bit more efficient.
- Avoid code-duplication when `CompressionStream` isn't supported, since we already have a fallback code-path at the end of the function.
…plication._initializeViewerComponents`
There's no good reason for getting this option multiple times in the same method. Also, we can slightly re-factor how the `editorStampButton` is made visible.
…rated as possible
- Take into account the page translation,
- Take into account the correct translation for the editor border,
- Take into account the position of the first glyph in the annotation,
- Take into account the rotation of the editor.
Closemozilla#16633.
[Editor] Try to make the position of an edited FreeText the more accurated as possible
Re-enable editing, if necessary, when exiting PresentationMode (PR 16659 follow-up)
Tweak the `writeStream` implementation slightly
…nvasSupported
Access the `isOffscreenCanvasSupported` option *once* in `PDFViewerApplication._initializeViewerComponents`
[Editor] Always use the data url when loading a SVG in order to avoid CSP issue (bug 1843255)
In order to reproduce the issue:
- scale down the image
- zoom the page and the image is pixellated
So this patch allow to redraw the image when zooming.
[Editor] Resize the image when the page is zoomed
Note that while some packages increased the *major* version, it doesn't appear to cause any breakage as far as I can tell.
Occasionally some test-suites may fail to start on the bots, however that's not correctly reflected in the botio-output posted to GitHub which makes it easy to accidentally overlook this situation.
Looking at the raw logs when that happens they always seem to contain a line such as `Run NaN tests` which means that we should be able to easily make this situation a *failure* as intended.
Ensure that a test-suite that runs no tests is treated as a failure
Currently this class contains a few "special" code-paths for the COMPONENTS build-target, which normally wouldn't be a problem. However, in this particular case that means accessing code that we don't want to include unconditionally in all builds.
This is currently implemented using build-time `require`-calls which we nowadays want to avoid, and we should strive to remove all such cases from the code-base. (Generally speaking `import` is the future, and build-tools may not always play well with a mix of both formats.)
We can easily improve things here by using sub-classing for the COMPONENTS build-target, and then use the ability to re-name when exporting (to avoid breaking existing code).
Having a `require` in this file has never made sense in e.g. the Firefox PDF Viewer and shouldn't really be necessary.
Possibly the idea was to facilitate some kind of third-party bundling, however the *built* `pdf.js` file has always exposed the API-contents globally.
 - `prefer-array-some`, which didn't require any code changes; please find additional details at https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
- `prefer-modern-math-apis`, which should be fine given the currently supported browsers; please find additional details at https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
Re-factor the `PDFScriptingManager`-class for the viewer-components
Localization of this button broke in PR 16340, which I assume was completely accidental, since the download-button now tries to access a l10n-id that was removed some time ago (see PR 15617).
Note how loading even the development viewer, i.e. http://localhost:8888/web/viewer-geckoview.html#locale=en-US, currently logs l10n-warnings on the `master` branch.
[GeckoView] Fix l10n of the download toolbar-button (PR 16340 follow-up)
[Editor] Avoid to have some part of an editor outside its page (bug 1843303)
Snuffleupagusand others added 27 commits August 19, 2023 15:52
Given that this code is (and has always been) unused in the Firefox PDF Viewer, we don't need to include it in that build-target.
By default this WeakMap isn't needed, and it's simple enough to initialize it lazily instead.
Initialize the `PDFWorker.#workerPorts` WeakMap lazily
…4899 follow-up)
This was added in PR 14899, over a year ago, however it's still completely unused in the PDF.js library/viewer. In hindsight I think that it was a mistake to add unused functionality, and the issue should probably have been WONTFIXed instead, however we probably can't just remove it now.
Thanks to the pre-processor, we can at least exclude this code in the *built-in* Firefox PDF Viewer.
Given that the other Editor toolbar-buttons use this attribute, it seems that the StampEditor should as well.
Given that this file-extension is used for JavaScript modules, those files should obviously be formatted just like any "normal" JS file.
Add the `.mjs` file-extension to the EditorConfig
Add the "aria-controls" attribute to the StampEditor toolbar-button
The issue described in the mentioned bug is reall because
Acrobat is rendering the XFA instead of the Acroform.
The original patch just tried to workaround the issue but it
induces some regressions.
correctly set the readonly property in the annotation layer and set the default checkbox value to Off when none is provided.
Don't reset all fields when the resetForm argument is an array
Exclude `lineEndings`, in Annotation-data, in MOZCENTRAL builds (PR 14899 follow-up)
Also, use logical OR assignment a bit more.
…ining-4
Introduce more optional chaining in the code-base
This fixes invalid type references (either due to invalid paths for the
import or missing imports) in the JS doc, as well as some missing or
invalid parameter names for @PARAM annotations.
Add tagged annotations in the structure tree (bug 1850797)
Fix the id used in aria-controls used to make a relationship between the popup and its parent
Testing the `tagged_stamp.pdf` document locally in the viewer, I noticed that e.g. the /Alt entry for the StampAnnotation contains "Secondary text for stamp\u0000".
Elsewhere in the viewer we're skipping null-chars and it's easy enough to do that in the `StructTreeLayerBuilder` class as well. (Note that we generally let the API itself return the data as-is.)
…oveNullCharacters
Ignore null-chars when using structTree-data in the viewer
…unction
Using `removeNullCharacters` on the URL should be completely redundant, given the kind of data that we're passing to the `addLinkAttributes` helper function. Note that whenever we're handling a URL, originating in the worker-thread, in the viewer that helper function is always being used.
Furthermore, on the worker-thread all URLs are parsed with the `createValidAbsoluteUrl` helper function, which uses `new URL()` to ensure that a valid URL is obtained. Note that the `URL` constructor will either throw, or in some cases just ignore them, when encountering `\u0000`-characters during parsing.
Hence it should be *impossible* for a valid URL to contain `\u0000`-characters and we can thus simplify the viewer-code a tiny bit. The use of `removeNullCharacters` is most likely a left-over from back when `new URL()` wasn't generally available in browsers.
…-rm-removeNullCharacters
Stop using `removeNullCharacters` in the `addLinkAttributes` helper function
line
.replaceAll(/^\/\/|^<!--/g, " ")
.replaceAll(/(^\s*)\/\*/g, "$1 ")
.replaceAll(/\*\/$|-->$/g, "")

Check failure

Code scanning / CodeQL

Bad HTML filtering regexp

This regular expression only parses --> and not --!> as a HTML comment end tag.
@jerronjames
jerronjames merged commit 177dc8e into masterSep 1, 2023
@jerronjames
jerronjames deleted the update-remote branch September 1, 2023 17:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@jerronjames@github-advanced-security@Snuffleupagus@calixteman@timvandermeij@TaTo30@stof