Skip to content

Request for position: Layout Instability API CSS pixel attribution #588

@anediaz

Description

@anediaz

WebKittens

@annevk

Title of the proposal

Layout Instability API CSS pixel attribution

URL to the spec

https://wicg.github.io/layout-instability/

URL to the spec's repository

https://github.com/WICG/layout-instability

Issue Tracker URL

No response

Explainer URL

WICG/layout-instability#125

TAG Design Review URL

No response

Mozilla standards-positions issue URL

No response

WebKit Bugzilla URL

No response

Radar URL

No response

Description

This is a compatibility improvement to the Layout Instability API to align attribution rectangle reporting with other Web Platform APIs.

Current behavior: The LayoutShiftAttribution interface reports previousRect and currentRect values in device pixels.

Proposed change: Report these rectangles in CSS pixels instead, consistent with getBoundingClientRect(), IntersectionObserver, and ResizeObserver.

Rationale:

  • Device pixels cause inconsistencies across different device pixel ratios
  • Developers need to correlate layout shift measurements with other DOM measurements which use CSS pixels
  • CSS pixels are the standard coordinate system for web content

Status: This feature is currently behind a flag in Chrome. We are seeking vendor feedback before broader enablement.

Impact: This is a minimal breaking change as the API has limited adoption while behind a flag.

Implementation: Chromium bug
ChromeStatus: https://chromestatus.com/feature/5155103518228480

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions