Skip to content
24 changes: 15 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4035,21 +4035,27 @@ this algorithm returns normally if compilation is allowed, and throws a
and [=url/scheme=]. For example, "80" <a>`port-part` matches</a> matches "80"/"http".

<ol class="algorithm">
1. If |port A| is the empty string:
1. Let |adjusted port A| be the result of removing any leading "0"s from |port A|.

1. If |port B| is the <a>default port</a> for |scheme B|, return "`Matches`". Otherwise,
return "`Does Not Match`".
2. If |adjusted port A| is <a for="string" lt="is">identical to</a> |port B|, return "`Matches`".

2. If |port A| is equal to "*", return "`Matches`".
3. If |port A| is equal to "*", return "`Matches`".

3. If |port A| is <a for="string" lt="is">identical to</a> |port B|, return "`Matches`".
4. If |port A| is the empty string:

4. If |port B| is the empty string:
1. Let |default port b| be the <a>ASCII string</a> of the <a>default port</a> for |scheme B|
if it is not null, otherwise the empty string.

1. If |port A| is the <a>default port</a> for |scheme B|, return "`Matches`". Otherwise,
return "`Does not Match`".
2. If |port B| is <a for="string" lt="is">identical to</a> |default port B|, return "`Matches`".

5. Return "`Does Not Match`".
5. If |port B| is the empty string:

1. Let |default port b| be the <a>ASCII string</a> of the <a>default port</a> for |scheme B|
if it exists and is not null, otherwise the empty string.

2. If |adjusted port A| is <a for="string" lt="is">identical to</a> |default port B|, return "`Matches`".

6. Return "`Does Not Match`".
</ol>

<h5 id="match-paths" algorithm>
Expand Down