Chrome 154: iframes That Size Themselves to Their Content

Chrome 154 landed on September 22, 2026 with a CSS property called frame-sizing: an <iframe> can now take its height — or its width — from the document inside it, with no measuring code and no messages passed between the two pages. The request has sat in the CSS Working Group for years. It finally has a stable implementation.

The problem: twenty years of workarounds

An <iframe> renders at a fixed size. If the embedded content is taller, an inner scrollbar appears; if it is shorter, whitespace is left behind. And because a parent cannot read the layout of a cross-origin document, every embed on the web — the comment section, the cart widget, the checkout form, the reporting dashboard — converged on the same pattern: a script inside the embedded page measures scrollHeight, posts it to the parent with postMessage, and the parent sets style.height by hand.

It works. It also means every vendor ships its own variant, integration requires coordination between two teams, an open message listener widens the attack surface, and the whole thing fails quietly when content changes after load.

What changed: consent from both sides

The new feature requires an explicit opt-in from both documents. Neither the embedder nor the embedded page can turn it on alone.

The host page applies frame-sizing to the element. Supported values are auto (the current behavior), content-width, content-height, and the logical equivalents content-inline-size and content-block-size.

The embedded page declares its consent with a meta tag in head. That tag cannot be added dynamically after the document loads — it has to be present in the original HTML.

A practical example

On the host page:

css
.embed {
  width: 100%;
  frame-sizing: content-height;
}
html
<iframe class="embed" src="/comments.html" title="Comments"></iframe>

And inside the embedded document:

html
<meta name="responsive-embedded-sizing" content="allow-origins=*">

* allows any origin. In production, name the origins you actually serve; several can be listed space-separated:

html
<meta name="responsive-embedded-sizing"
      content="allow-origins=https://publisher1.example https://publisher2.example">

When content changes after load — an accordion opens, new data arrives — the browser does not continuously observe every layout change inside the embedded document. The embedded page asks for a resize itself, after its DOM mutations are done:

javascript
if ("requestResize" in window) {
  window.requestResize();
}

Where it actually pays off

The clearest beneficiaries are teams shipping interfaces into sites they do not own: payment widgets, booking engines, embedded product listings, dashboards rendered inside a customer portal. You do not control the host page and cannot require its team to add glue code. One meta tag in your output removes an entire page of integration instructions.

The second win is operational. A postMessage listener on the host page accepts messages from any source unless event.origin is checked carefully — and that check is the first thing lost to copy-paste. Moving size negotiation into the browser removes that class of bug outright, and turns the allowlist into a declaration any reviewer can read in one line.

Real-world caveats

Support is narrow today. The feature is in Chrome 154; Firefox and Safari do not support it yet. Treat it as progressive enhancement, not a foundation:

css
.widget {
  width: 100%;
  height: 500px;
}

@supports (frame-sizing: content-height) {
  .widget {
    height: auto;
    frame-sizing: content-height;
  }
}

Resizing has a cost. The content size is communicated after the embedded page loads, which means a layout shift unless a sensible initial size is reserved. Watch the effect on Core Web Vitals, especially on product and checkout pages.

It is not a security layer. frame-sizing complements existing controls such as CSP frame-ancestors and the sandbox attribute; it does not replace them. What is new is that size exchange is a defined platform path instead of a message listener you wrote yourself.

Takeaway

The direction is consistent: what used to need hand-written glue moves into the platform in declarative form — the same way camera and microphone permissions moved from JavaScript into HTML in Chrome 153. If you ship an embed that third parties consume, add the meta tag now. Hosts benefit automatically as support widens, and the postMessage fallback keeps working until it does.

Primary source: Responsive iframes in Chrome 154 — Chrome for Developers