-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Use a ResizeObserver
to update the layout of PDFFindBar
#17152
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
Use a ResizeObserver
to update the layout of PDFFindBar
#17152
Conversation
*Please note:* In the Firefox PDF Viewer this findbar is only used for PDF documents placed in e.g. `<iframe>` elements. By registering a `ResizeObserver` when the `PDFFindBar` is open we slightly unify and simplify how the findbar layout (row vs column) is handled. This will be especially helpful with upcoming changes, where we'll make use of "data-l10n-id"/"data-l10n-args" to trigger translation in the viewer.
2e4f582
to
e20ef39
Compare
/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/5d776faa3756ea9/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/5d776faa3756ea9/output.txt Total script time: 1.44 mins Published |
Can't we achieve the same layout change with flex-wrap ? |
Unfortunately I don't believe that this helps, since the findbar then becomes too wide once wrapping occurs; please note Lines 195 to 198 in a4cd2ef
|
Ok, that's unfortunate, that said I way prefer this solution (i.e. the one in 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.
LGTM. Thank you.
Please note: In the Firefox PDF Viewer this findbar is only used for PDF documents placed in e.g.
<iframe>
elements.By registering a
ResizeObserver
when thePDFFindBar
is open we slightly unify and simplify how the findbar layout (row vs column) is handled.This will be especially helpful with upcoming changes, where we'll make use of "data-l10n-id"/"data-l10n-args" to trigger translation in the viewer.