-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Set the dimensions of the various layers at their creation #15770
Conversation
calixteman
commented
Dec 1, 2022
- Use a unique helper function in display/display_utils.js;
- Move those dimensions in the css' side.
7679888
to
f74123d
Compare
I'm holding off on testing/review this a little bit, since it seems like a good idea to not land this and the textLayer changes in the same mozilla-central update to make finding/handling any potential regressions easier. |
Let's check that all tests pass before I attempt to test/review this in more detail. /botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/b5bd616cd30f003/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/cd15a82bb16bcf8/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/cd15a82bb16bcf8/output.txt Total script time: 25.52 mins
Image differences available at: http://54.241.84.105:8877/cd15a82bb16bcf8/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/b5bd616cd30f003/output.txt Total script time: 32.97 mins
Image differences available at: http://54.193.163.58:8877/b5bd616cd30f003/reftest-analyzer.html#web=eq.log |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/b92a859cde35041/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/b92a859cde35041/output.txt Total script time: 1.26 mins Published |
One observation here is that in some PDF documents the page-containers, and all of their layers, are no longer guaranteed to have integer dimensions. Hopefully that's not really an issue anywhere in the viewer, e.g. in the scrolling and visibility-checking code, but it's a sort-of "noticeable change" and one that I cannot immediately tell if it'll always be safe (given the age of this viewer code). |
I'd say that the problem of non-integer dimensions exists for a while because of the |
The difference is that previously it never happened for the |
Ah yes that's true. |
As far as I understand things, that one is async. Please keep in mind that there's a bunch of situations where we need to access the visible elements synchronously, so I'm not sure how well that'd work in general.
Could it not potentially lead to the wrong page being considered as the most visible, thus affecting things such as rendering prioritization in some edge-cases, exactly because of the rounding that you mention!? |
Yep I know it's risky and I'll try to figure out a way to reduce the risk as much as possible but this patch is not a priority for the moment.
In the future, we can use: I think |
What's the status of that feature, w.r.t. being enabled by default? |
And to clarify my goal isn't to change just because changing is kind of good/cool, but I just want to simplify things because I want to not be scared by any changes and I want to improve performance in general. |
For now it's only in nightly: |
Did you receive any feedback on this, since it'd likely be the overall "safest" thing we could to do here? |
Yep, @emilio told me that we could try to enable it by default in 110. So my feeling is that this patch will bring a potential new inaccuracy to something which is already inaccurate but it doesn't mean that it'll be more inaccurate (errors can compensate themselves sometimes). |
Please note that my point was/is not actually about that particular code-path, but rather about the various cases throughout the |
Ok, so what could happen ? Again, why not using the -0.5px trick in order to have exactly the same behaviour as now ? |
And if there are some bugs, we'll fix them as usual :) |
Sorry if it was unclear, #15770 (comment) was only about your previous suggestion to maybe use |
Ok I thought it was about this patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK let's try this, since I'm assuming that this won't land in mozilla-central until the 110-cycle thus giving us some time to find problems.
But please file a follow-up issue about using CSS round
as soon as that one becomes generally available in Firefox!
Sorry to ask again, but why not use the |
I don't fully understand how that helps, since it still leads to non-integer dimensions for these layers. Hence we have a situation where the actual dimensions differ from what e.g. Edit: However it that approach really is better, until CSS |
It'd help to at least have the same values as now for those dimensions. |
- Use a unique helper function in display/display_utils.js; - Move those dimensions in css' side.
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/f2837aad1b58027/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8834b9fea6a4d86/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/8834b9fea6a4d86/output.txt Total script time: 4.21 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/f2837aad1b58027/output.txt Total script time: 13.41 mins
|
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/2b35cd603c8b9d0/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/0091948a878309c/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/2b35cd603c8b9d0/output.txt Total script time: 21.49 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/0091948a878309c/output.txt Total script time: 24.14 mins
|
…ts (follow-up of mozilla#15770) In order to move the annotations in the DOM to have something which corresponds to the visual order, we need to have their dimensions/positions which means that the parent must have some dimensions.
…ts (follow-up of mozilla#15770) In order to move the annotations in the DOM to have something which corresponds to the visual order, we need to have their dimensions/positions which means that the parent must have some dimensions.
The annotation layer dimensions must be set before adding some elements (follow-up of #15770)