webdriver: Get the window position as well as the size when resolving "Get Window Rect"#37812
Conversation
Signed-off-by: Euclid Ye <[email protected]>
window_rect to WindowPortsMethods to Implement "Get Window Rect" in WebDriver
window_rect to WindowPortsMethods to Implement "Get Window Rect" in WebDriverfn window_rect to WindowPortsMethods to Implement "Get Window Rect" in WebDriver
There was a problem hiding this comment.
I also explored another possibility to reuse script handler: because we want result as close to window.ScreenY, window.OuterHeight etc. as possible.
Right now, this is done in Script like following:
servo/components/script/dom/window.rs
Lines 1662 to 1666 in a13f9bc
It sends the request to compositor, who ignores the toolbar height etc, giving inaccurate result.
That's why I give up "reusing" and implements a new one directly in embedder. I filed a new issue below.
fn window_rect to WindowPortsMethods to Implement "Get Window Rect" in WebDriverSigned-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
It seems Firefox does exactly the same as Servo. But Chrome/Edge correctly reports So I believe this cannot be easily fixed.. @mrobinson @jdm EDIT: On Linux the result is perfect for Servo/Firefox as well. So it is misusage of Windows API from Winit & nsWindow I believe.🤣 |
servo/tests/wpt/tests/webdriver/tests/support/helpers.py Lines 230 to 233 in 87bbe0b I just saw this and believe Firefox/Servo + Chrome/Edge are all correct, with their own fashion. |
GetWindowSizetoGetWindowRect(0, 0, ScreenWidth, ScreenHeight)which is a static value.fn window_recttoWindowPortsMethods. Implement it for both Headless Window and Headed Window.Testing: Tested manually with powershell script. Result is now dynamic and reflects the truth.
Fixes: Task 1 & 2 of #37804