servoshell(egl): Adjust WebViewRenderer size when resizing surface size (#39507)

For egl, previously, the resize function only set rendering_context
size. It needs to change webview_renderer size at the same time.

Testing: Testing the Mossel [homepage](https://www.huaweimossel.com/) on
mobile devices shows no issues when resizing.

---------

Signed-off-by: yjx <yangjingxiao1@huawei.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: yjx <yangjingxiao1@huawei.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
blueguy1 2025-09-27 14:32:43 +08:00 committed by GitHub
parent 2e8fac9395
commit 19da3bc14e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -565,10 +565,10 @@ impl RunningAppState {
/// Let Servo know that the window has been resized.
pub fn resize(&self, coordinates: Coordinates) {
info!("resize to {:?}", coordinates,);
self.active_webview().resize(PhysicalSize::new(
coordinates.viewport.width() as u32,
coordinates.viewport.height() as u32,
));
let size = coordinates.viewport.size;
self.active_webview().move_resize(size.to_f32().into());
self.active_webview()
.resize(PhysicalSize::new(size.width as u32, size.height as u32));
*self.callbacks.coordinates.borrow_mut() = coordinates;
self.perform_updates();
}