Skip to content

Add features for permissions policy and feature policy#2661

Merged
foolip merged 15 commits intoweb-platform-dx:mainfrom
ddbeck:permissions-policy
Dec 18, 2025
Merged

Add features for permissions policy and feature policy#2661
foolip merged 15 commits intoweb-platform-dx:mainfrom
ddbeck:permissions-policy

Conversation

@ddbeck
Copy link
Copy Markdown
Collaborator

@ddbeck ddbeck commented Feb 17, 2025

This PR adds a feature for permissions policy and a discouraged feature for feature policy. This is a big mess, so these are draft features.

Unfortunately, BCD doesn't accurately record the data for these features and it it's a bit of work to unwind this. I propose that we add these as drafts for now and, at the time we merge this, file an issue on BCD that requests Feature-Policy and Permissions-Policy be separated into separate keys and see where things go from there.

[This work has been more or less completed. See discussion below.]

The full backstory:

Given this story, we cannot accurately calculate either feature's implementation status in a way that accords with caniuse or, in my opinion, confusing developers (because let me tell you, I was confused about this and I knew most of the backstory already).

@github-actions github-actions Bot added the tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings label Feb 17, 2025
@ddbeck
Copy link
Copy Markdown
Collaborator Author

ddbeck commented Feb 17, 2025

cc: @Elchi3 you might have opinions about this one, since I expect it to impact BCD as well.

Comment thread features/draft/feature-policy.yml Outdated
Comment thread features/draft/permissions-policy.yml Outdated
spec: https://w3c.github.io/webappsec-permissions-policy/
caniuse: permissions-policy
compat_features:
- http.headers.Permissions-Policy
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. I asked about this at the time and it seems like at some point somebody thought about it but nothing else came of it.

@ddbeck
Copy link
Copy Markdown
Collaborator Author

ddbeck commented May 5, 2025

I've sent mdn/browser-compat-data#26708 to start unwinding the compat data, to unblock this PR.

@ddbeck ddbeck marked this pull request as draft May 12, 2025 12:41
@github-actions github-actions Bot added the feature definition Creating or defining new features or groups of features. label Jul 10, 2025
@ddbeck ddbeck force-pushed the permissions-policy branch from 7d084ef to 6e50bcf Compare July 10, 2025 12:23
@ddbeck ddbeck marked this pull request as ready for review July 10, 2025 12:24
@ddbeck
Copy link
Copy Markdown
Collaborator Author

ddbeck commented Jul 10, 2025

@foolip I think this kinda works now. Can I get a re-review?

@ddbeck ddbeck requested a review from foolip July 10, 2025 12:25
Comment thread features/feature-policy.yml
Comment thread features/permissions-policy.yml Outdated
@@ -0,0 +1,7 @@
name: Permissions policy
description: The `Permissions-Policy` response header sets whether a policy-controlled feature, such as an API, may be used in a document.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The allow attribute is the other entrypoint to this feature and should be mentioned in the description, I think.

description: The `Permissions-Policy` response header sets whether a policy-controlled feature, such as an API, may be used in a document.
spec: https://w3c.github.io/webappsec-permissions-policy/
caniuse: permissions-policy
compat_features:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would also suggest moving the allow attribute into here, yanking it from the iframe feature.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed with b65c5e7.

@ddbeck ddbeck requested a review from foolip November 5, 2025 16:54
@foolip
Copy link
Copy Markdown
Collaborator

foolip commented Nov 21, 2025

Ping @ddbeck on my review comments.

@ddbeck
Copy link
Copy Markdown
Collaborator Author

ddbeck commented Dec 2, 2025

@foolip I've addressed all the comments. This is ready for re-review.

Comment thread features/feature-policy.yml.dist Outdated

status:
baseline: false
support: {}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We'll need compute_from to get a sensible version here. I'll do that.

Add status section to feature-policy.yml with compute_from sources.
Added support for specific browser versions in feature-policy.
@foolip foolip merged commit 3f9a344 into web-platform-dx:main Dec 18, 2025
3 checks passed
@ddbeck ddbeck deleted the permissions-policy branch January 12, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features. tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants