Guide 04 / 04Responsive mechanism series

Mechanism guide

Layout Shift

Trace late geometry changes to the element that owns space

Images, fonts, ads, and late content that move an already rendered page.

Evidence verifiedReviewed 2026-08-04
Open RL-012 lab
Fixed RL-012 fixture at a 375 CSS pixel viewport
RL-012 evidenceRL-012 compares a delayed project image with and without intrinsic dimensions while tracking the next content block.
Diagnostic routes
04
Measurements
03
Verified cases
04
Primary sources
09

Start with the mechanism

Understand the failure before changing CSS

Layout shift is an observed movement, not a single implementation mistake. Images can acquire dimensions after a response arrives, font substitution can change line metrics, and delayed banners or third-party slots can be inserted without reserved space. The common investigation question is what changed geometry after the initial layout and which component was responsible for allocating that space.

Use geometric movement as the cross-browser baseline and treat Layout Instability API entries as additional evidence only where supported. A zero score does not prove that nothing moved if the browser did not expose the API entry, recent input excluded it, or the measurement watched the wrong target. Preserve before and after rectangles, timing, focus state, and the exact insertion or substitution event.

First diagnostic questionWhich late event changed occupied space before the user reached the next task?

Decision routes

Choose the route that matches the measured signal

These branches describe different ownership boundaries. Follow the signal that matches the page, then open the linked fixture to compare a controlled failure with its smallest verified correction.

Image dimensions arrive after layout

Visible signal
Content below an image moves when the image source becomes available, especially on a cold load or slower connection.
Likely mechanism
The browser cannot reserve the final aspect-ratio box before intrinsic dimensions or an equivalent ratio are known.
Next measurement
Provide valid width and height attributes or an authored aspect ratio, then verify the rendered size remains responsive.

Font substitution changes line geometry

Visible signal
Text rewraps or changes height when the final font replaces the initial metrics.
Likely mechanism
Fallback and final glyph metrics produce different line breaks and block dimensions.
Next measurement
Measure the text and following target before and after substitution. Improve loading and metric compatibility without claiming one universal font strategy.

Delayed embed or ad slot starts at zero height

Visible signal
An empty region later receives content and pushes the article below it, even though the inserted asset itself has stable dimensions.
Likely mechanism
The owning slot did not declare space before asynchronous content arrived.
Next measurement
Reserve a reviewed slot size or aspect ratio based on actual supported formats, and define behavior when no content is returned.

Consent or notification interface is inserted into flow

Visible signal
A notice appears after initial render and moves the active task, or an overlay avoids movement but obscures content and focus.
Likely mechanism
The interface changes normal-flow geometry without a prepared region, or leaves normal flow and creates an obstruction instead.
Next measurement
Choose a real production interaction model, reserve or overlay deliberately, and test geometry together with keyboard focus restoration.

Numbers before conclusions

Measurement reference

Use the same measurements before and after a change. A fix is credible when it improves the intended boundary without making content or controls less reachable.

SignalHow to measureHealthy outcome
Target movement delta

Record a stable target top coordinate immediately before and after the controlled late event.

The fixed state keeps the target coordinate stable unless movement is an intentional response to user input.

Reserved versus rendered geometry

Compare the slot, image, or notice region before loading with the final rendered width, height, and aspect ratio.

The initial reservation matches every supported final format closely enough to prevent unintended downstream movement.

Event and focus timeline

Record when insertion or substitution occurs, whether recent input preceded it, and which element owns focus afterward.

Geometry evidence can be tied to one reproducible event and keyboard continuity is preserved through the update.

Repeatable method

Inspection workflow

  1. 01

    Choose a stable target below the event

    Measure an element whose movement represents user-visible disruption, not only the late-loading element itself.

    Keep: Record the target selector and its top coordinate before the event.

  2. 02

    Control the late event

    Use a deterministic delayed image, font substitution, slot insertion, or notice insertion so repeated runs describe the same mechanism.

    Keep: Record fixture version, delay trigger, and the state before insertion or substitution.

  3. 03

    Measure geometry before and after

    Capture subject height, reserved region height, target position, and resulting movement. Collect Layout Instability API entries only as a supported supplement.

    Keep: Keep the movement in CSS pixels and disclose browser API coverage.

  4. 04

    Assign space to the owning component

    Provide intrinsic image dimensions, improve font metric behavior, reserve a delayed slot, or define the notice region and focus path. Avoid unrelated page-wide minimum heights.

    Keep: The fixed state should preserve the same content and event while eliminating unintended target movement.

  5. 05

    Test real content variants

    Check responsive image sizes, font fallback conditions, supported slot formats, translated consent text, and empty or failed asynchronous responses.

    Keep: Document which variants were tested and which remain outside the conclusion.

What controlled fixtures reveal

Field notes

These details are easy to miss when a page is checked at only one width or with idealized content. They turn the guide into a repeatable review rather than a one-off patch.

01

Test cold and warm paths

Cached images or fonts may arrive too quickly to expose the first-load geometry change seen by a new visitor.

Apply: Keep a deterministic delayed fixture and separately verify the optimized cached path does not introduce a different state.

02

Treat API data as supplemental

Layout Instability entries depend on browser support and eligibility rules, while element rectangles remain broadly measurable.

Apply: Store geometric before-and-after evidence in every browser and attach API entries only where the runtime reports them.

03

Define empty and failure states

A reserved slot can leave unexplained blank space when an asset, ad, or remote response never arrives.

Apply: Specify when the reservation collapses, what replaces it, and how that transition affects movement and focus.

Do not trade one defect for another

Common misfixes

Hide movement with animation

A transition can make motion look smoother while the target still changes position and may remain disruptive or inaccessible.

Use instead: Reserve stable geometry first; use motion only when it serves the interaction and respects reduced-motion preferences.

Move every late element to a fixed overlay

Removing an element from flow can trade layout movement for content obstruction, focus loss, or an unusable mobile viewport.

Use instead: Evaluate insertion and overlay models against both geometry and keyboard access.

Use one arbitrary min-height for all variants

The value may waste space for small content and still fail for translated text, alternate ad formats, or narrow layouts.

Use instead: Reserve space from a controlled format contract and test each supported size or content state.

Treat one API score as the entire result

API support and entry eligibility vary, while real target geometry can still move.

Use instead: Keep before-and-after rectangles as the common baseline and label API data by browser.

Before publishing the component

Release checks

  • Images provide valid intrinsic dimensions or an equivalent reserved aspect ratio.
  • Font loading and fallback behavior have been tested with representative text.
  • Delayed slots reserve only reviewed formats and define empty-state behavior.
  • Consent and notification interfaces preserve both geometry and keyboard continuity.
  • Movement is recorded geometrically across browsers, with API limits disclosed.
  • The fixed state retains the same late event rather than removing the tested content.

Project-owned fixtures

Verified Layout Shift cases

4 implemented

Each case includes a failing and fixed fixture, exact CSS or script diff, current-browser measurements, and a three-browser evidence manifest.

Source boundary

Primary references used by these cases

The guide summarizes project measurements. Normative behavior and accessibility requirements remain linked to the primary sources reviewed for each case.