w3c / webdriver

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

Switch To Window (and possibly other commands) should restore the window if iconified #1229

Open burg opened 6 years ago

burg commented 6 years ago

In chapter 10. Command Contexts, section 10.3 Switch To Window:

Update any implementation-specific state that would result from the user selecting the current browsing context for interaction, without altering OS-level focus.

I'm implementing minimize and maximize, and find myself wondering about weird corner cases. In particular, I can't tell whether Switch to Window would implicitly un-iconify the window of the specified browsing context or not. Since a user couldn't interact with an iconified window, the quoted step above would seem to imply that the associated window should be un-iconified and the relevant tab should be selected. But if this is the case, then the remote end steps should say "restore the window".

If switching to a window does not implicitly un-iconify it, then we run into weird implementation issues where restoring a window may implicitly switch the active tab as well (if the UA can't switch tabs while iconified).

andreastt commented 6 years ago

Other commands are explicit about restoring the window from its iconified state. I don’t know if it’s reasonable for Switch To Window to also do this considering WebDriver normally says that focus should not matter.

On the other hand documents in iconified windows trigger special behaviour in UAs. When document.hidden is true it is not unknown for a UA to for example put the tab into “background mode” to reduce power consumption &c.

I also don’t think it’s the intention of WebDriver to allow automation of iconified windows.

shs96c commented 6 years ago

I don't think we ever considered it in the face to face sessions, but it seems reasonable to restore a window when switching to it.

On Tue, Feb 20, 2018 at 10:21 AM, Andreas Tolfsen notifications@github.com wrote:

Other commands are explicit about restoring the window from its iconified state. I don’t know if it’s reasonable for Switch To Window to also do this considering WebDriver normally says that focus should not matter.

On the other hand documents in iconified windows trigger special behaviour in UAs. When document.hidden is true it is not unknown for a UA to for example put the tab into “background mode” to reduce power consumption &c.

I also don’t think it’s the intention of WebDriver to allow automation of iconified windows.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/w3c/webdriver/issues/1229#issuecomment-366932249, or mute the thread https://github.com/notifications/unsubscribe-auth/AABuRT1rHRL8MPM-09R5T0446udZfk8Aks5tWpyagaJpZM4SI1OJ .

andreastt commented 6 years ago

Are there other commands that should also restore the window?