Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use referrer policy from policy container #1233

Merged
merged 2 commits into from
May 31, 2021
Merged

Conversation

antosart
Copy link
Member

@antosart antosart commented May 12, 2021

This is a companion change to whatwg/html#6677, which moves referrer policy into the policy container.

As a consequence of this change, the referrer policy used for the request is a snapshot of the relevant referrer policy when the request is being created, and won't change during the lifetime of the request, addressing a variant of #832 for referrer policy.


Preview | Diff

@antosart
Copy link
Member Author

This depends on whatwg/html#6677

@antosart antosart requested a review from domfarolino May 12, 2021 08:08
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Looks good, but we should also update this note:

This can be used to override a referrer policy associated with an environment settings object.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I guess we'll wait for @domfarolino to double check (as he's also signed up for the other PRs), but this looks good from my perspective. Thanks!

@antosart
Copy link
Member Author

Looks good, but we should also update this note:

Done, although I am not sure about the formulation (in principle, this can be used to override policy container's referrer policy, which in turn can be used to override the environment settings objects' policy container's referrer policy).

@domfarolino
Copy link
Member

I've been traveling the last few days; I'll check this out within the next two days.

Copy link
Member

@domfarolino domfarolino left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

annevk pushed a commit to whatwg/html that referenced this pull request May 31, 2021
This change moves referrer policy from Document/WorkerGlobalScope into policy container. This allows us to simplify several steps (initializing for new empty documents, populating from the response headers, inheriting for local scheme documents), since they are handled centrally via the policy container mechanisms.

Companion PRs:
* whatwg/fetch#1233
* w3c/ServiceWorker#1593 (removes referrer policy from service workers as that comes for free with policy container)
* w3c/webappsec-referrer-policy#152

The change is mostly a refactoring and should have no significant behavioral changes, apart from simplifying the referrer policy inheritance mechanism. The most visible behavioral change of this is that referrer policy of a srcdoc iframe will be now copied from the parent document at creation time instead of referencing the parent document referrer policy.
@annevk annevk merged commit 43a0c94 into whatwg:main May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants