@@ -2742,43 +2742,73 @@ <h3><dfn>Writing or pushing content</dfn></h3>
2742
2742
</ p >
2743
2743
< ol class =algorithm id ="validate-external-type ">
2744
2744
< li >
2745
- If |input:string| is not a {{USVString}} or it is empty, or its
2745
+ If |input:string| is not an [=ASCII string=] or it is empty, or its
2746
2746
length exceeds 255 bytes, return `false`.
2747
2747
</ li >
2748
2748
< li >
2749
- Let |domain| be the |input| from the start of |input| up to but
2750
- excluding the last occurrence of U+003A (`:`), or `null` if that is
2751
- not found.
2752
- </ li >
2753
- < li >
2754
- Let |type| be the |input| after the last occurrence, if any, of
2755
- `U+003A` (`:`) up to the end of |input|, or `null` if that is
2756
- not found.
2757
- </ li >
2758
- < li >
2759
- If |domain| or |type| is `null`, return `false`.
2749
+ If input starts with `U+005B` (`[`), then:
2750
+ < ol >
2751
+ < li >
2752
+ Let |address| be the part of input between `U+005B` (`[`) and
2753
+ the first occurrence of `U+005D` (`]`) or `null` if that is not
2754
+ found.
2755
+ </ li >
2756
+ < li >
2757
+ If |address| is `null`, return `false`.
2758
+ </ li >
2759
+ < li >
2760
+ Let |domain| be the result of running
2761
+ < a href ="https://url.spec.whatwg.org/#concept-ipv6-parser ">
2762
+ IPv6 parsing</ a > on |address|.
2763
+ </ li >
2764
+ < li >
2765
+ If |domain| is failure, return `false`.
2766
+ </ li >
2767
+ < li >
2768
+ Let |rest| be the |input| after the first occurrence, if any, of
2769
+ `U+005D` (`]`) up to the end of |input|, or `null` if that is
2770
+ not found.
2771
+ </ li >
2772
+ < li >
2773
+ If |rest| is `null`, or it contains less than 2 [=code points=],
2774
+ or the first [=code point=] in |rest| is not `U+003A` (`:`),
2775
+ return `false`.
2776
+ </ li >
2777
+ < li >
2778
+ Let |type| be |rest| from the second [=code point=] up to the end
2779
+ of |rest|.
2780
+ </ li >
2781
+ </ ol >
2760
2782
</ li >
2761
2783
< li >
2762
- Run the following sub-steps of
2763
- < a href ="https://url.spec.whatwg.org/#host-parsing "> host parsing</ a >
2764
- on |domain|:
2765
- < ul >
2784
+ Otherwise,
2785
+ < ol >
2786
+ < li >
2787
+ Let |domain| be the |input| from the start of |input| up to
2788
+ but excluding the first occurrence of `U+003A` (`:`), or `null`
2789
+ if that is not found.
2790
+ </ li >
2791
+ < li >
2792
+ Let |type| be the |input| after the first occurrence, if any, of
2793
+ `U+003A` (`:`) up to the end of |input|, or `null` if that is
2794
+ not found.
2795
+ </ li >
2796
+ < li >
2797
+ If |domain| or |type| is `null`, return `false`.
2798
+ </ li >
2766
2799
< li >
2767
2800
Let |asciiDomain| be the result of running
2768
2801
< a href ="https://url.spec.whatwg.org/#concept-domain-to-ascii ">
2769
- domain to ASCII</ a > on |domain|.
2802
+ domain to ASCII</ a > given |domain| and `true` (as |beStrict|) .
2770
2803
</ li >
2771
2804
< li >
2772
2805
If |asciiDomain| is failure, return `false`.
2773
2806
</ li >
2774
2807
< li >
2775
- If |asciiDomain| contains a [=forbidden host code point=],
2776
- return `false`.
2808
+ If |asciiDomain| contains a [=forbidden host code point=] or
2809
+ `U+005F` `LOW LINE` (`_`), return `false`.
2777
2810
</ li >
2778
- </ ul >
2779
- </ li >
2780
- < li >
2781
- If |type| is empty, return `false`.
2811
+ </ ol >
2782
2812
</ li >
2783
2813
< li >
2784
2814
If |type| contains [=code points=] that are not
0 commit comments