servoshell: Revert #38307 to fix resize bug (#38381)

Also added some comments to make things clear.
For details, see
https://github.com/servo/servo/issues/38369#issuecomment-3138378527

Testing: Tested on X11 Ubuntu, Wayland Ubuntu, macOS, Windows.
Fixes: #38369

Co-authored-by: minghuaw <michael.wu1107@gmail.com>

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: minghuaw <michael.wu1107@gmail.com>
This commit is contained in:
Euclid Ye 2025-07-31 16:55:00 +08:00 committed by GitHub
parent 36f1a373e3
commit d38781d71d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -409,6 +409,9 @@ impl Minibrowser {
let rect = Box2D::from_origin_and_size(Point2D::origin(), size);
if rect != webview.rect() {
webview.move_resize(rect);
// `rect` is sized to just the WebView viewport, which is required by
// `OffscreenRenderingContext` See:
// <https://github.com/servo/servo/issues/38369#issuecomment-3138378527>
webview.resize(PhysicalSize::new(size.width as u32, size.height as u32))
}