w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.44k stars 657 forks source link

[cssom-view] Support for multi-screen devices #7642

Open michaelwasserman opened 2 years ago

michaelwasserman commented 2 years ago

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 CSSOM-View Module. Here are some pertinent high-level proposals in the spec:

  1. Extend the Screen interface with an onchange EventHandler and isExtended boolean.
  2. Refine attribute and method definitions for Window.screenX|Left|Y|Top and Window.moveTo|By().
  3. Refine concepts to define web-exposed screen information for devices with multiple screens.
  4. Define a Window.getScreenDetails() method and ScreenDetails and ScreenDetailed interfaces to supply multi-screen information.

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

michaelwasserman commented 2 years ago

See these inter-related issues filed on CSSOM-View, HTML, and Fullscreen spec repos:

marcoscaceres commented 1 year ago

Just noting this also affects (or would be relied upon) by the screen orientation spec: the screen orientation spec is also needing to be notified when a window gets dragged to another screen, which would cause the values to be updated (orientation type and angle).

It would be nice to have a single model that watches for windows moving from one screen to another and then having the right things/events happen.