Runs: Chrome 160.0.8162.0 (wpt@fa649586f, 2026-11-15) | Firefox 162.0a1 (wpt@fa649586f, 2026-11-15) | Safari 256 preview (wpt@fa649586f, 2026-11-15) | Ladybird 1.0-c064b (wpt@c0f2b11f4, 2026-11-15) | Servo Servo 0.8 (wpt@76f3efc65, 2026-11-14) | Blitz ea07ee716 (wpt@bbb30d0f5, 2026-11-15)
| Chrome | Firefox | Safari | Ladybird | Servo | Blitz | |
|---|---|---|---|---|---|---|
| Total | 1/1 | 0/1 | 0/1 | 0/1 | 0/1 | 0/1 |
| Subtest | Chrome | Firefox | Safari | Ladybird | Servo | Blitz |
|---|---|---|---|---|---|---|
| Responsive iframe clears size during navigation to non-responsive page | PASS | TIMEOUT | TIMEOUT | TIMEOUT | TIMEOUT | — |
/css/css-sizing/responsive-iframe/responsive-iframe-navigation-unsized.html
<!doctype HTML> <title>Responsive iframe should clear size during navigation to non-responsive page</title> <link rel="author" href="mailto:kojii@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-sizing/"> <meta name="variant" content="?origin=same"> <meta name="variant" content="?origin=cross"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/get-host-info.sub.js"></script> <script src="/common/rendering-utils.js"></script> <style> iframe { frame-sizing: content-height; } </style> <script> // Create an `<iframe>` element. // Make it cross-origin if `?origin=cross`. const iframe = document.createElement('iframe'); iframe.frameBorder = '0'; iframe.src = get_iframe_src(); document.addEventListener('DOMContentLoaded', () => { document.body.appendChild(iframe); }); function get_iframe_src() { const src = 'resources/iframe-contents-navigation.html'; const params = new URLSearchParams(window.location.search); const origin = params.get('origin'); if (origin === 'cross') { const url = new URL(src, window.location.href); return get_host_info().HTTP_REMOTE_ORIGIN + url.pathname; } return src; } function waitForHeight(t, element, targetHeight) { if (element.offsetHeight === targetHeight) { return Promise.resolve(); } return new Promise(resolve => { const observer = new ResizeObserver(() => { if (element.offsetHeight === targetHeight) { observer.disconnect(); resolve(); } }); t.add_cleanup(() => observer.disconnect()); observer.observe(element); }); } async_test(t => { const origin = new URLSearchParams(window.location.search).get('origin'); let numIframeLoadEvents = 0; iframe.addEventListener('load', t.step_func(async () => { ++numIframeLoadEvents; switch (numIframeLoadEvents) { case 1: { await waitForHeight(t, iframe, 200); t.step(() => { assert_equals(iframe.offsetHeight, 200, "Initial height should be 200px"); // Navigate to non-responsive page. const url = 'iframe-contents-unsized.html'; iframe.contentWindow.postMessage({action: 'navigate', url: url}, '*'); }); break; } case 2: { await waitForHeight(t, iframe, 150); await waitForAtLeastOneFrame(); if (origin === 'cross') { await waitForAtLeastOneFrame(); } // The height should have reverted to default (150) because the new page // is not responsive and cleared the sizing info. // If it didn't clear, it would keep 200 or grow to 400. t.step(() => { assert_equals(iframe.offsetHeight, 150, "Height should revert to default 150px"); }); t.done(); break; } } })); }, "Responsive iframe clears size during navigation to non-responsive page"); </script>