Skip to content

Commit

Permalink
Build upon URL rather than PSL
Browse files Browse the repository at this point in the history
Instead of "parsing" the Public Suffix List directly, use new terminology from the URL Standard.

Fixes #3711.
  • Loading branch information
annevk committed Jun 6, 2018
1 parent 0d28f8f commit eaeb47f
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

<ul class="brief">
<li><dfn data-x="concept-host" data-x-href="https://url.spec.whatwg.org/#concept-host">host</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#host-registrable-domain">registrable domain</dfn></li>
<li><dfn data-x="concept-domain" data-x-href="https://url.spec.whatwg.org/#concept-domain">domain</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#concept-ipv4">IPv4 address</dfn></li>
<li><dfn data-x-href="https://url.spec.whatwg.org/#concept-ipv6">IPv6 address</dfn></li>
Expand Down Expand Up @@ -79672,28 +79673,24 @@ interface <dfn>BarProp</dfn> {
<li><p>If <var>host</var> is failure, then return false.</p></li>

<li>
<p>If <var>host</var> is <em>not</em> <span data-x="host equals">equal</span> to
<var>originalHost</var>, then run these substeps:</p>
<p>If <var>host</var> does not <span data-x="host equals">equal</span> <var>originalHost</var>,
then:</p>

<ol>
<li>
<p>If <var>host</var> or <var>originalHost</var> is not a <span
data-x="concept-domain">domain</span>, then return false.</p>

<p class="note">This is meant to exclude <span data-x="concept-host">hosts</span> that are an
<span>IPv4 address</span> or an <span>IPv6 address</span>.</p>
<p class="note">This excludes <span data-x="concept-host">hosts</span> that are an <span>IPv4
address</span> or an <span>IPv6 address</span>.</p>
</li>

<li><p>If <var>host</var>, prefixed by a U+002E FULL STOP (.), does not exactly match the end
of <var>originalHost</var>, then return false.</p></li>
<!-- This seems okay, but does pretend hosts are strings which URL does not. -->

<li>
<p>If <var>host</var> matches a suffix in the Public Suffix List, or, if <var>host</var>,
prefixed by a U+002E FULL STOP (.), matches the end of a suffix in the Public Suffix List,
then return false. <ref spec=PSL></p>

<p>Suffixes must be compared after applying the <span>host parser</span> algorithm.</p>
</li>
<li><p>If <var>host</var>'s <span>registrable domain</span> is null, then return false. <ref
spec=URL></p></li>
</ol>
</li>

Expand Down Expand Up @@ -120301,10 +120298,6 @@ INSERT INTERFACES HERE
<dt id="refsPRESENTATION">[PRESENTATION]</dt>
<dd><cite><a href="https://w3c.github.io/presentation-api/">Presentation API</a></cite>, M. Foltz, D. Röttsches. W3C.</dd>

<dt id="refsPSL">[PSL]</dt>
<dd><cite><a href="https://publicsuffix.org/">Public Suffix List</a></cite>.
Mozilla Foundation.</dd>

<dt id="refsREFERRERPOLICY">[REFERRERPOLICY]</dt>
<dd><cite><a href="https://w3c.github.io/webappsec-referrer-policy/">Referrer Policy</a></cite>, J. Eisinger, E. Stark. W3C.</dd>

Expand Down

0 comments on commit eaeb47f

Please sign in to comment.