w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
685 stars 195 forks source link

setWindowRect when nothing is possible #1844

Open gsnedders opened 1 month ago

gsnedders commented 1 month ago

See also https://github.com/w3c/webdriver/issues/1826

The spec currently says under https://w3c.github.io/webdriver/#dfn-set-window-rect:

If the remote end does not support the Set Window Rect command for session's current top-level browsing context for any reason, return error with error code unsupported operation.

NOTE In case the Set Window Rect command is partially supported (i.e. some combinations of arguments are supported but not others), the implmentation is expected to continue with the remaining steps.

Arguably, any implementation can support the Set Window Rect command because everything it does is behind branches like "if the implementation is able to set the dimensions of window" and "if the implementation is able to set the position of window", which results in it being a no-op (roughly; it dismisses prompts and exits fullscreen and restores the window, still).

https://issues.chromium.org/issues/40193012 changed the ChromeDriver behaviour to make it a no-op, rather than failing with unsupported operation, on Android. (See https://github.com/web-platform-tests/wpt/issues/18465#issuecomment-2420566669.)

We should probably tighten up the spec text, rather than using something like "does not support the Set Window Rect command" (because you clearly do, you're literally running the steps for it). One possible option is to actually move this step to after "window" as variable in the spec text has been defined, and then change the step to something like:

If the implementation is both unable to set the dimensions of window and unable to set the position of window, return error with error code unsupported operation.