Skip to content

HTML: Snapshot timing of iframe referrerpolicy for location.ancestorOrigins#56675

Closed
zcorpan wants to merge 1 commit intomasterfrom
zcorpan/ancestorOrigins-snapshot
Closed

HTML: Snapshot timing of iframe referrerpolicy for location.ancestorOrigins#56675
zcorpan wants to merge 1 commit intomasterfrom
zcorpan/ancestorOrigins-snapshot

Conversation

@zcorpan
Copy link
Member

@zcorpan zcorpan commented Dec 11, 2025

document.body.append(iframe);
// The referrerpolicy attribute was snapshotted when the initial about:blank doc was created
// https://html.spec.whatwg.org/#the-iframe-element:create-a-new-child-navigable
// https://html.spec.whatwg.org/#child-navigables:creating-a-new-browsing-context
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_array_equals(Array.from(iframe.contentWindow.location.ancestorOrigins), ['null']);
iframe.referrerPolicy = '';
await loaded;
// The referrerpolicy attribute was snapshotted again when the response becomes available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part I don't think is true, but I'l continue the discussion in the HTML PR thread.

@theIDinside
Copy link
Contributor

This test will be synced upstream from firefox repo.

Comments in the test may change a bit to reflect what the intention is better, but the test itself gives the (now) expected results. Maybe @domfarolino could take a quick look when you have time? It's basically just changing results from [null], [window.origin], to [null] and [null], because we're expecting the snap shot to happen at the moment in time when it's done for normal navigation's, therefore this race should not be seen.

// https://html.spec.whatwg.org/#populating-a-session-history-entry:loading-a-document
// https://html.spec.whatwg.org/#populating-a-session-history-entry:navigate-html
// https://html.spec.whatwg.org/#read-html:initialise-the-document-object
assert_array_equals(Array.from(iframe.contentWindow.location.ancestorOrigins), [window.origin]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about this. In #56675 (comment) you say:

but the test itself gives the (now) expected results. [...] It's basically just changing results from [null], [window.origin], to [null] and [null]

But I still see ['null'] above, and [window.origin] here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As previously stated, the fixed test will be upstreamed from the repo

I don't have write access to overwrite what @zcorpan did.

@zcorpan
Copy link
Member Author

zcorpan commented Jan 16, 2026

Closing, see #56966

@zcorpan zcorpan closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments