You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partial cherry-pick (skipping tests) of patch originally reviewed on
https://chromium-review.googlesource.com/c/chromium/src/+/2363169:
Change Feature-Policy header semantics
This change implements the algorithmic changes for a recent change
to the Feature/Permissions policy spec:
w3c/webappsec-permissions-policy#378
With this change, the Feature-Policy or Permissions-Policy headers by
themselves cannot be used to delegate powerful features to cross-origin
iframes; the allow attribute must be used as well. To allow this to
still be ergonomic, the default value for the header for powerful
features is effectively '*', so that delegation is allowed by the header
implicitly. The header can now be used effectively to completely block
access to a feature, as any origins not present in the header allowlist
cannot be granted the feature through the allow attribute.
This also removes some code which previously only existed to track the
cases where this change would affect the output of an IsFeatureEnabled
call.
Several tests will have been modified or rewritten prior to landing
this change; this CL depends on the following (though they are all
independent, so they are not chained together):
- https://crrev.com/c/2424633
- https://crrev.com/c/2424634
- https://crrev.com/c/2424635
- https://crrev.com/c/2424654
- https://crrev.com/c/2424655
- https://crrev.com/c/2424657
- https://crrev.com/c/2425003
- https://crrev.com/c/2425004
(See Patchset 8 for a version with the changes from all of those CLs
included.)
This CL, while large, can best be understood as the union of the
following changes:
- Algorithm changes, including the removal of previous "what-if" code
and metrics:
feature_policy.cc
feature_policy.h
execution_context.cc
- Unit tests to cover those changes:
feature_policy_unittest.cc
render_frame_host_feature_policy_unittest.cc
- Update WPT test expectations to account for the change in behaviour
when only the header is used:
3p/b/web_tests/external/wpt/feature-policy/feature-policy-*
3p/b/web_tests/external/wpt/permissions-policy/permissions-policy-*
- Update Blink web tests for fullscreen and payment request to validate
that both are now working correctly with the new header semantics:
3p/b/web_tests/http/tests/feature-policy/fullscreen*
3p/b/web_tests/http/tests/feature-policy/payment*
- Update Blink web tests for the iframe policy JS interface because of
new test expectations when features are allowed/disallowed by header:
3p/b/renderer/core/feature_policy/policy_test.cc
3p/b/web_tests/http/tests/feature-policy/policy_iframes.php
Bug: 1095641, 937131
Change-Id: Iecbb0950c27a4565998ee5192590d6691a03b4a3
Reviewed-by: Yoav Weiss <[email protected]>
Reviewed-by: Charlie Hu <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Commit-Queue: Ian Clelland <[email protected]>
Cr-Commit-Position: refs/heads/master@{#826408}
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
0 commit comments