@@ -924,6 +924,10 @@ used by HTML. [[HTML]]
924
924
<a for=url>username</a> or <a for=url>password</a> is not the empty string.
925
925
<!-- also used by Fetch -->
926
926
927
+ <p> A <a for=/>URL</a> <dfn export>cannot have a username/password/port</dfn> if its
928
+ <a for=url>host</a> is null or the empty string, its <a for=url>cannot-be-a-base-URL flag</a> is
929
+ set, or its <a for=url>scheme</a> is "<code> file</code> ".
930
+
927
931
<p> A <a for=/>URL</a> can be designated as <dfn id=concept-base-url>base URL</dfn> .
928
932
929
933
<p class="note no-backref"> A <a>base URL</a> is useful for the <a>URL parser</a> when the
@@ -1636,9 +1640,12 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
1636
1640
<dt> <dfn>hostname state</dfn>
1637
1641
<dd>
1638
1642
<ol>
1643
+ <li><p> If <var> state override</var> is given and <var> url</var> 's <a for=url>scheme</a> is
1644
+ "<code> file</code> ", then decrease <var> pointer</var> by one and set <var> state</var> to
1645
+ <a>file host state</a> .
1646
+
1639
1647
<li>
1640
- <p> If <a>c</a> is "<code> :</code> " and the
1641
- <var> [] flag</var> is unset, run these substeps:
1648
+ <p> Otherwise, if <a>c</a> is "<code> :</code> " and the <var> [] flag</var> is unset, then:
1642
1649
1643
1650
<ol>
1644
1651
<li><p> If <var> buffer</var> is the empty string, <a>syntax violation</a> , return failure.
@@ -1674,6 +1681,10 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
1674
1681
<!-- http://? -> failure
1675
1682
test://? -> test://? -->
1676
1683
1684
+ <li><p> Otherwise, if <var> state override</var> is given, <var> buffer</var> is the empty
1685
+ string, and either <var> url</var> <a>includes credentials</a> or <var> url</var> 's
1686
+ <a for=url>port</a> is non-null, <a>syntax violation</a> , return.
1687
+
1677
1688
<li><p> Let <var> host</var> be the result of <a lt="URL-host parser">URL-host parsing</a>
1678
1689
<var> buffer</var> with <var> url</var> <a>is special</a> .
1679
1690
@@ -1854,28 +1865,42 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
1854
1865
1855
1866
<ol>
1856
1867
<li>
1857
- <p> If <var> buffer</var> is a <a>Windows drive letter</a> , <a>syntax violation</a> ,
1858
- set <var> state</var> to <a>path state</a> .
1859
-
1860
- <p class=note> This is a (platform-independent) Windows drive letter quirk.
1861
- <var> buffer</var> is not reset here and instead used in the
1868
+ <p> If <var> state override</var> is not given and <var> buffer</var> is a
1869
+ <a>Windows drive letter</a> , <a>syntax violation</a> , set <var> state</var> to
1862
1870
<a>path state</a> .
1863
1871
1864
- <li><p> Otherwise, if <var> buffer</var> is the empty string, set
1865
- <var> state</var> to <a>path start state</a> .
1872
+ <p class=note> This is a (platform-independent) Windows drive letter quirk. <var> buffer</var>
1873
+ is not reset here and instead used in the <a>path state</a> .
1874
+
1875
+ <li>
1876
+ <p> Otherwise, if <var> buffer</var> is the empty string, then:
1877
+
1878
+ <ol>
1879
+ <li><p> If <var> state override</var> is given and <var> url</var>
1880
+ <a>includes credentials</a> , <a>syntax violation</a> , return.
1881
+
1882
+ <li><p> Set <var> url</var> 's <a for=url>host</a> to the empty string.
1883
+
1884
+ <li><p> If <var> state override</var> is given, then return.
1885
+
1886
+ <li><p> Set <var> state</var> to <a>path start state</a> .
1887
+ </ol>
1866
1888
1867
1889
<li>
1868
1890
<p> Otherwise, run these steps:
1869
1891
1870
1892
<ol>
1871
- <li><p> Let <var> host</var> be the result of
1872
- <a lt='host parser'>host parsing</a>
1893
+ <li><p> Let <var> host</var> be the result of <a lt="host parser">host parsing</a>
1873
1894
<var> buffer</var> .
1874
1895
1875
- <li><p> If <var> host</var> is failure, return failure.
1896
+ <li><p> If <var> host</var> is failure, then return failure.
1897
+
1898
+ <li><p> If <var> host</var> is "<code title> localhost</code> ", then set <var> host</var> to
1899
+ the empty string.
1900
+
1901
+ <li><p> Set <var> url</var> 's <a for=url>host</a> to <var> host</var> .
1876
1902
1877
- <li><p> If <var> host</var> is not "<code title> localhost</code> ", set
1878
- <var> url</var> 's <a for=url>host</a> to <var> host</var> .
1903
+ <li><p> If <var> state override</var> is given, then return.
1879
1904
1880
1905
<li><p> Set <var> buffer</var> to the empty string and <var> state</var> to
1881
1906
<a>path start state</a> .
@@ -2620,8 +2645,8 @@ compatibility with HTML's <code>MessageEvent</code> feature. [[!HTML]]
2620
2645
<p> The <code> <a attribute for=URL>username</a> </code> attribute's setter must run these steps:
2621
2646
2622
2647
<ol>
2623
- <li><p> If <a>context object</a> 's <a for=URL>url</a>' s <a for=url>host </a> is null, or its
2624
- <a for=url>cannot-be-a-base-URL flag</a> is set, terminate these steps .
2648
+ <li><p> If <a>context object</a> 's <a for=URL>url</a> <a>cannot have a username/password/port </a> ,
2649
+ then return .
2625
2650
2626
2651
<li><p> <a for=url>Set the username</a> given <a>context object</a> 's <a for=URL>url</a> and the
2627
2652
given value.
@@ -2633,8 +2658,8 @@ compatibility with HTML's <code>MessageEvent</code> feature. [[!HTML]]
2633
2658
<p> The <code> <a attribute for=URL>password</a> </code> attribute's setter must run these steps:
2634
2659
2635
2660
<ol>
2636
- <li><p> If <a>context object</a> 's <a for=URL>url</a>' s <a for=url>host </a> is null, or its
2637
- <a for=url>cannot-be-a-base-URL flag</a> is set, terminate these steps .
2661
+ <li><p> If <a>context object</a> 's <a for=URL>url</a> <a>cannot have a username/password/port </a> ,
2662
+ then return .
2638
2663
2639
2664
<li><p> <a for=url>Set the password</a> given <a>context object</a> 's <a for=URL>url</a> and the
2640
2665
given value.
@@ -2704,9 +2729,8 @@ the setter to always "reset" both.
2704
2729
<p> The <code> <a attribute for=URL>port</a> </code> attribute's setter must run these steps:
2705
2730
2706
2731
<ol>
2707
- <li><p> If <a>context object</a> 's <a for=URL>url</a>' s <a for=url>host</a> is null, its
2708
- <a for=url>cannot-be-a-base-URL flag</a> is set, or its <a for=url>scheme</a> is
2709
- "<code> file</code> ", terminate these steps.
2732
+ <li><p> If <a>context object</a> 's <a for=URL>url</a> <a>cannot have a username/password/port</a> ,
2733
+ then return.
2710
2734
2711
2735
<li><p> If the given value is the empty string, then set <a for=URL>url</a> 's <a for=url>port</a> to
2712
2736
null.</p></li>
0 commit comments