mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
servoshell: Consider window decorations when handling resize requests from web content (#38174)
Also fix some docs. This is used by JS `resizeTo`, `resizeBy` and webdriver [set window rect](https://w3c.github.io/webdriver/#set-window-rect). Testing: Can now pass more tests for headed window. Fixes: Well.. Originally the attempt is to address https://github.com/servo/servo/issues/38093#issuecomment-3092284104. But it turns out as a more general problem to be fixed in another PR. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
f62aa8edc2
commit
0b8986c8da
6 changed files with 47 additions and 30 deletions
|
@ -553,11 +553,11 @@ impl WebViewDelegate for RunningAppState {
|
|||
self.inner().window.set_position(new_position);
|
||||
}
|
||||
|
||||
fn request_resize_to(&self, webview: servo::WebView, new_outer_size: DeviceIntSize) {
|
||||
let mut rect = webview.rect();
|
||||
rect.set_size(new_outer_size.to_f32());
|
||||
webview.move_resize(rect);
|
||||
self.inner().window.request_resize(&webview, new_outer_size);
|
||||
fn request_resize_to(&self, webview: servo::WebView, requested_outer_size: DeviceIntSize) {
|
||||
// We need to update compositor's view later as we not sure about resizing result.
|
||||
self.inner()
|
||||
.window
|
||||
.request_resize(&webview, requested_outer_size);
|
||||
}
|
||||
|
||||
fn show_simple_dialog(&self, webview: servo::WebView, dialog: SimpleDialog) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue