@@ -756,14 +756,14 @@ not equivalent and typically treated as distinct.
756
756
757
757
<p> An <dfn export>IP address</dfn> is an <a>IPv4 address</a> or an <a>IPv6 address</a> .
758
758
759
- <p> An <dfn export id=concept-ipv4>IPv4 address</dfn> is a 32-bit unsigned integer that identifies a
760
- network address.
759
+ <p> An <dfn export id=concept-ipv4>IPv4 address</dfn> is a <a for=/> 32-bit unsigned integer</a> that
760
+ identifies a network address.
761
761
[[RFC791]]
762
762
763
- <p> An <dfn export id=concept-ipv6>IPv6 address</dfn> is a 128-bit unsigned integer that identifies a
764
- network address. For the purposes of this standard it is represented as a <a for=/>list</a> of eight
765
- 16-bit unsigned integers, also known as
766
- <dfn export lt ="IPv6 piece " id=concept-ipv6-piece>IPv6 pieces</dfn> .
763
+ <p> An <dfn export id=concept-ipv6>IPv6 address</dfn> is a <a for=/> 128-bit unsigned integer</a> that
764
+ identifies a network address. This integer is composed of a <a for=/>list</a> of 8
765
+ <a for=/> 16-bit unsigned integers</a> , also known as an <a for=/>IPv6 address</a> 's
766
+ <dfn export for ="IPv6 address " id=concept-ipv6-piece>pieces</dfn> .
767
767
[[RFC4291]]
768
768
769
769
<p class="note"> Support for <code> <zone_id></code> is
@@ -1217,7 +1217,8 @@ these steps. They return failure or a <a for=/>tuple</a> of a number and a boole
1217
1217
actually doing that with the editors of this document first.
1218
1218
1219
1219
<ol>
1220
- <li><p> Let <var> address</var> be a new <a>IPv6 address</a> whose <a>IPv6 pieces</a> are all 0.
1220
+ <li><p> Let <var> address</var> be a new <a>IPv6 address</a> whose <a for="IPv6 address">pieces</a>
1221
+ are all 0.
1221
1222
1222
1223
<li><p> Let <var> pieceIndex</var> be 0.
1223
1224
@@ -1444,20 +1445,14 @@ actually doing that with the editors of this document first.
1444
1445
<ol>
1445
1446
<li><p> Let <var> output</var> be the empty string.
1446
1447
1447
- <li>
1448
- <p> Let <var> compress</var> be an index to the first <a>IPv6 piece</a> in the first longest
1449
- sequences of <var> address</var> 's <a>IPv6 pieces</a> that are 0.
1450
-
1451
- <p class=example id=example-e2b3492e> In <code> 0:f:0:0:f:f:0:0</code> it would point to
1452
- the second 0.
1453
-
1454
- <li><p> If there is no sequence of <var> address</var> 's <a>IPv6 pieces</a> that are 0 that is
1455
- longer than 1, then set <var> compress</var> to null.
1448
+ <li><p> Let <var> compress</var> be the result of
1449
+ <a for=/>finding the IPv6 address compressed piece index</a> given <var> address</var> .
1456
1450
1457
1451
<li><p> Let <var> ignore0</var> be false.
1458
1452
1459
1453
<li>
1460
- <p> <a for=set>For each</a> <var> pieceIndex</var> in the range 0 to 7, inclusive:
1454
+ <p> <a for=set>For each</a> <var> pieceIndex</var> of <var> address</var> 's
1455
+ <a for="IPv6 address">pieces</a> 's <a for=list>indices</a> :
1461
1456
1462
1457
<ol>
1463
1458
<li><p> If <var> ignore0</var> is true and <var> address</var> [<var>pieceIndex</var>] is 0, then
@@ -1469,8 +1464,8 @@ actually doing that with the editors of this document first.
1469
1464
<p> If <var> compress</var> is <var> pieceIndex</var> , then:
1470
1465
1471
1466
<ol>
1472
- <li><p> Let <var> separator</var> be "<code> ::</code> " if <var> pieceIndex</var> is 0, and
1473
- U+003A (:) otherwise .
1467
+ <li><p> Let <var> separator</var> be "<code> ::</code> " if <var> pieceIndex</var> is 0; otherwise
1468
+ U+003A (:).
1474
1469
1475
1470
<li><p> Append <var> separator</var> to <var> output</var> .
1476
1471
@@ -1491,6 +1486,57 @@ A Recommendation for IPv6 Address Text Representation.
1491
1486
[[RFC5952]]
1492
1487
</div>
1493
1488
1489
+ <div algorithm>
1490
+ <p> To <dfn>find the IPv6 address compressed piece index</dfn> given an <a for=/>IPv6 address</a>
1491
+ <var> address</var> :
1492
+
1493
+ <ol>
1494
+ <li><p> Let <var> longestIndex</var> be null.
1495
+
1496
+ <li><p> Let <var> longestSize</var> be 1.
1497
+
1498
+ <li><p> Let <var> foundIndex</var> be null.
1499
+
1500
+ <li><p> Let <var> foundSize</var> be 0.
1501
+
1502
+ <li>
1503
+ <p> <a for=list>For each</a> <var> pieceIndex</var> of <var> address</var> 's
1504
+ <a for="IPv6 address">pieces</a> 's <a for=list>indices</a> :
1505
+
1506
+ <ol>
1507
+ <li>
1508
+ <p> If <var> address</var> 's <a for="IPv6 address">pieces</a> [<var>pieceIndex</var>] is not 0:
1509
+
1510
+ <ol>
1511
+ <li><p> If <var> foundSize</var> is greater than <var> longestSize</var> , then set
1512
+ <var> longestIndex</var> to <var> foundIndex</var> and <var> longestSize</var> to
1513
+ <var> foundSize</var> .
1514
+
1515
+ <li> Set <var> foundIndex</var> to null.
1516
+
1517
+ <li> Set <var> foundSize</var> to 0.
1518
+ </ol>
1519
+
1520
+ <li>
1521
+ <p> Otherwise:
1522
+
1523
+ <ol>
1524
+ <li><p> If <var> foundIndex</var> is null, then set <var> foundIndex</var> to
1525
+ <var> pieceIndex</var> .
1526
+
1527
+ <li><p> Increment <var> foundSize</var> by 1.
1528
+ </ol>
1529
+ </ol>
1530
+
1531
+ <li><p> If <var> foundSize</var> is greater than <var> longestSize</var> , then return
1532
+ <var> foundIndex</var> .
1533
+
1534
+ <li><p> Return <var> longestIndex</var> .
1535
+ </ol>
1536
+
1537
+ <p class=example id=example-e2b3492e> In <code> 0:f:0:0:f:f:0:0</code> it would point to the second 0.
1538
+ </div>
1539
+
1494
1540
1495
1541
<h3 id=host-equivalence>Host equivalence</h3>
1496
1542
@@ -1713,8 +1759,8 @@ It is initially the empty string.
1713
1759
</table>
1714
1760
</div>
1715
1761
1716
- <p> A <a for=/>URL</a> 's <dfn export for=url id=concept-url-port>port</dfn> is either
1717
- null or a 16-bit unsigned integer that identifies a networking port. It is initially null.
1762
+ <p> A <a for=/>URL</a> 's <dfn export for=url id=concept-url-port>port</dfn> is either null or a
1763
+ <a for=/> 16-bit unsigned integer</a> that identifies a networking port. It is initially null.
1718
1764
1719
1765
<p> A <a for=/>URL</a> 's
1720
1766
<dfn export for=url id=concept-url-path oldids=non-relative-flag,url-cannot-be-a-base-url-flag>path</dfn>
@@ -1974,8 +2020,8 @@ followed by a <a>path-absolute-URL string</a>.
1974
2020
1975
2021
<ul class=brief>
1976
2022
<li><p> the empty string
1977
- <li><p> one or more <a>ASCII digits</a> representing a decimal number no greater than
1978
- 2 <sup > 16</sup> − 1 .
2023
+ <li><p> one or more <a>ASCII digits</a> representing a decimal number that is a
2024
+ <a for=/ >16-bit unsigned integer</a> .
1979
2025
</ul>
1980
2026
1981
2027
<p> A <dfn export oldids=syntax-url-scheme-relative>scheme-relative-URL string</dfn> must be
@@ -2577,7 +2623,7 @@ and then runs these steps:
2577
2623
by <var> buffer</var> in radix-10 using <a>ASCII digits</a> for digits with values
2578
2624
0 through 9.
2579
2625
2580
- <li><p> If <var> port</var> is greater than 2 <sup > 16</sup> − 1 ,
2626
+ <li><p> If <var> port</var> is not a <a for=/ >16-bit unsigned integer</a> ,
2581
2627
<a>port-out-of-range</a> <a>validation error</a> , return failure.
2582
2628
2583
2629
<li><p> Set <var> url</var> 's <a for=url>port</a> to null, if <var> port</var> is
0 commit comments