New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom-view] Bring the segments property into visual viewport #9237
Comments
This seems like a pretty reasonable addition to me. As far as I can tell it's just exposing directly in JS what is already exposed to CSS via the |
Is this issue asking for review of the |
You're right, that's exactly this. |
VisualViewport is already in the CSSOM spec draft (see here). I'm asking to add the |
Ahhh, I was looking in CSSOM, not CSSOM View (that's a separate spec). Okay, let me just fix the title/labels, I understand now. |
My bad, I didn't read carefully the name of the spec. I'll wait more folks to comment before I put a PR together, especially the editors of the spec. |
FYI: I moved the visual viewport spec into CSSOM-View but didn't include |
Yes ultimately we want to move this property further along in the standardization process. |
Summary of the discussions on the PR (for discussions in the conf call):
|
The
segments
property allows developers to target dual screens and foldable devices by giving information about the segments (or zones) when the browser window is spanned across the screen(s). There is a good set of pictures to demonstrate what we are trying to achieve here.Work was started by Microsoft in WICG to bring a JavaScript API, link here. The proposed specification adds a
segments
property to thevisualViewport
object.segments
are only defined when the browser window is maximized. They are also defined in CSS pixels. When the browser window state changes (maximized/resized) one needs to listen for theresize
events to query the updatedsegments
.Please note that the
segments
property is intended mostly to mirror in JavaScript what’s being available in CSS (see MQs).Both APIs, CSS and JavaScript went through TAG reviews here and here.
In terms of implementation status, Android and Windows are supported in Chromium based browser (with some caveats). Microsoft Edge does ship the CSS and the JavaScript APIs enabled by default on all platforms. Samsung Internet also is shipping both APIs by default on Android (the only OS they target).
The text was updated successfully, but these errors were encountered: