mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
webdriver: Implement maximize window for both headless&headed window (#38271)
- Implement [Maximize Window](https://w3c.github.io/webdriver/#maximize-window) - Previously, headless window screen size is same as inner size if not specified in preference. We make it double as required by the test to not have max window initially. - Some other random cleanup. Testing: webdriver Stress test for maximize window (headed + headless). --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
9ef4d0c9d7
commit
a3de3ffa75
11 changed files with 76 additions and 91 deletions
|
@ -767,10 +767,7 @@ impl WindowPortsMethods for Window {
|
|||
// this prevents a crash in the compositor due to invalid surface size
|
||||
self.winit_window.set_min_inner_size(Some(PhysicalSize::new(
|
||||
MIN_INNER_WIDTH,
|
||||
i32::max(
|
||||
MIN_INNER_HEIGHT,
|
||||
(self.toolbar_height() * self.hidpi_scale_factor()).0 as i32,
|
||||
),
|
||||
MIN_INNER_HEIGHT.max((self.toolbar_height() * self.hidpi_scale_factor()).0 as i32),
|
||||
)));
|
||||
}
|
||||
|
||||
|
@ -808,6 +805,10 @@ impl WindowPortsMethods for Window {
|
|||
Some(winit::window::Theme::Light) | None => servo::Theme::Light,
|
||||
}
|
||||
}
|
||||
|
||||
fn maximize(&self, _webview: &WebView) {
|
||||
self.winit_window.set_maximized(true);
|
||||
}
|
||||
}
|
||||
|
||||
fn winit_phase_to_touch_event_type(phase: TouchPhase) -> TouchEventType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue