Files
sousa-gecko/testing/web-platform/tests/css/css-sizing/responsive-iframe/resources/iframe-contents-navigation.html
T
Koji Ishii e2f058e21b Bug 2046818 [wpt PR 60522] - [iframe] Reset the size when navigating cross-origin, a=testonly
Automatic update from web-platform-tests
[iframe] Reset the size when navigating cross-origin

This patch resets the intrinsic size info from `<iframe>`
content when the content navigates cross-origin, to prevent
leaking the size information.

To do this, when `DocumentLoader` for an `<iframe>` child
content checks if it's a cross-origin navigation in
`CommitNavigation()`, and clears the natural dimension if so.

`FrameLoader` is changed to keep the old document origin.

`RenderWidgetHostViewChildFrame` needs a new queue for the
intrinsic size events, as its `frame_connector_` isn't set yet
at the `CommitNavigation()` timing.

`content_switch_dependent_feature_overrides.cc` is needed to
change to enable the flag in the browser when testing. In the
non-testing environments, the flag in Blink and Browser are
automatically synchronized.

The existing test `responsive-iframe-navigation.html` is
extended to test cross-origin as a new variant. In addition,
it tests the initial viewport size of the child frame.

All changes are under a runtime flag.

Bug: 418397278
Change-Id: If8977a4fab2f9bf0c7bdb7bd2dc7c939b2b03f64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7893591
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1644590}

--

wpt-commits: baafee6d47fb8e90bdcd186d9cf2378042081b96
wpt-pr: 60522
2026-06-12 15:23:00 +00:00

17 lines
344 B
HTML

<!doctype HTML>
<head>
<meta name="responsive-embedded-sizing">
<style>
body { margin: 0; }
#box { width: 100px; height: 200px; background: blue; }
</style>
</head>
<div id="box"></div>
<script>
window.addEventListener('message', (e) => {
if (e.data && e.data.action === 'navigate') {
window.location.href = e.data.url;
}
});
</script>