ui/conversation-web-view.css: Work around oversized email body height
Sometimes when loading an email body, the viewport for the web view will be set to 0 (when the web view is hidden or not yet laid out in the widget hierarchy?). When this happens, since the width of the body is specified as 100vw, the content width is reduced to the absolute minimum and hence the content height is stretched right out. Then, when the web view is displayed, the viewport width increases but the extra whitespace is never reclaimed (scrollHeight never goes down), so the height of the web view remains way too large, causing large amounts of whitespace at the end of the email message (i.e. #283). To work around this, set a min width for the HTML element so the initial height of the email body isn't too badly wrong.
This commit is contained in:
parent
40f97de745
commit
0e783de5bf
1 changed files with 9 additions and 0 deletions
|
|
@ -23,6 +23,15 @@ html {
|
|||
width: 100vw !important;
|
||||
height: max-content !important;
|
||||
|
||||
/* Despite the fact that the width must always be defined by the
|
||||
viewport, the viewport width will be 0 if the email is loaded before
|
||||
its WebView is laid out in the widget hierarchy. As a workaround, to
|
||||
prevent this causing the email being squished down to is minimum
|
||||
width and hence being stretched right out in height, set a
|
||||
reasonable minimum width. See
|
||||
https://gitlab.gnome.org/GNOME/geary/-/issues/283 */
|
||||
min-width: 400px !important;
|
||||
|
||||
/* Lock down the box sizing just enough so that the width and height
|
||||
constraints above work as expected, and so the element's
|
||||
scrollHeight is accurate. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue