Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ipv6 hostnames to the constructor string parser. (Fix… #114

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ A [=constructor string parser=] has an associated <dfn export for="constructor s

A [=constructor string parser=] has an associated <dfn export for="constructor string parser">group depth</dfn>, a number, initially set to 0.

A [=constructor string parser=] has an associated <dfn export for="constructor string parser">hostname IPv6 bracket depth</dfn>, a number, initially set to 0.

A [=constructor string parser=] has an associated <dfn export for="constructor string parser">protocol matches a special scheme flag</dfn>, a boolean, initially set to false.

A [=constructor string parser=] has an associated <dfn export for="constructor string parser">state</dfn>, a string, initially set to "<a for="constructor string parser/state">`init`</a>". It must be one of the following:
Expand Down Expand Up @@ -607,7 +609,9 @@ To <dfn>parse a constructor string</dfn> given a string |input|:
</dd>
<dt>"<a for="constructor string parser/state">`hostname`</a>"</dt>
<dd>
1. If the result of running [=is a port prefix=] given |parser| is true, then run [=change state=] given |parser|, "<a for="constructor string parser/state">`port`</a>", and 1.
1. If the the result of running [=is an IPv6 open=] given |parser| is true, then increment |parser|'s [=constructor string parser/hostname IPv6 bracket depth=] by 1.
1. Else if the the result of running [=is an IPv6 close=] given |parser| is true, then decrement |parser|'s [=constructor string parser/hostname IPv6 bracket depth=] by 1.
1. Else if the result of running [=is a port prefix=] given |parser| is true and |parser|'s [=constructor string parser/hostname IPv6 bracket depth=] is zero, then run [=change state=] given |parser|, "<a for="constructor string parser/state">`port`</a>", and 1.
1. Else if the result of running [=is a pathname start=] given |parser| is true, then run [=change state=] given |parser|, "<a for="constructor string parser/state">`pathname`</a>", and 0.
1. Else if the result of running [=is a search prefix=] given |parser| is true, then run [=change state=] given |parser|, "<a for="constructor string parser/state">`search`</a>", and 1.
1. Else if the result of running [=is a hash prefix=] given |parser| is true, then run [=change state=] given |parser|, "<a for="constructor string parser/state">`hash`</a>", and 1.
Expand Down Expand Up @@ -764,6 +768,18 @@ To run <dfn>is a group close</dfn> given a [=constructor string parser=] |parser
1. Else return false.
</div>

<div algorithm>
To run <dfn>is an IPv6 open</dfn> given a [=constructor string parser=] |parser|:

1. Return the result of running [=is a non-special pattern char=] given |parser|, |parser|'s [=constructor string parser/token index=], and "`[`".
</div>

<div algorithm>
To run <dfn>is an IPv6 close</dfn> given a [=constructor string parser=] |parser|:

1. Return the result of running [=is a non-special pattern char=] given |parser|, |parser|'s [=constructor string parser/token index=], and "`]`".
</div>

<div algorithm>
To run <dfn>make a component string</dfn> given a [=constructor string parser=] |parser|:

Expand Down