Skip to content

Commit

Permalink
Rename reporting concepts and interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
clelland committed May 14, 2020
1 parent 1096ea8 commit fe5e6f1
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -655,21 +655,21 @@ partial interface HTMLIFrameElement {

<section>
<h2 id="reporting">Reporting</h2>
<p><dfn>Feature policy violation reports</dfn> indicate that some behavior of
the <a>Document</a> has <a>violated</a> a permissions policy. It is up to the
specification of each individual policy-controlled feature to define/determine
when a <dfn data-lt="violate|violation|violated">violation</dfn> of that
policy has occurred.</p>
<p><dfn>Permissions policy violation reports</dfn> indicate that some behavior
of the <a>Document</a> has <a>violated</a> a permissions policy. It is up to
the specification of each individual policy-controlled feature to define what
it means to <dfn data-lt="violate|violation|violated">violate</dfn> that
policy, and how to determine when such a violation has occurred.</p>

<p><a>Feature policy violation reports</a> have the <a>report type</a>
"feature-policy-violation".</p>
<p><a>Permissions policy violation reports</a> have the <a>report type</a>
"permissions-policy-violation".</p>

<p><a>Feature policy violation reports</a> are <a>visible to
<p><a>Permissions policy violation reports</a> are <a>visible to
<code>ReportingObserver</code>s</a>.

<pre class="idl">
[Exposed=Window]
interface FeaturePolicyViolationReportBody : ReportBody {
interface PermissionsPolicyViolationReportBody : ReportBody {
readonly attribute DOMString featureId;
readonly attribute DOMString? sourceFile;
readonly attribute long? lineNumber;
Expand All @@ -678,36 +678,39 @@ partial interface HTMLIFrameElement {
};
</pre>

A <a>feature policy violation report</a>'s [=report/body=], represented in
JavaScript by {{FeaturePolicyViolationReportBody}}, contains the following
A <a>permissions policy violation report</a>'s [=report/body=], represented in
JavaScript by {{PermissionsPolicyViolationReportBody}}, contains the following
fields:

- <dfn for="FeaturePolicyViolationReportBody">featureId</dfn>: The string
identifying the <a>policy-controlled feature</a> whose policy has been
<a>violated</a>. This string can be used for grouping and counting related
reports.
- <dfn for="PermissionsPolicyViolationReportBody">featureId</dfn>: The
string identifying the <a>policy-controlled feature</a> whose policy has
been <a>violated</a>. This string can be used for grouping and counting
related reports.

- <dfn for="FeaturePolicyViolationReportBody">sourceFile</dfn>: If known,
the file where the <a>violation</a> occured, or null otherwise.
- <dfn for="PermissionsPolicyViolationReportBody">sourceFile</dfn>: If
known, the file where the <a>violation</a> occured, or null otherwise.

- <dfn for="FeaturePolicyViolationReportBody">lineNumber</dfn>: If known,
the line number in [=FeaturePolicyViolationReportBody/sourceFile=] where
the <a>violation</a> occured, or null otherwise.
- <dfn for="PermissionsPolicyViolationReportBody">lineNumber</dfn>: If
known, the line number in
[=PermissionsPolicyViolationReportBody/sourceFile=] where the
<a>violation</a> occured, or null otherwise.

- <dfn for="FeaturePolicyViolationReportBody">columnNumber</dfn>: If known,
the column number in [=FeaturePolicyViolationReportBody/sourceFile=] where
the <a>violation</a> occured, or null otherwise.
- <dfn for="PermissionsPolicyViolationReportBody">columnNumber</dfn>: If
known, the column number in
[=PermissionsPolicyViolationReportBody/sourceFile=] where the
<a>violation</a> occured, or null otherwise.

- <dfn for="FeaturePolicyViolationReportBody">disposition</dfn>: A string
indicating whether the <a>violated</a> permissions policy was enforced in
this case. [=FeaturePolicyViolationReportBody/disposition=] will be set to
- <dfn for="PermissionsPolicyViolationReportBody">disposition</dfn>: A
string indicating whether the <a>violated</a> permissions policy was
enforced in this case.
[=PermissionsPolicyViolationReportBody/disposition=] will be set to
"enforce" if the policy was enforced, or "report" if the <a>violation</a>
resulted only in this report being generated (with no further action taken
by the user agent in response to the violation).

Note: There is currently no mechanism in place for enabling report-only
mode, so [=FeaturePolicyViolationReportBody/disposition=] will always be
set to "enforce".
mode, so [=PermissionsPolicyViolationReportBody/disposition=] will always
be set to "enforce".
</section>

<section>
Expand Down Expand Up @@ -1021,38 +1024,38 @@ partial interface HTMLIFrameElement {
</ol>
</section>
<section>
<h3 id="algo-report-feature-policy-violation"><dfn export
id="report-feature-policy-violation">Generate report for violation of
<h3 id="algo-report-permissions-policy-violation"><dfn export
id="report-permissions-policy-violation">Generate report for violation of
permissions policy on |settings|</h3>

<p> Given a feature (|feature|), an <a>environment settings object</a>
(|settings|), and an optional string (|group|), this algorithm generates a
<a>report</a> about the <a>violation</a> of the policy for |feature|.</p>

1. Let |body| be a new {{FeaturePolicyViolationReportBody}}, initialized
1. Let |body| be a new {{PermissionsPolicyViolationReportBody}}, initialized
as follows:

: [=FeaturePolicyViolationReportBody/featureId=]
: [=PermissionsPolicyViolationReportBody/featureId=]
:: |feature|'s string representation.
: [=FeaturePolicyViolationReportBody/sourceFile=]
: [=PermissionsPolicyViolationReportBody/sourceFile=]
:: null
: [=FeaturePolicyViolationReportBody/lineNumber=]
: [=PermissionsPolicyViolationReportBody/lineNumber=]
:: null
: [=FeaturePolicyViolationReportBody/columnNumber=]
: [=PermissionsPolicyViolationReportBody/columnNumber=]
:: null
: [=FeaturePolicyViolationReportBody/disposition=]
: [=PermissionsPolicyViolationReportBody/disposition=]
:: "enforce"

2. 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 [=FeaturePolicyViolationReportBody/sourceFile=],
[=FeaturePolicyViolationReportBody/lineNumber=], and
[=FeaturePolicyViolationReportBody/columnNumber=] accordingly.
set |body|'s [=PermissionsPolicyViolationReportBody/sourceFile=],
[=PermissionsPolicyViolationReportBody/lineNumber=], and
[=PermissionsPolicyViolationReportBody/columnNumber=] accordingly.

3. If |group| is omitted, set |group| to "default".

4. Execute [[reporting#queue-report]] with |body|,
"feature-policy-violation", |group|, and |settings|.
"permissions-policy-violation", |group|, and |settings|.

Note: This algorithm should be called when a permissions policy has
been <a>violated</a>.
Expand Down

0 comments on commit fe5e6f1

Please sign in to comment.