Files
servo/ports/servoshell
Mukilan Thiyagarajan 38e3397237 servoshell: Fix incorrect calculation of WebView dimension. (#44205)
The upgrade to egui 0.34.0 in #44053 replaced the usage of the
deprecated `Ui::available_rect` method with `Ui::content_rect` as
suggested in the deprecation notice in egui. However, `content_rect` is
not equivalent to `available_rect` and doesn't seem to account for the
area occupied by the egui panels.

Since `content_rect` returns the window's inner dimensions, we don't ask
the webview to resize itself to the correct dimension that excludes the
toolbar (tabs and url). We also pass the correct dimension to egui's
paint callback, which meant that the WebView appeared vertically
squashed.

Fix this by using `available_rect_before_wrap` method instead of
`content_rect`. This seems to return the correct area that we need for
the WebView's dimenstion. The code in egui also seems closer to what we
want as it relies on a cursor that is advanced after each widget is
added. However, I'm not sure in which scenario the wrapping matters as
there is no documentation for this method.

Testing: Tested manually as we don't have automated tests for the shell.
Fixes: #44136

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2026-04-14 12:49:48 +00:00
..
2025-12-10 15:09:49 +00:00
2026-01-01 13:40:20 +00:00