From 5190a3d9dfc374a7408bfdad7c6d6abd0e2809e4 Mon Sep 17 00:00:00 2001
From: Mike Wasserman Copyright © 2023 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply. Copyright © 2024 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply. This document is governed by the 2 November 2021 W3C Process Document. This document is governed by the 03 November 2023 W3C Process Document. Permissions Policy
-
+
More details about this document
Permissions Policy
Permissions Policy
public list of any patent disclosures made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
-
Table of Contents
Table of Contents
@@ -944,22 +1017,30 @@
+ Table of Contents
2.
those frames hosting content from http://example.com or SecureCorp itself
will actually be granted the ability to use that API.
SecureCorp Inc. restructured its domains and now needs to needs to delegate
+ use of the Geolocation API to its origin ("https://example.com
")
+ as well as three subdomains ("https://geo.example.com
",
+ "https://geo2.example.com
", and "https://new.geo2.example.com
").
+ This needs to be accomplished while still disabling the use of the Geolocation API
+ within all other browsing contexts. It can do this by delivering the following HTTP response header:
Permissions-Policy: geolocation=(self "https://example.com" "https://geo.example.com" "https://geo2.example.com" "https://new.geo2.example.com") ++
This works, but if SecureCorp Inc. feels safe delegating to any subdomains on
+ "https://example.com
" the HTTP response header could instead be:
Permissions-Policy: geolocation=(self "https://example.com" "https://*.example.com") ++
Not only would the above header permit "https://geo.example.com
",
+ "https://geo2.example.com
", and "https://new.geo2.example.com
"
+ to use the Geolocation API, but any other subdomains of "https://example.com
"
+ could use it too. Note that "https://example.com
" is not covered by the allowlist entry "https://*.example.com
" and must also be added.
SecureCorp Inc. restructured its services and now needs to needs to delegate
+ use of the Geolocation API to its origin ("https://example.com
")
+ as well as three non-default ports ("https://example.com:444
",
+ "https://example.com:445
", and "https://example.com:446
").
+ This needs to be accomplished while still disabling the use of the Geolocation API
+ within all other browsing contexts. It can do this by delivering the following HTTP response header:
Permissions-Policy: geolocation=(self "https://example.com" "https://example.com:444" "https://example.com:445" "https://example.com:446") ++
This works, but if SecureCorp Inc. feels safe delegating to any ports on
+ "https://example.com
" the HTTP response header could instead be:
Permissions-Policy: geolocation=(self "https://example.com:*") ++
Not only would the above header permit "https://example.com:444
",
+ "https://example.com:444
", and "https://example.com:445
"
+ to use the Geolocation API, but any other ports on "https://example.com
"
+ could use it too.
A permissions policy is a struct with the following items:
-A declared policy is a struct with the following items:
+an ordered map from features to allowlists
+an ordered map from features to strings
+A permissions policy is a struct with the following items:
+an ordered map from features to "Enabled
" or "Disabled
"
An empty permissions policy is a permissions
- policy that has an inherited policy which contains
- "Enabled
" for every supported feature, and a declared
- policy which is an empty map.
Enabled
" for every supported feature, a declared policy whose declarations and reporting configuration are
+ both empty ordered maps.
An inherited
- policy is an ordered map from features to either
- "Enabled
" or "Disabled
".
The inherited policy for a feature feature is the value in the inherited policy whose key is feature. - After a permissions policy has been initialized, its inherited - policy will contain a value for each supported feature.
+The inherited policy for a feature feature is the value in the inherited policy whose + key is feature. After a permissions policy has been + initialized, its inherited policy will + contain a value for each supported feature.
Each document in a frame tree inherits a set of policies from its parent
- frame, or in the case of the top-level document, from the defined defaults
- for each policy-controlled feature. This inherited policy determines
- the initial state ("Enabled
" or "Disabled
") of
- each feature, and whether it can be controlled by a declared policy in the document.
In a Document
in a top-level traversable, the inherited
+
Upon both creation and navigation, Each Document
inherits a set of
+ policies from its parent frame, or in the case of the Document
in a top-level traversable, from the defined defaults for each policy-controlled feature. This inherited policy determines the
+ initial state ("Enabled
" or "Disabled
") of each
+ feature, and whether it can be controlled by a declared policy in the Document
.
In a Document
in a top-level traversable, the inherited
policy is based on defined defaults for each feature.
In a Document
in a child navigable, the inherited policy is based
+
In a Document
in a child navigable, the inherited policy is based
on the parent document’s permissions policy, as well as the child
navigable's container policy.
A declared - policy is an ordered map from features to allowlists.
-A header policy is a list of policy directives delivered via an HTTP header with a document. This forms the document’s permissions policy’s declared policy.
+A header policy is a list of policy directives delivered via an HTTP header with a document. This forms the document’s permissions policy’s declared + policy.
In addition to the header policy, each child navigable has a container policy, which is a policy directive, which may be empty. The container policy can set by attributes on the navigable container.
-The container policy for a child navigable influences the inherited policy of any document loaded into that navigable. - (See § 9.7 Define an inherited policy for feature in container at origin)
+The container policy for a child navigable influences the inherited policy of any Document
loaded into
+ that navigable. (See § 9.7 Define an inherited policy for feature in container at origin).
iframe
"allowfullscreen
",
- and "allow
" attributes.
- Future revisions to this spec may introduce a mechanism to explicitly
- declare the full container policy. iframe
allowfullscreen
, and allow
attributes. Future revisions to this spec may introduce a
+ mechanism to explicitly declare the full container policy.
A policy - directive is an ordered map, mapping policy-controlled features to corresponding allowlists of origins.
+ directive is an ordered map, mapping policy-controlled + features to corresponding allowlists of origins.A policy directive is represented in HTTP headers as the - serialization of an sh-dictionary structure, and in and HTML + serialization of an sf-dictionary structure, and in and HTML attributes as its ASCII serialization.
A permissions policy allowlist is conceptually a set of origins. An allowlist may be either:
+A permissions policy allowlist is conceptually a set of origins. An allowlist may be either:
*
, which represents every
origin, or
- null
+ null
+ 'self'
, 'src'
, and 'none'
can appear in the text representation of allowlists in
headers and attribute strings. These keywords are always interpreted in
context during parsing, and only the origins which they refer to are
stored in the allowlist. The keywords themselves are not part of the
allowlist. To determine whether an allowlist matches an origin origin, run these steps:
-*
,
- then return true.
- To determine whether an allowlist matches an origin origin, run these steps:
+If the allowlist is the special value *
,
+ then return true.
Note: We are not using the CSP variant of wildcard matching as it requires the HTTPS scheme.
+If the allowlist’s self-origin is not null and it is same origin-domain with origin, then return true.
+If the allowlist’s src-origin is not null and it is same origin-domain with origin, then return true.
+If origin is an opaque origin, return false.
+Let url be the result of calling the url parser on the serialization of origin.
+For each permissions-source-expression item in the allowlist’s expressions:
+If the result of running Does url match expression in origin with redirect count? on url, item, origin, and 0 is true then return true.
+Return false.
+Every policy-controlled feature has a default allowlist. The default - allowlist determines whether the feature is allowed in a document with - no declared policy in a top-level traversable, and also whether access - to the feature is automatically delegated to documents in child - navigables.
-The default allowlist for a feature is one of these values:
+Every policy-controlled feature has a default allowlist. The default
+ allowlist determines whether the feature is allowed in a Document
with
+ no declared policy in a top-level
+ traversable, and also whether access to the feature is automatically
+ delegated to documents in child navigables.
The default allowlist for a feature is one of these values:
*
- Document
s in top-level
+ traversables by default, as well as those in all child navigables.
+ It can be disallowed in child navigables by explicitly supplying a container policy on the navigable container that overrides this
+ default (or in any navigable, by delivering the Document
with a
+ suitable Permissions-Policy
header).
'self'
- Document
. It is disallowed
+ by default in child navigables whose document is cross-origin with its parent's document.
serialized-origin
is the serialization of an origin. However, the code points U+0027 ('),
- U+0021 (*), U+002C (,) and U+003B (;) MUST NOT appear in the serialization.
- If they are required, they must be percent-encoded as "%27
", "%2A
",
- "%2C
" or "%3B
", respectively.
'self'
" may be used as an origin in an allowlist.
- When it is used in this way, it will refer to the origin of the document
- which contains the permissions policy. 'self'
" may be used as an origin in an allowlist. When it is used in this way, it will refer to the origin of the Document
which contains the permissions
+ policy. In this representation, a policy directive is represented by a Dictionary.
-Each Dictionary Member associates a feature with an allowlist. - The Member Names must be Tokens. If a token does not name a supported - feature, then the Dictionary Member will be ignored by the processing steps.
-The Member Values represent allowlists, and must be one of:
+Each Dictionary Member associates a feature with an allowlist. + The Member Names must be Tokens. If a token does not name one of the user + agent’s supported features, then the Dictionary Member will be ignored + by the processing steps.
+The Member Values represent allowlists, and must be one of:
a String containing the ASCII serialization of an origin
+a String containing the ASCII permissions-source-expression
the Token *
Any other items inside of an Inner List will be ignored by the processing steps, and the Member Value will be processed as if they were not present. Member Values of any other form will cause the entire Dictionary Member to @@ -1265,46 +1410,42 @@
Permissions-Policy
` HTTP
+ Header FieldThe `Permissions-Policy
`
HTTP header field can be used in the response (server to client) to
- communicate the permissions policy that should be enforced by the
+ communicate the permissions policy that should be enforced by the
client.
Permissions-Policy is a structured header. Its value must be a - dictionary. It’s ABNF is:
-PermissionsPolicy = sh-dictionary +`
+Permissions-Policy
` is a structured + header. Its value must be a dictionary. It’s ABNF is:PermissionsPolicy = sf-dictionaryThe semantics of the dictionary are defined in § 5.2 Structured header serialization.
The processing steps are defined in § 9.2 Construct policy from dictionary and origin.
allow
attribute of the iframe
elementThe allowlist for the features named in the attribute may be empty; in
+ The allowlist for the features named in the attribute may be empty; in
that case, the default value for the allowlist is When not empty, the " When not empty, the iframe
elements have an "allow
" attribute, which
- contains an ASCII-serialized policy
+ iframe
elements have an allow
attribute, which contains an ASCII-serialized policy
directive.'src'
, which
represents the origin of the URL in the iframe’s src
attribute. allow
" attribute will result in adding
- an allowlist for each recognized feature to the iframe
element’s content navigable's container
- policy, when it is constructed.allow
attribute will result in adding an allowlist for each recognized feature to the iframe
element’s content navigable's container policy, when it is
+ constructed.
Some features controlled by +
Some features controlled by Permissions Policy have existing iframe attributes defined. This - specification redefines these attributes to act as declared policies for the - iframe element.
+ specification redefines these attributes to influence theiframe
's content navigable's container policy.
The "allowfullscreen
" iframe attribute controls access to requestFullscreen()
.
If the iframe element has an "allow
" attribute whose
- value contains the token "fullscreen
", then the
- "allowfullscreen
" attribute must have no effect.
Otherwise, the presence of an "allowfullscreen
" attribute
- on an iframe will result in adding an allowlist of *
for the "fullscreen
" feature to the iframe
element’s content navigable's container policy, when
+
The allowfullscreen
iframe
attribute controls access to requestFullscreen()
.
If the iframe element has an allow
attribute whose value
+ contains the token "fullscreen
", then the allowfullscreen
attribute must have no effect.
Otherwise, the presence of an allowfullscreen
attribute
+ on an iframe
will result in adding an allowlist of *
for the "fullscreen
" feature to the iframe
element’s content navigable's container policy, when
it is constructed.
<iframe
allow="fullscreen">
, and is for compatibility with existing
@@ -1431,7 +1572,7 @@ getAllowlistForFeature
(feature
);
};
-permissionsPolicy
;
};
@@ -1442,22 +1583,22 @@ PermissionsPolicy
object has an associated node, which
is a Node
. The associated node is set when the PermissionsPolicy
object is created.
A PermissionsPolicy
object has a default origin, which is
- an origin, whose value depends on the state of the PermissionsPolicy
object’s associated node:
PermissionsPolicy
object’s associated node:
If the PermissionsPolicy
object’s associated node is a Document
, then its default origin is the Document
's origin.
If the PermissionsPolicy
object’s associated node is a Document
, then its default origin is the Document
's origin.
If the PermissionsPolicy
object’s associated node is an Element
, then its default origin is the Element
's declared origin.
Each Document
has a policy object, which is
- a PermissionsPolicy
instance whose associated node is that Document
.
A Document
's permissionsPolicy
IDL attribute, on
- getting, must return the Document
's policy object.
Each iframe
element has a policy object,
+
Each Document
has a policy object, which is
+ a PermissionsPolicy
instance whose associated node is that Document
.
A Document
's permissionsPolicy
IDL attribute, on
+ getting, must return the Document
's policy object.
Each iframe
element has a policy object,
which is a PermissionsPolicy
instance whose associated node is
that element.
An iframe
's permissionsPolicy
IDL attribute, on
- getting, must return the iframe
's policy object.
An iframe
's permissionsPolicy
IDL attribute, on
+ getting, must return the iframe
's policy object.
The allowsFeature(feature, origin)
method must run the following
steps:
Set result to an empty ordered set.
For each supported feature feature:
+For each supported feature feature:
Append feature to result.
@@ -1493,7 +1634,7 @@Let policy be the observable policy for this PermissionsPolicy
object’s associated node.
For each supported feature feature:
+For each supported feature feature:
If feature is allowed by policy for origin, append feature to result.
@@ -1505,28 +1646,40 @@Set result to an empty list
+Set result to an empty list.
Let origin be this PermissionsPolicy
object’s default
- origin.
Let policy be the observable policy for this PermissionsPolicy
object’s associated node.
If feature is not allowed in policy for origin, return result
Let allowlist be policy’s declared policy[feature]
+Let allowlist be policy’s declared policy[feature]'s declarations.
+If allowlist is the special value *
:
Append "*
" to result
Return result.
+If the allowlist’s self-origin is not null, + append the serialization of it to result.
If allowlist is the special value *
, append "*
" to result
If the allowlist’s src-origin is not null, + append the serialization of it to result.
Otherwise, for each origin in allowlist:
+Otherwise, for each permissions-source-expression item in allowlist’s expressions:
Append the serialization of origin to result
+Append item to result
Return result.
The observable policy for any Node is a permissions
+ The observable policy for any Node is a permissions
policy, which contains the information about the policy in the navigable
represented by that Node which is visible from the current document. To get the observable policy for a Document document, return document’s permissions policy. Let inherited policy be a new ordered map. Let declared policy be a new ordered map. Let inherited policy be an empty ordered map. For each supported feature feature: For each supported feature feature: Let isInherited be the result of running Define
@@ -1547,18 +1698,18 @@ Return a new permissions policy with inherited policy inherited policy and declared policy declared policy. Return a new permissions policy with inherited policy inherited policy, declared policy a struct with both declarations and reporting
+ configuration new ordered maps. To get the declared origin for an Element node, run the
following steps: If node’s node document’s sandboxed origin browsing
- context flag is set, then return a unique opaque origin.
is set, then return a new opaque origin.
Set inherited policy[feature] to isInherited.
If node’s sandbox
attribute is set, and does not contain
- the allow-same-origin
keyword, then return a unique
- opaque origin.
allow-same-origin
keyword, then return a new opaque origin.
If node’s srcdoc
attribute is set, then return node’s node document’s origin.
featureId: The -string identifying the policy-controlled feature whose policy has +string identifying the policy-controlled feature whose policy has been violated. This string can be used for grouping and counting related reports.
Note: There is currently no mechanism in place for enabling report-only -mode, so disposition will always -be set to "enforce".
Permissions-Policy-Report-Only
`
+ HTTP Header FieldThe `Permissions-Policy-Report-Only
`
+ HTTP header field can be used in the response (server to client) to
+ communicate a permissions policy that should not be enforced by the
+ client, but instead should be used to trigger reports to be sent if any
+ policy declared within it would have been violated, had the policy been
+ active.
`Permissions-Policy-Report-Only
` is a
+ structured header. Its value must be a dictionary.
The semantics of the dictionary are defined in § 5.2 Structured header serialization.
+The processing steps are defined in § 9.2 Construct policy from dictionary and origin.
+Let header name be "Permissions-Policy-Report-Only
" if report-only is True, or "Permissions-Policy
" otherwise.
Let parsed header be the result of executing get a structured
-field value given "Permissions-Policy
" and "dictionary" from response’s header list.
If parsed header is null, abort these steps.
+If parsed header is null, return an empty ordered map.
Let policy be the result of executing Construct policy from dictionary and origin on parsed header and origin.
@@ -1650,20 +1814,24 @@Let policy be an empty ordered map.
+Let declarations be an empty ordered map.
+Let reporting-config be an empty ordered map.
For each feature-name → value of dictionary:
+For each feature-name → (value, params) of dictionary:
If feature-name does not identify any recognized policy-controlled feature, then continue.
+If feature-name does not identify any recognized policy-controlled feature, then continue.
Let feature be the policy-controlled feature identified by feature-name.
+Let feature be the policy-controlled feature identified by feature-name.
+If params["report-to"] exists, and is a string, then set reporting-config[feature] to params["report-to"].
Let allowlist be a new allowlist.
+Let allowlist be a new allowlist.
If value is the token *
, or if value is a list which contains
the token *
, set allowlist to the special value *
.
Set allowlist to an new ordered set.
-If value is the token self
, append origin to allowlist.
If value is the token self
, let allowlist’s self-origin be origin.
If value is a list, then for each element in value:
+Otherwise if value is a list, then for each element in value:
If element is the token self
, append origin to allowlist.
If element is the token self
, let allowlist’s self-origin be origin.
Otherwise, let result be the result of executing the URL -parser on element.
-If result is not failure:
-Let target be the origin of result.
-If target is not an opaque origin, append target to allowlist.
-If element is a valid permissions-source-expression, append element to allowlist’s expressions.
Set policy[feature] to allowlist.
+Set declarations[feature] to allowlist.
Return policy.
+Return «declarations, reporting-config».
Let directive be an empty ordered map.
+Let directive be an empty ordered map.
For each serialized-declaration returned by strictly splitting value on the delimiter U+003B (;):
@@ -1717,45 +1874,55 @@If tokens is an empty list, then continue.
+If tokens is an empty list, then continue.
Let feature-name be the first element of tokens.
If feature-name does not identify any recognized policy-controlled feature, then continue.
+If feature-name does not identify any recognized policy-controlled feature, then continue.
Let feature be the policy-controlled feature identified by feature-name.
+Let feature be the policy-controlled feature identified by feature-name.
Let targetlist be the remaining elements, if any, of tokens.
Let allowlist be a new allowlist.
+Let allowlist be a new allowlist.
If any element of targetlist is the string "*
", set allowlist to the special value *
.
Otherwise:
Set allowlist to an new ordered set.
-If targetlist is empty and target origin is given, append target origin to allowlist.
+If targetlist is empty and target origin is given, + let allowlist’s src-origin be target origin.
For each element in targetlist:
If element is an ASCII case-insensitive match for
-"'self'
", let result be container origin.
'self'
":
+ Let allowlist’s self-origin be container origin.
+Continue to the next element.
+If target origin is given, and element is an ASCII
-case-insensitive match for "'src'
", let result be target origin.
'src'
":
+ Let allowlist’s src-origin be target origin.
+Continue to the next element.
+Otherwise, let result be the result of executing the URL -parser on element.
+Let result be the result of executing the URL parser on element.
If result is not failure:
Let target be the origin of result.
+Let target be the origin of result.
If target is not an opaque origin, append target to allowlist.
+If target is not an opaque origin, append the serialization of target to allowlist’s expressions.
If element is not an iframe
element, then return an empty policy
+ directive.
Let container policy be the result of running Parse policy
-directive on the value of element’s allow
attribute,
-with container origin set to the origin of element’s
-node document, and target origin set to element’s declared origin.
allow
attribute,
+the origin of element’s node document, and element’s declared origin.
If element is an iframe
element:
If element’s allowfullscreen
attribute is specified, and container policy does not contain an entry for the fullscreen
feature.
If element’s allowfullscreen
attribute is specified,
-and container policy does not contain an allowlist for fullscreen
:
Let declaration be a new declaration for fullscreen
, whose
-allowlist is the special value *
.
Add declaration to container policy.
-Set container policy[fullscreen
] = the
+ special value *
.
Return container policy.
@@ -1800,16 +1962,14 @@Assert: If not null, container is a navigable container.
+Assert: If not null, container is a navigable container.
Let inherited policy be a new ordered map.
+Let inherited policy be a new ordered map.
Let declared policy be a new ordered map.
-For each feature supported,
+Let isInherited be the result of running Define an
@@ -1818,29 +1978,34 @@
Let policy be a new permissions policy, with inherited policy inherited policy and declared policy declared policy.
+Let policy be a new permissions policy, with inherited policy inherited policy and declared policy «[], []».
Return policy.
Let policy be the result of running Create a Permissions Policy for a navigable given container and origin.
Let d be the result of running Process response -policy on response and origin.
+policy given response, origin and report-only.For each feature → allowlist of d:
+For each feature → allowlist of d’s declarations:
If policy’s inherited policy[feature] is true, then set policy’s declared policy[feature] to allowlist.
+If policy’s inherited + policy[feature] is true, then set policy’s declared policy’s declarations[feature] to allowlist.
Set policy’s declared + policy[feature]'s reporting configuration to d’s reporting configuration.
Return policy.
Document
in
+ that container (origin), this algorithm returns the inherited policy value for feature.
If container is null, return "Enabled
".
If the result of executing Is feature
-enabled in document for origin? on feature, container’s node document, and container’s node document''s origin
-is "Disabled
", return "Disabled
".
If the result of executing Get feature value for
+origin on feature, container’s node document, and container’s node document’s origin is
+"Disabled
", return "Disabled
".
If the result of executing Get feature value for
+origin on feature, container’s node document, and origin is "Disabled
", return "Disabled
".
Let container policy be the result of running Process +permissions policy attributes on container.
+If feature exists in container policy:
+ +If feature’s default allowlist is *
, return
+"Enabled
".
If the result of executing Is feature
-enabled in document for origin? on feature, container’s node document, and origin is "Disabled
",
-return "Disabled
".
If feature’s default allowlist is 'self'
, and origin is same origin with container’s node document’s origin, return "Enabled
".
Otherwise return "Disabled
".
Document
object
+ (document), and an origin (origin), this algorithm
+ returns "Disabled
" if feature should be considered
+ disabled, and "Enabled
" otherwise.
+
+ Let policy be document’s permissions policy.
+If policy’s inherited policy for feature is "Disabled
", return "Disabled
".
If feature is present in policy’s declared + policy:
+If policy’s declared
+ policy’s declarations[feature] matches origin, then return "Enabled
".
Otherwise return "Disabled
".
Return "Enabled
".
Disabled
" if feature should be considered disabled, and "Enabled
"
+ otherwise.
+ Let container policy be the result of running Process -permissions policy attributes on container.
+If policy’s inherited policy for feature is "Disabled
", return "Disabled
".
If feature is a key in container policy:
+If feature is present in policy’s declared policy:
If the allowlist for feature in container policy matches origin, return "Enabled
".
If policy’s declared
+ policy’s declarations[feature] matches origin, then return "Enabled
".
Otherwise return "Disabled
".
If feature’s default allowlist is *
, return
+
If feature’s default allowlist is *
, return
"Enabled
".
If feature’s default allowlist is 'self'
, and origin is same origin with container’s node document’s
-origin, return "Enabled
".
If feature’s default allowlist is 'self'
, and origin is same origin with document origin, return
+"Enabled
".
Otherwise return "Disabled
".
Return "Disabled
".
Document
object
- (document), and an origin (origin), this algorithm
- returns "Disabled
" if feature should be considered
- disabled, and "Enabled
" otherwise.
+ Given a feature (feature), a Document
object
+ (document), an origin (origin), and an optional boolean (report),
+ with a default value of True, this algorithm returns "Disabled
"
+ if feature should be considered disabled, and "Enabled
"
+ otherwise. If report is True, then it will also generate and queue a
+ report if the feature is not enabled in either document’s permissions policy or document’s report-only
+ permissions policy
+ Note: The default value of True for report means that most permissions + policy checks will generate a violation report if the feature is not + enabled. This is the expected result, as most checks are for an actual + attempted use of the feature. If a call to this algorithm is performed just + to query the state of a feature, and does not represent an actual attempt to + use the feature, then report should be set to False.
Let policy be document’s Permissions Policy
+Let policy be document’s permissions policy.
+Let report-only policy be document’s report-only + permissions policy.
+Let result be the result of calling Check permissions + policy, given policy, feature, origin, and document’s origin.
If policy’s inherited policy for feature is Disabled, return
-"Disabled
".
Let report-only result be the result of calling Check + permissions policy, given report-only policy, feature, origin, + and document’s origin.
If feature is present in policy’s declared policy:
+If report is True:
If the allowlist for feature in policy’s declared
-policy matches origin, then return
-"Enabled
".
Let settings be document’s environment settings object.
Otherwise return "Disabled
".
If result is "Disabled
":
Let endpoint be the result of calling Get the + reporting endpoint for a feature given feature and policy.
+Call Generate report for violation of permissions
+ policy on settings given feature, settings,
+ "Enforce
", and endpoint.
Else, if report-only result is "Disabled
":
Let report-only endpoint be the result of calling Get the reporting endpoint for a feature given feature and report-only policy.
+Call Generate report for violation of permissions
+ policy on settings given feature, settings,
+ "Report
", and report-only endpoint.
If feature’s default allowlist is *
, return
-"Enabled
".
Return result
+If feature’s default allowlist is 'self'
, and origin is same origin with document’s origin, return
-"Enabled
".
Let config be policy’s declared policy's reporting configuration.
Return "Disabled
".
If config[feature] exists, return config[feature].
+Return null.
Let body be a new PermissionsPolicyViolationReportBody
, initialized
@@ -1941,29 +2204,26 @@
null
-"enforce"
+disposition
If the user agent is currently executing script, and can extract the source file’s URL, line number, and column number from settings, then set body’s sourceFile, lineNumber, and columnNumber accordingly.
If group is omitted, set group to "default".
-Execute generate and queue a report with body, -"permissions-policy-violation", group, and settings.
+Execute generate and queue a report with body, +"permissions-policy-violation", endpoint, and settings.
Note: This algorithm should be called when a permissions policy has - been violated.
true
if the request should be allowed to use feature, and false
otherwise.
+ Given a feature (feature) and a request (request),
+ this algorithm returns true
if the request should be allowed to
+ use feature, and false
otherwise.
Let result be the result of executing Is feature
+ Let result be the result of executing Is feature
enabled in document for origin? on feature, document, and origin. If result is " In 7.5.1
+ Shared document creation infrastructure, after step 3, insert the
+ following step: Let reportOnlyPermissionsPolicy be the result of calling Create a Permissions Policy for a navigable from
+ response given navigationParams’s navigable’s container,
+ navigationParams’s origin, navigationParams’s response, and True. And in the same section, in step 10, set the new The permanent message header field registry should be updated with the
following registration [RFC3864]: This specification standardizes a mechanism for an embedding page to set a
policy which will be enforced on an embedded page. Similar to iframe Features should be designed such that a violation of the policy in a
+ Features should be designed such that a violation of the policy in a
framed document is not observable by documents in other frames. For instance,
a hypothetical feature which caused a event to be fired in the embedding
document if it is used while disabled by policy, could be used to extract
@@ -2041,7 +2320,7 @@ Enabled
", return true
.10. IANA Considerations
+
10. Changes to other specifications
+ 10.1. Changes to the HTML specification
+ Every Document
has a report-only permissions
+ policy, which is a permissions policy, which is initially empty.
+
+
+ Document
's11. IANA Considerations
@@ -2004,11 +2283,11 @@
Author/Change controller
11. Privacy and Security
+ 12. Privacy and Security
sandbox
, this can be done without the express permission of the
embedded page, which means that behaviors of existing features can be changed
@@ -2026,8 +2305,8 @@
-
11.1. Exposure of cross-origin behavior
- 12.1. Exposure of cross-origin behavior
+ src attribute of the
<iframe>
element will cause the observable policy to be updated.
The Permissions Policy mechanism grants a document the ability to control which features will and will not be availble in a subframe at the time it is loaded. When a feature represents an existing, long-standing behavior of the @@ -2090,7 +2369,7 @@
Care has been taken to limit the information which an page can infer about the behavior of cross-origin pages which it embeds. It may be possible in some scenarios however, for the embedded page to infer information about its @@ -2103,8 +2382,8 @@
Expose new algorithms to create a Feature Policy before document is created. Link
@@ -2151,34 +2430,37 @@Note, this is an informative note.
-Requirements phrased in the imperative as part of algorithms
+ Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters"
or "return false and abort these steps")
are to be interpreted with the meaning of the key word
("must", "should", "may", etc)
used in introducing the algorithm. Conformance requirements phrased as algorithms or specific steps
+ Conformance requirements phrased as algorithms or specific steps
can be implemented in any manner,
so long as the end result is equivalent.
In particular, the algorithms defined in this specification
are intended to be easy to understand
and are not intended to be performant.
Implementers are encouraged to optimize. Conformant Algorithms
+
In only one current engine.
In only one current engine.
+