mirror of
https://github.com/servo/servo.git
synced 2025-08-23 06:15:35 +01:00
script: Get the window rectangle from the WebViewDelegate
instead of via the compositor (#37960)
Previously, `screenX`, `screenY`, `outerHeight`, `outerWidth`, `moveBy`, `resizeBy` ask compositor for window rectangle, which then return "inner" rectangle after consulting Embedder. This PR 1. removes `GetClientWindowRect` from compositor, and directly let script ask embedder. 2. add `window_size` to `ScreenGeometry` 3. add a lot of docs to `ScreenGeometry` Testing: `tests\wpt\mozilla\tests\mozilla\window_resizeTo.html` can now pass for Headed Window. Fixes: #37824 --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
d40e9f82a2
commit
c5aeac3cea
16 changed files with 59 additions and 104 deletions
|
@ -124,13 +124,12 @@ impl ServoDelegate for ServoShellServoDelegate {
|
|||
impl WebViewDelegate for RunningAppState {
|
||||
fn screen_geometry(&self, _webview: WebView) -> Option<ScreenGeometry> {
|
||||
let coord = self.callbacks.coordinates.borrow();
|
||||
let offset = coord.origin();
|
||||
let available_size = coord.size();
|
||||
let screen_size = coord.size();
|
||||
Some(ScreenGeometry {
|
||||
size: screen_size,
|
||||
available_size,
|
||||
offset,
|
||||
window_rect: DeviceIntRect::from_origin_and_size(coord.origin(), coord.size()),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue