Skip to content

servoshell: Respond resize with authentic result and Adjust minimum window size#38258

Merged
jdm merged 4 commits intoservo:mainfrom
yezhizhen:fix-min-possible-size
Jul 25, 2025
Merged

servoshell: Respond resize with authentic result and Adjust minimum window size#38258
jdm merged 4 commits intoservo:mainfrom
yezhizhen:fix-min-possible-size

Conversation

@yezhizhen
Copy link
Copy Markdown
Member

  • 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.

@yezhizhen yezhizhen requested a review from atbrakhi as a code owner July 25, 2025 01:27
@yezhizhen yezhizhen requested review from jdm and xiaochengh July 25, 2025 01:27
@yezhizhen
Copy link
Copy Markdown
Member Author

yezhizhen commented Jul 25, 2025

image Some result for headed window after setting size to 10*10. `reply_rect` is our previous response, which just returns requested size. The second one is true size due to our restriction on inner size, which we're using now.

Copy link
Copy Markdown
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification!

@jdm jdm added this pull request to the merge queue Jul 25, 2025
Merged via the queue into servo:main with commit 928934d Jul 25, 2025
21 checks passed
@yezhizhen yezhizhen deleted the fix-min-possible-size branch July 25, 2025 03:05
Comment on lines +779 to +781
i32::max(
MIN_INNER_HEIGHT,
(self.toolbar_height() * self.hidpi_scale_factor()).0 as i32,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future, this can also be expressed more idiomatically like this:

MIN_INNER_HEIGHT.min((self.toolbar_height() * self.hidpi_scale_factor()).0 as i32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WebDriver Task] Window Size related commands gives inaccurate result

3 participants