mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
servoshell: Respond resize with authentic result and Adjust minimum window size (#38258)
- We no longer pretend that resize is always successful and simplify the result computation. - Adjust minimum window size to match other browsers and the test expectation. - Restrict some unnecessary access specifier. Testing: ` ./mach test-wpt -r "tests\wpt\tests\webdriver\tests\classic\set_window_rect\set.py" --log-raw "D:\servo test log\set.txt" --product servodriver {--headless}` Fixes: #37804 as Task 8 is last task. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
d39e701b46
commit
928934d4b0
5 changed files with 25 additions and 37 deletions
|
@ -15,12 +15,17 @@ use servo::{Cursor, RenderingContext, ScreenGeometry, WebView};
|
|||
use super::app_state::RunningAppState;
|
||||
|
||||
// This should vary by zoom level and maybe actual text size (focused or under cursor)
|
||||
pub const LINE_HEIGHT: f32 = 76.0;
|
||||
pub const LINE_WIDTH: f32 = 76.0;
|
||||
pub(crate) const LINE_HEIGHT: f32 = 76.0;
|
||||
pub(crate) const LINE_WIDTH: f32 = 76.0;
|
||||
// MouseScrollDelta::PixelDelta is default for MacOS, which is high precision and very slow
|
||||
// in winit. Therefore we use a factor of 4.0 to make it more usable.
|
||||
// See https://github.com/servo/servo/pull/34063#discussion_r2197729507
|
||||
pub const PIXEL_DELTA_FACTOR: f64 = 4.0;
|
||||
pub(crate) const PIXEL_DELTA_FACTOR: f64 = 4.0;
|
||||
|
||||
/// <https://github.com/web-platform-tests/wpt/blob/9320b1f724632c52929a3fdb11bdaf65eafc7611/webdriver/tests/classic/set_window_rect/set.py#L287-L290>
|
||||
/// "A window size of 10x10px shouldn't be supported by any browser."
|
||||
pub(crate) const MIN_INNER_WIDTH: i32 = 20;
|
||||
pub(crate) const MIN_INNER_HEIGHT: i32 = 20;
|
||||
|
||||
pub trait WindowPortsMethods {
|
||||
fn id(&self) -> winit::window::WindowId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue