Skip to content

Add VisualViewport.segments support data #6265

@aabizri

Description

@aabizri

While the Visual Viewport API is already tracker (see here, as well as several of its VisualViewport's properties (including scale, width and others), segments isn't.

This property is defined by the standard: https://wicg.github.io/visual-viewport/#the-visualviewport-interface, and allows a script to query of how many and what type of segments (screen sections for foldables, screens for the Surface Duo) the display area is made of.

It is currently only supported by Edge (you can test it by checking for window.visualViewport.segments: if it is undefined then the feature is unsupported, if null then your screen is made up of only one display, if it's an array then you're on a foldable/multi-segment device (It can also be simulated in the developer tools).

Here's some documentation on the feature:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions