Viewport Segments API
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- css, javascript
Research direction
Review the linked W3C specifications and the existing web-platform-tests at https://wpt.fyi/results/viewport/viewport-segments.html. Understand the CSS media queries, environment variables, and JavaScript API for viewport segments. The task likely involves creating or updating interoperability tests for this API, checking for correct behavior across different browser implementations. 'Done' means new or updated tests are added to the repository.
Written by the indexing model from the issue text.
Description
Description
Foldable phones, tablets, and multi-posture laptops represent a growing segment of hardware. While the Device Posture API indicates how a device is held (e.g., folded vs continuous), developers need exact geometric segment boundaries to position columns, sidebars, and critical interface elements without content falling into a physical hinge or fold seam.
The latter is provided by the Viewport Segments API. It exposes the positions, dimensions, and count of logically separate viewport regions formed when a viewport is split across physical folds, hinges, or dual-screen displays. It provides both declarative CSS tools (@media (*-viewport-segments) and env(viewport-segment-* x y)) and imperative JavaScript properties (window.viewport.segments).
Spec links:
- https://drafts.csswg.org/css-viewport/#dom-viewport-segments
- https://drafts.csswg.org/css-env-1/#viewport-segments
- https://www.w3.org/TR/mediaqueries-5/#mf-horizontal-viewport-segments
Specification
(See description, as there are several specs involved)
web-feature
viewport-segments
Test Links
Additional Signals
- Blink / Chromium:
- Gecko / Firefox:
- Not implemented
- Standards Position: no position
- WebKit / Safari:
- Available behind a feature flag in Safari 27.1 beta (simulator)
- Standards Position: no position
(This features goes hand-in-hand with the Device Posture API, but serves a different purpose)
- Dominant language
- JavaScript
- Stars
- 591
- Forks
- 39
- Avg merge
- 3h 8m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from web-platform-tests/interop
-
focus-area-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1363 · 2 comments · 32 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
web-platform-tests/interop#1362 · 1 comment · 5 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
web-platform-tests/interop#1267 · 5 comments · 2 reactions ·
-
meta
Difficulty 1/5 Under an hour Newbie friendliness 62/100
web-platform-tests/interop#931 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
web-platform-tests/interop#1522 ·
All issues in web-platform-tests/interop
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
web-platform-tests/wpt#65844 ·
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Kanevry/session-orchestrator#108 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
awesomemotive/all-in-one-seo-pack#3238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
andromarces/agent-loops#2055 ·
Maintainers usually reply within 1 day