Skip to content

Viewports on Mobile #1442

Open
Open

Description

@bramus

Description

Despite widespread specification alignment across CSSWG and CSSOM, multiple core viewport features — including small/large/dynamic viewport units (sv*, lv*, dv*), window.innerWidth/innerHeight layout viewport behavior, visualViewport, and viewport meta tag extensions (viewport-fit, interactive-widget) — remain excluded from standard Interop Focus Areas.

The primary blocker is not spec maturity or implementation intent, but the absence of automated mobile/dynamic test infrastructure in WPT.

Following the initial effort in Interop 2022 Viewport Investigation, previous focus area proposals for Interop 2024 (#444), Interop 2025 (#870), and Interop 2026 (#1084) got rejected because they cannot run in automated CI.

The Mobile Testing Investigation Effort (web-platform-tests/interop-mobile-testing), which spanned Interop 2023, 2024, 2025, and 2026, was originally tasked with solving the underlying mobile test-runner infrastructure. However, during the past year it received no recorded progress, published no meeting notes, and remained at 0% completion. This gives the impression that this effort has effectively halted.

(EDIT: I have been told the group did meet this year, but that notes have been published to the repo)

This proposal establishes a dedicated Interop 2027 Investigation Effort to deliver the test harness primitives (WebDriver / testdriver actions) and test suites required to allow Viewports (and related features) to graduate into a scored Focus Area for Interop 2028.

Rationale

Viewports are the main entrypoint through which you consume a website, so they seem quite fundamental when it comes to being interoperable. Suggesting any of the viewport related features for Interop is effectively blocked on Mobile Testing, which needs to be solved before viewports can be proposed as a scored Focus Area.

Viewport-relative units ranked 18th in https://2026.stateofcss.com/en-US/pain-points/

Investigation Roadmap

Features in Scope:

Feature / Area Relevant Specifications Core Interoperability Question
Viewport-Percentage Units CSS Values and Units Module Level 4 § Viewport-relative Lengths Consistent behavior of sv*, lv*, dv*, vi/vb, and container-query-relative equivalents during URL bar expansion/retraction and dynamic UI resizing.
Layout Viewport Dimensions CSS 2.2 § Visual formatting model, CSSOM View § innerWidth, CSSOM View § innerHeight Divergence between engines on whether window.innerWidth/innerHeight reflect the Layout Viewport, Visual Viewport, or subtract overlay/classic scrollbars and pinch-zoom scales.
Viewport <meta> Extensions CSS Round Display § viewport-fit, CSS Viewport Module Level 1 § interactive-widget Deterministic behavior when virtual keyboards open (resizes-visual, resizes-content, overlays-content) and handling display cutouts (cover, contain, auto).
Visual Viewport API CSSOM View Module Level 1 § visualViewport Accurate dispatch of scroll and resize events on window.visualViewport during pinch-zoom, panning, and keyboard incursions.
The Viewport Interface CSS Viewport Module Level 1 § window.viewport Standardized root interface hosting segment abstractions (window.viewport.segments).

(The Viewport Interface is actually part of the Viewport Segments API, proposed as a focus area in #1440)


Given the status of the Mobile Testing Investigation Effort, I am not sure what exactly to propose as deliverables / roadmap here, but would like to see this at least go somewhere so that viewports on mobile (or emulating mobile) can finally get tested properly. To achieve this, deliverables would include:

  • Test harness primitives (WebDriver / testdriver actions)
    • A continuation of what the Mobile Testing Investigation Effort was set out to do
  • Complete WPT Test Suite
    • Convert the test inventory originally outlined in interop-2022-viewport detailed in interop-mobile-testing #2 into active WPT tests under /css/css-values/, /css/css-viewport/, and /cssom-view/.
    • Author dedicated test coverage for:
      • <meta name="viewport" content="interactive-widget=..."> resize behaviors.
      • <meta name="viewport" content="viewport-fit=cover"> with env(safe-area-inset-*).
      • window.innerWidth / innerHeight during page scale and pinch-zooming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigation-effort-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions