PSA: Make window.screen report the display size when in fullscreen

27 views
Skip to first unread message

Mike Wasserman

unread,
Apr 14, 2023, 1:23:10 PM4/14/23
to blink-dev, Ajay Rahatekar, Brad Triebwasser, jsb...@chromium.org, mfo...@chromium.org, hisb...@chromium.org, elad...@chromium.org

Contact emails

m...@chromium.org


Specification

https://www.w3.org/TR/cssom-view-1/#the-screen-interface


Summary

Make window.screen report the display size, instead of frame size, when in fullscreen.


A speculative browser-specific workaround in 2020 made window.screen return the frame size in fullscreen, for potential developer misuse of screen sizes for page layout in tab-capture fullscreen.


That workaround did not resolve any known defects, and causes unexpected Blink-specific behavior:

- screen sizes animate as windows enter/exit fullscreen

- screen sizes shrink when devtools or certain OS accessibility tools are docked in fullscreen

- screen sizes change in tab-capture fullscreen, and as that tab is made foreground or background


The change enables FullscreenScreenSizeMatchesDisplay by default, reverting those behaviors.


Blink component

Blink>Screen


TAG review

Not planned.


Risks

Any impact is constrained to limited circumstances (e.g. tab-capture or docked-devtools fullscreen), and this change restores parity with other browsers, but it is unclear to what extent sites might incorrectly rely on window.screen dimensions for fullscreen page layout. Manual inspection found a minor effect on a video player when its fullscreen frame was reduced to minimum dimensions.


The feature flag can be used to halt rollout, if significant issues arise.


Gecko & WebKit: No signal.

This increases parity with Firefox and Safari, but only Blink supports tab-capture.


Web developers: Positive.

Bug reports and partner interactions have been supportive of this change


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Mostly - https://wpt.live/fullscreen/api/element-request-fullscreen-screen-size.https.html 

(WPTs cannot open and dock devtools or accessibility tools at the moment)


Flag name

FullscreenScreenSizeMatchesDisplay


Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1367416


Estimated milestones

Stable on M114


Reply all
Reply to author
Forward
0 new messages