Skip to content

Commit

Permalink
Reworked the reporting algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
clamy committed Jul 2, 2020
1 parent ba41da6 commit 0f03172
Showing 1 changed file with 85 additions and 99 deletions.
184 changes: 85 additions & 99 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -80341,32 +80341,34 @@ interface <dfn>BarProp</dfn> {
context set</span>'s <span data-x="list size">size</span> is strictly greater than 1, then:</p>

<ol>
<li><p>Let <var>previousDocumentURL</var> be <var>referrer</var>.</p></li>

<li><p>If <var>currentCOOPEnforcementResult</var>'s <span
data-x="coop-enforcement-same-origin">sameOriginIncludingRedirects</span> is true, set
<var>previousDocumentURL</var> to <var>currentDocumentURL</var>.</p></li>

<li><p>If <var>navigationCOOP</var>'s <span
data-x="coop-struct-report-endpoint">reporting endpoint</span> is not <code
data-x="">null</code> and <var>currentCOOPEnforcementResult</var>'s <span
data-x="coop-enforcement-bcg-switch">needBrowsingContextGroupSwitch</span> is true, <span
data-x="coop-violation-navigat-to">queue a violation report for browsing context group switch
when navigating to a COOP page</span> with <var>navigationCOOP</var>'s <span
data-x="coop-violation-navigation">queue a violation report for browsing context group switch
when navigating</span> with <var>navigationCOOP</var>'s <span
data-x="coop-struct-report-endpoint">reporting endpoint</span>, <var>navigationCOOP</var>'s
<span data-x="coop-struct-value">value</span>, "<code data-x="">enforce</code>",
<var>response</var>'s <span data-x="concept-response-URL">URL</span>,
<var>browsingContext</var>'s <span>active document</span>'s <span>URL</span>,
<var>request</var>'s <span data-x="concept-request-referrer">referrer</span>, and
<var>currentCOOPEnforcementResult</var>'s
<var>sameOriginWithPreviousDocumentIncludingRedirects</var>.</p></li>
<var>previousDocumentURL</var>, and "<code data-x="">navigate-to-document</code>".</p></li>

<li><p>If <var>navigationCOOP</var>'s <span
data-x="coop-struct-report-only-endpoint">report only reporting endpoint</span> is not <code
data-x="">null</code> and <var>currentCOOPEnforcementResult</var>'s <span
data-x="coop-enforcement-bcg-switch-report-only">needBrowsingContextGroupSwitchReportOnly</span>,
<span data-x="coop-violation-navigat-to">queue a violation report for browsing context group
switch when navigating to a COOP page</span> with <var>navigationCOOP</var>'s <span
<span data-x="coop-violation-navigation">queue a violation report for browsing context group
switch when navigating</span> with <var>navigationCOOP</var>'s <span
data-x="coop-struct-report-only-endpoint">report only reporting endpoint</span>,
<var>navigationCOOP</var>'s <span data-x="coop-struct-report-only-value">report only
value</span>, "<code data-x="">reporting</code>", <var>response</var>'s <span
data-x="concept-response-URL">URL</span>, <var>browsingContext</var>'s <span>active
document</span>'s <span>URL</span>, and <var>request</var>'s <span
data-x="concept-request-referrer">referrer</span>.</p></li>
data-x="concept-response-URL">URL</span>, <var>previousDocumentURL</var>, and "<code
data-x="">navigate-to-document</code>".</p></li>
</ol>
</li>
</ol>
Expand Down Expand Up @@ -80395,20 +80397,25 @@ interface <dfn>BarProp</dfn> {
data-x="">null</code>, then:</p>

<ol>
<li><p>Let <var>initialNavigationURL</var> be a new empty <span>URL</span>.</p></li>
<li><p>If <var>coopEnforcementResult</var>'s <span
data-x="coop-enforcement-same-origin">sameOriginIncludingRedirects</span> is false and
<var>source</var> is not <var>browsingContext</var>, then break.</p></li>

<li><p>If <var>source</var> and <var>browsingContext</var> are the same, set
<var>initialNavigationURL</var> to <var>request</var>'s <span
<li><p>Let <var>navigationURL</var> be <var>request</var>'s <span
data-x="concept-request-url">URL</span>.</p></li>

<li><p><span data-x="coop-violation-navigat-from">Queue a violation report for
browsing context group switch when navigating away from a COOP page</span> with
<var>activeDocumentCOOP</var>'s <span data-x="coop-struct-report-only-endpoint">report only
reporting endpoint</span>, <var>activeDocumentCOOP</var>'s <span
data-x="coop-struct-report-only-value">report only value</span>, "<code
data-x="">reporting</code>", <var>response</var>'s <span
data-x="concept-response-URL">URL</span>, <var>browsingContext</var>'s <span>active
document</span>'s <span>URL</span>, and <var>initialNavigationURL</var>.</p></li>
<li><p>If <var>coopEnforcementResult</var>'s <span
data-x="coop-enforcement-same-origin">sameOriginIncludingRedirects</span> is true, set
<var>navigationURL</var> to <var>response</var>'s <span
data-x="concept-response-URL">URL</span>

<li><p><span data-x="coop-violation-navigation">Queue a violation report for
browsing context group switch when navigating</span> with
<var>activeDocumentCOOP</var>'s <span data-x="coop-struct-report-endpoint">reporting
endpoint</span>, <var>activeDocumentCOOP</var>'s <span data-x="coop-struct-value">value</span>,
"<code data-x="">reporting</code>", <var>browsingContext</var>'s <span>active
document</span>'s <span>URL</span>, <var>navigationURL</var>, and "<code
data-x="">navigate-from-document</code>".</p></li>
</ol>
</li>

Expand All @@ -80423,19 +80430,25 @@ interface <dfn>BarProp</dfn> {
endpoint</span> is not <code data-x="">null</code>, then:</p>

<ol>
<li><p>Let <var>initialNavigationURL</var> be a new empty <span>URL</span>.</p></li>
<li><p>If <var>coopEnforcementResult</var>'s <span
data-x="coop-enforcement-same-origin">sameOriginIncludingRedirects</span> is false and
<var>source</var> is not <var>browsingContext</var>, then break.</p></li>

<li><p>If <var>source</var> and <var>browsingContext</var> are the same, set
<var>initialNavigationURL</var> to <var>request</var>'s <span
<li><p>Let <var>navigationURL</var> be <var>request</var>'s <span
data-x="concept-request-url">URL</span>.</p></li>

<li><p><span data-x="coop-violation-navigat-from">Queue a violation report for
browsing context group switch when navigating away from a COOP page</span> with
<li><p>If <var>coopEnforcementResult</var>'s <span
data-x="coop-enforcement-same-origin">sameOriginIncludingRedirects</span> is true, set
<var>navigationURL</var> to <var>response</var>'s <span
data-x="concept-response-URL">URL</span>

<li><p><span data-x="coop-violation-navigation">Queue a violation report for
browsing context group switch when navigating</span> with
<var>activeDocumentCOOP</var>'s <span data-x="coop-struct-report-endpoint">reporting
endpoint</span>, <var>activeDocumentCOOP</var>'s <span data-x="coop-struct-value">value</span>,
"<code data-x="">enforce</code>", <var>response</var>'s <span
data-x="concept-response-URL">URL</span>, <var>browsingContext</var>'s <span>active
document</span>'s <span>URL</span>, and <var>initialNavigationURL</var>.</p></li>
"<code data-x="">enforce</code>", <var>browsingContext</var>'s <span>active
document</span>'s <span>URL</span>, <var>navigationURL</var>, and "<code
data-x="">navigate-from-document</code>".</p></li>
</ol>
</li>

Expand Down Expand Up @@ -80477,87 +80490,60 @@ interface <dfn>BarProp</dfn> {

<h4>Reporting policies</h4>

<p>To <dfn data-x="coop-violation-navigat-to">queue a violation report for browsing context group
switch when navigating to a COOP page</dfn> given a string <var>endpoint</var>, a <span
<p>To <dfn data-x="coop-violation-navigation">queue a violation report for browsing context group
switch when navigating</dfn> given a string <var>endpoint</var>, a <span
data-x="cross-origin opener policy value">cross-origin opener policy value</span>
<var>COOPValue</var>, a string <var>disposition</var>, a <span>URL</span>
<var>navigationURL</var>, a <span>URL</span> <var>currentDocumentURL</var>, and a
<span data-x="concept-request-referrer">referrer</span> <var>referrer</var>:<p>
<var>coopValue</var>, a string <var>disposition</var>, a <span>URL</span>
<var>coopURL</var>, a <span>URL</span> <var>otherDocumentURL</var>, and a
string <var>reportType</var>:<p>

<ol>
<li><p>Let <var>previousDocumentURL</var> be <var>referrer</var>.</p></li>
<li><p>Let <var>sanitizedOtherDocumentURL</var> be a copy of
<var>otherDocumentURL</var>.</p></li>

<li><p>If <var>currentDocumentURL</var> and <var>navigationURL</var> are
<span>same origin</span>, set <var>previousDocumentURL</var> to
<var>currentDocumentURL</var>.</p></li>
<li><p><span data-x="set the username">Set the username</span> given
<var>sanitizedOtherDocumentURL</var> and the empty string.

<li><p>Set <var>previousDocumentURL</var>'s <span data-x="concept-url-username">username</span>
to the empty string, and its <span data-x="concept-url-password">password</span> to <code
data-x="">null</code>.</p></li>
<li><p><span data-x="set the password">Set the password</span> given
<var>sanitizedOtherDocumentURL</var> and the empty string.

<li><p>Let <var>serializedPreviousDocumentURL</var> be the result of executing the <span
data-x="concept-url-serializer">URL serializer</span> on <var>previousDocumentURL</var> with the
<var>exclude fragment flag</var> set.</p></li>
<li><p>Let <var>serializedOtherDocumentURL</var> be the <span
data-x="concept-url-serializer">serialization</span> of <var>sanitizedOtherDocumentURL</var> with
the <var>exclude fragment flag</var> set.</p></li>

<li>
<p>Let <var>body</var> be a new object containing the following properties with keys:</p>

<ul>
<li><p>key: "<code data-x="">disposition</code>", value: <var>disposition</var>.</p></li>

<li><p>key: "<code data-x="">effective-policy</code>", value: <var>COOPValue</var>.</p></li>

<li><p>key: "<code data-x="">navigation-uri</code>", value:
<var>serializedPreviousDocumentURL</var>.</p></li>

<li><p>key: "<code data-x="">violation-type</code>", value: "<code
data-x="">navigate-to-document</code>".</p></li>
</ul>
</li>

<li><p><span data-x="queue a report">Queue</span> <var>body</var> as "<code data-x="">coop</code>"
for <var>endpoint</var> with <var>navigationURL</var>.</p></li>
</ol>

<p>To <dfn data-x="coop-violation-navigat-from">queue a violation report for browsing context group
switch when navigating away from a COOP page</dfn> given a string <var>endpoint</var>, a
<span>cross-origin opener policy value</span> <var>COOPValue</var>, a string
<var>disposition</var>, a <span>URL</span> <var>navigationURL</var>, a <span>URL</span>
<var>currentDocumentURL</var>, and a <span>URL</span> <var>initialNavigationURL</var>:<p>

<ol>
<li><p>Let <var>nextDocumentURL</var> be <var>initialNavigationURL</var>.</p></li>

<li><p>If <var>currentDocumentURL</var> and <var>navigationURL</var> are
<span>same origin</span>, set <var>nextDocumentURL</var> to
<var>navigationURL</var>.</p></li>

<li><p>Set <var>nextDocumentURL</var>'s <span data-x="concept-url-username">username</span> to
the empty string, and its <span data-x="concept-url-password">password</span> to <code
data-x="">null</code>.</p></li>

<li><p>Let <var>serializedNextDocumentURL</var> be the result of executing the <span
data-x="concept-url-serializer">URL serializer</span> on <var>nextDocumentURL</var> with the
<var>exclude fragment flag</var> set.</p></li>

<li>
<p>Let <var>body</var> be a new object containing the following properties with keys:</p>

<ul>
<li><p>key: "<code data-x="">disposition</code>", value: <var>disposition</var>.</p></li>

<li><p>key: "<code data-x="">effective-policy</code>", value: <var>COOPValue</var>.</p></li>

<li><p>key: "<code data-x="">navigation-uri</code>", value:
<var>serializedNextDocumentURL</var>.</p></li>
<p>Let <var>body</var> be a new object containing the following properties:</p>

<li><p>key: "<code data-x="">violation-type</code>", value: "<code
data-x="">navigate-from-document</code>".</p></li>
</ul>
<table class="data">
<thead>
<tr>
<th>key</th>
<th>value</th>
</tr>
</thead>
<tbody>
<tr>
<td>disposition</td>
<td><var>disposition</var></td>
</tr>
<tr>
<td>effective-policy</td>
<td><var>coopValue</var>/td>
</tr>
<tr>
<td>navigation-url</td>
<td><var>serializedOtherDocumentURL</var></td>
</tr>
<tr>
<td>violation-type</td>
<td><var>reportType</var></td>
</tr>
</tbody>
</table>
</li>

<li><p><span data-x="queue a report">Queue</span> <var>body</var> as "<code data-x="">coop</code>"
for <var>endpoint</var> with <var>currentDocumentURL</var>.</p></li>
for <var>endpoint</var> with <var>coopURL</var>.</p></li>
</ol>


Expand Down

0 comments on commit 0f03172

Please sign in to comment.