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

Move css --scale-factor variable into the viewer container #15929

Closed
calixteman opened this issue Jan 16, 2023 · 0 comments · Fixed by #15930
Closed

Move css --scale-factor variable into the viewer container #15929

calixteman opened this issue Jan 16, 2023 · 0 comments · Fixed by #15930

Comments

@calixteman
Copy link
Contributor

In looking in some profiles, I noticed from time to time that some time is spent in getting some images visible in the toolbar, which doesn't really make sense.
So I thought that the scope where a css variable is defined could matter and then after reading https://lisilinhart.info/posts/css-variables-performance/ I thought it really matters.
So I tried...
Here is a profile with no change (I just played with the mouse wheel to zoom/unzoom on windows 11):
image
and another one where the variable has been moved in the viewer container:
image

calixteman added a commit to calixteman/pdf.js that referenced this issue Jan 17, 2023
When a css variable is update in a node then all the children under this
node are updated.
In order to avoid to update all the UI when a page is rescaling, this
patch moves the --scale-factor from the :root to the viewer container.
calixteman added a commit that referenced this issue Jan 17, 2023
Move --scale-factor variable in the viewer container (fix #15929)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant