Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-minor] XFA - Remove the xfaLayer from the DOM when resetting pages (bug 1721977, PR 13427 follow-up) #13782

Merged
merged 2 commits into from
Jul 24, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Originally the xfaLayer wasn't implemented in such a way that it supported being removed from the DOM when pages were evicted from the cache, however this limitation was lifted in PR #13427 and the xfaLayer should thus be handled similar to e.g. the annotationLayer.

In addition to removing the xfaLayer from the DOM, this patch also implements proper rendering/hiding-handling for it (mirroring the annotationLayer-code).

Please note: This patch is tagged API-minor just in case[1], since it changes the signatures of a couple of PDFPageView-methods to improve readability of the code.


[1] Although users are hopefully not directly accessing any of the affected methods, and are rather using e.g. PDFViewer in which case none of these changes will matter.

…ages (bug 1721977, PR 13427 follow-up)

Originally the `xfaLayer` wasn't implemented in such a way that it supported being removed from the DOM when pages were evicted from the cache, however this limitation was lifted in PR 13427 and the `xfaLayer` should thus be handled similar to e.g. the `annotationLayer`.

In addition to removing the `xfaLayer` from the DOM, this patch *also* implements proper rendering/hiding-handling for it (mirroring the `annotationLayer`-code).

*Please note:* This patch is tagged API-minor just in case[1], since it changes the signatures of a couple of `PDFPageView`-methods to improve readability of the code.

---
[1] Although users are *hopefully* not directly accessing any of the affected methods, and are rather using e.g. `PDFViewer` in which case none of these changes will matter.
@mozilla mozilla deleted a comment from pdfjsbot Jul 23, 2021
@mozilla mozilla deleted a comment from pdfjsbot Jul 23, 2021
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/42f674b85446bb4/output.txt

…Layer` rendering

There's no good reason, as far as I can tell, to have `PDFPageView.reset` attempt to cancel `annotationLayer`/`xfaLayer` rendering in one special-case (this is mostly a leftover from older code). Previously cancelling was moved into the separate `PDFPageView.cancelRendering`-method, and by slightly tweaking the conditions there we're able to remove a bit of now unnecessary code from the `PDFPageView.reset`-method.
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/42f674b85446bb4/output.txt

Total script time: 5.23 mins

Published

@marco-c marco-c requested a review from calixteman July 23, 2021 15:52
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way to handle annotation & xfa layers is now consistent thanks to this patch: r+.

@Snuffleupagus Snuffleupagus merged commit 834a638 into mozilla:master Jul 24, 2021
@Snuffleupagus Snuffleupagus deleted the viewer-reset-xfaLayer branch July 24, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants