How to Inspect CSS contain-intrinsic-size and Intrinsic Dimension Placeholders in Safari Web Inspector

When optimising long web applications using CSS containment (contain: size) or native DOM virtualization (content-visibility: auto), the browser engine intentionally isolates the container box from its child elements. Because child nodes are omitted from initial layout calculations, the container’s calculated intrinsic height collapses to 0px. As users scroll down the page and elements enter the viewport, the sudden layout expansion creates jarring scrollbar jumping and severe Cumulative Layout Shift (CLS). The contain-intrinsic-size property provides synthetic placeholder dimensions that preserve geometry while content remains deferred. Safari Web Inspector provides specialized layout visualization tools to audit placeholder accuracy.

Understanding contain-intrinsic-size Syntax Variations

The contain-intrinsic-size property accepts explicit lengths, dual-axis dimensions, or dynamic auto keywords:

  • contain-intrinsic-size: 500px: Sets both width and height placeholders to 500px.
  • contain-intrinsic-size: 100% 450px: Sets intrinsic width to 100% and intrinsic height to 450px.
  • contain-intrinsic-size: auto 450px: The modern standard. The browser uses 450px as an initial estimate. However, once the element is rendered in the viewport, Safari records its true rendered height and reuses that exact height if the element scrolls off-screen again.

Configuring Responsive Feed Components

Author resilient feed and card containers that eliminate scroll jumping:

/* Deferred rendering container */
.feed-story-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 380px;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    background-color: #ffffff;
}

/* Ensure flex/grid children inherit placeholder boundaries */
.feed-story-card img {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
}

Inspecting Intrinsic Dimensions in Safari Web Inspector

To inspect and audit intrinsic size placeholders using Safari Web Inspector on macOS:

  1. Open Safari and navigate to your web page.
  2. Right-click an unrendered element located far down the page and select Inspect Element.
  3. In the Elements panel, inspect the Styles sidebar. Safari displays the active contain-intrinsic-size rule.
  4. Examine the Computed panel and the Box Model widget. While the element remains off-screen, observe that WebKit allocates an exact box height of 380px despite child nodes being skipped.
  5. Scroll the browser window until the card enters view. Observe how WebKit updates the computed height from the placeholder to the exact rendered pixel height without triggering layout recalculations on neighboring elements.

Validating Mobile Inertial Scrolling on iOS

To ensure scroll momentum remains smooth across touch devices:

  • Connect your iPhone to your Mac via USB and inspect the live Safari tab under the Develop menu.
  • Fling the touchscreen rapidly up and down. Confirm that the scroll thumb moves smoothly down the screen track without sudden expansions or jittery jumps.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.