html icon indicating copy to clipboard operation
html copied to clipboard

Window object support for multi-screen devices

Open michaelwasserman opened this issue 2 years ago • 4 comments

The Multi-Screen Window Placement spec suggests enhancements for supporting multi-screen devices. I would greatly appreciate feedback and help regarding integrating some of that work in the HTML spec. Here are some pertinent high-level proposals in the spec:

  1. Extend the Window object with a Window.getScreenDetails() method and ScreenDetails and ScreenDetailed interfaces to supply multi-screen information.
  2. Extend the Window.open() steps to support left and top feature definitions relative to a multi-screen origin
  3. Extend both with an internal slot that can be used in lieu of transient activation, to support initiating multi-screen experiences

I invite anyone to discuss this topic in a tentative W3C TPAC 2022 breakout session, and I will file similar issues on CSSOM-View and Fullscreen specs soon. Thank you!

michaelwasserman avatar Aug 24 '22 00:08 michaelwasserman

The most relevant issues to the HTML Standard appear to be (2) and (3). (2) seems pretty straightforward. Can you explain (3) in more detail? What was insufficient about the existing transient activation requirement?

domenic avatar Sep 05 '22 05:09 domenic

Sure, (1) may fit better in CSSOM-View with the Screen interface, or its own spec.

Item (3) stems from web application developer requests (e.g. 1, 2) to open and/or fullscreen multiple windows from a single user activation. Our initial proposal permits a window to enter fullscreen and then open a single popup from one user activation, in appropriate circumstances, to satisfy a prominent subset of developer requests.

I'd like to explore how this relates to item 8 in the the rules for choosing a browsing context, invoked by the window open steps. Perhaps our proposal's criteria already satisfies the specified condition ("If the user agent has been configured such that in this instance it will create a new browsing context"), or perhaps this proposal elicits feedback and ideas, which I would love to discuss!

michaelwasserman avatar Sep 06 '22 23:09 michaelwasserman

Right, so those are the correct steps to look at.

The difference between "If the user agent has been configured such that in this instance it will create a new browsing context" and "If the user agent has been configured such that in this instance it will reuse current" is meant to capture browser settings, e.g. http://kb.mozillazine.org/Browser.link.open_newwindow.restriction . (I suspect such settings were much more prominent in browser settings UI's back in the days when this text was originally written...) So it isn't meant as an escape hatch to do any behavior.

Per spec, you are already allowed to open multiple windows from a single user activation, because doing so does not consume user activation, and thus the user activation will continue lasting for the transient activation duration. The same is true for fullscreen. Both only check for the presence of transient user activation, and neither consume user activation. So I don't think any spec updates are needed, and certainly not a new timestamp.

Maybe browsers are more restrictive than the spec though, today? /cc @mustaqahmed

domenic avatar Sep 07 '22 04:09 domenic