Skip to content

Commit

Permalink
Add a "same site" algorithm for sites
Browse files Browse the repository at this point in the history
Previously we only had one for origins.
  • Loading branch information
wanderview authored Jun 8, 2022
1 parent 112cacc commit f22f6eb
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -84522,8 +84522,9 @@ interface <dfn interface>BarProp</dfn> {

<h4>Sites</h4>

<p>A <dfn>scheme-and-host</dfn> is a <span>tuple</span> of an <span>ASCII string</span> and a
<span data-x="concept-host">host</span>.</p>
<p>A <dfn>scheme-and-host</dfn> is a <span>tuple</span> of a <dfn
data-x="concept-scheme-and-host-scheme">scheme</dfn> (an <span>ASCII string</span>) and a <dfn
data-x="concept-scheme-and-host-host">host</dfn> (a <span data-x="concept-host">host</span>).</p>

<p>A <dfn export>site</dfn> is an <span data-x="concept-origin-opaque">opaque origin</span> or a
<span>scheme-and-host</span>.</p>
Expand All @@ -84546,6 +84547,28 @@ interface <dfn interface>BarProp</dfn> {
domain</span>).</p></li>
</ol>

<p>Two <span data-x="site">sites</span>, <var>A</var> and <var>B</var>, are said to be <dfn
export for="site" data-x="concept-site-same-site">same site</dfn> if the following algorithm
returns true:</p>

<ol>
<li><p>If <var>A</var> and <var>B</var> are the same <span data-x="concept-origin-opaque">opaque
origin</span>, the return true.</p></li>

<li><p>If <var>A</var> or <var>B</var> is an <span data-x="concept-origin-opaque">opaque
origin</span>, then return false.</p></li>

<li><p>If <var>A</var>'s and <var>B</var>'s <span
data-x="concept-scheme-and-host-scheme">scheme</span> values are different, then return
false.</p></li>

<li><p>If <var>A</var>'s and <var>B</var>'s <span
data-x="concept-scheme-and-host-host">host</span> values are not <span data-x="host
equals">equal</span>, then return false.</p></li>

<li><p>Return true.</p></li>
</ol>

<p>The <dfn export>serialization of a site</dfn> is the string obtained
by applying the following algorithm to the given <span>site</span> <var>site</var>:</p>

Expand Down Expand Up @@ -84598,15 +84621,20 @@ interface <dfn interface>BarProp</dfn> {
</ol>

<p>Two <span data-x="origin">origins</span>, <var>A</var> and <var>B</var>, are said to be <dfn
export>same site</dfn> if both of the following statements are true:</p>
export>same site</dfn> if the following algorithm returns true:</p>

<ul>
<li><p><var>A</var> and <var>B</var> are <span>schemelessly same site</span></p></li>
<ol>
<li><p>Let <var>siteA</var> be the result of <span data-x="obtain a site">obtaining a site</span>
given <var>A</var>.</p></li>

<li><p><var>A</var> and <var>B</var> are either both <span data-x="concept-origin-opaque">opaque
origins</span>, or both <span data-x="concept-origin-tuple">tuple origins</span> with the same
<span data-x="concept-origin-scheme">scheme</span></p></li>
</ul>
<li><p>Let <var>siteB</var> be the result of <span data-x="obtain a site">obtaining a site</span>
given <var>B</var>.</p></li>

<li><p>If <var>siteA</var> is <span data-x="concept-site-same-site">same site</span> with
<var>siteB</var>, then return true.</p></li>

<li><p>Return false.</p></li>
</ol>

</div>

Expand Down

0 comments on commit f22f6eb

Please sign in to comment.