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

Editorial: adopt Infra number definitions (and redo IPv6 pieces) #838

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

annevk
Copy link
Member

@annevk annevk commented Nov 18, 2024

Comment on lines +1448 to 1458
<li><p>Let <var>compress</var> be null.

<li>
<p>Let <var>compress</var> be an index to the first <a>IPv6 piece</a> in the first longest
sequences of <var>address</var>'s <a>IPv6 pieces</a> that are 0.
<p>If multiple <var>address</var>'s <a for="IPv6 address">pieces</a> are 0 sequentially, then set
<var>compress</var> to the index of the first item of the first of the longest sequences of
<var>address</var>'s <a for="IPv6 address">pieces</a> that are 0.

<p class=example id=example-e2b3492e>In <code>0:f:0:0:f:f:0:0</code> it would point to
the second 0.

<li><p>If there is no sequence of <var>address</var>'s <a>IPv6 pieces</a> that are 0 that is
longer than 1, then set <var>compress</var> to null.

<li><p>Let <var>ignore0</var> be false.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the biggest change here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this changed from excluding 1-length sequences to including them.

FYI here is whatwg-url's implementation. It might be worth writing the whole thing out as it's pretty complex. https://github.com/jsdom/whatwg-url/blob/0fb65e3c3671c2e790ff38aed9332fc7fb2cd12b/lib/url-state-machine.js#L387

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping that multiple and sequentially would do that work here. I could rewrite this though. #321 also requested that. Hopefully next week.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah, I think I skipped over the word "multiple". Sounds good to me, pending a rewrite :).

Comment on lines +1448 to 1458
<li><p>Let <var>compress</var> be null.

<li>
<p>Let <var>compress</var> be an index to the first <a>IPv6 piece</a> in the first longest
sequences of <var>address</var>'s <a>IPv6 pieces</a> that are 0.
<p>If multiple <var>address</var>'s <a for="IPv6 address">pieces</a> are 0 sequentially, then set
<var>compress</var> to the index of the first item of the first of the longest sequences of
<var>address</var>'s <a for="IPv6 address">pieces</a> that are 0.

<p class=example id=example-e2b3492e>In <code>0:f:0:0:f:f:0:0</code> it would point to
the second 0.

<li><p>If there is no sequence of <var>address</var>'s <a>IPv6 pieces</a> that are 0 that is
longer than 1, then set <var>compress</var> to null.

<li><p>Let <var>ignore0</var> be false.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah, I think I skipped over the word "multiple". Sounds good to me, pending a rewrite :).

Comment on lines +763 to +766
<p>An <dfn export id=concept-ipv6>IPv6 address</dfn> is a <a for=/>128-bit unsigned integer</a> that
identifies a network address. This integer is composed of a <a for=/>list</a> of 8
<a for=/>16-bit unsigned integers</a>, also known as an <a for=/>IPv6 address</a>'s
<dfn export for="IPv6 address" id=concept-ipv6-piece>pieces</dfn>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition is obscure: it is not clear how to convert a 128-bit integer to a list of pieces and vice versa. Also, all algorithms use an IPv6 address as a list of pieces, not as a 128-bit integer. By the way, RFC4291 defines an IPv6 address slightly differently: "IPv6 addresses are 128-bit identifiers...". So I think it is better to use the RFC4291 definition - replace "unsigned integer" with "identifier":

An IPv6 address is a 128-bit identifier that identifies a network address. This identifier is composed of ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All algorithms inside URL, yes, but outside? This we would have to change separately though as changing it from integer to identifier would not be an editorial change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants