← Back to release summary

Use of CssPixels in LayoutShift API

Category
Performance
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

This feature changes the attribution data (`prevRect` and `currentRect`) in the [LayoutShift API](https://wicg.github.io/layout-instability/) to be reported in CSS pixels instead of physical pixels. The current behavior is inconsistent with other layout-related APIs, which all use CSS pixels. This change improves consistency, simplifies usage for developers, and aligns with expected units in debugging and tooling.

Motivation

The LayoutShift API currently reports shift rectangles in physical pixels, which is inconsistent with most other layout-related APIs that use CSS pixels. This inconsistency can be confusing for developers, especially when debugging or comparing against DevTools. This flag introduces the option to switch to CSS pixels for better developer experience and alignment.

Standards & signals

Samples: https://wpt.fyi/results/layout-instability/attribution-rectangles-css-pixels.html?label=experimental&label=master&aligned

View on chromestatus.com