diff --git a/url.bs b/url.bs index 8ad40e2d..18a7c7dc 100644 --- a/url.bs +++ b/url.bs @@ -3502,6 +3502,54 @@ e.g., "newURL" and "oldURL". examples of proper naming. [[!HTML]] +
+[Exposed=*] +interface URLHost { + constructor(USVString host); + + readonly attribute URLHostType type; + + stringifier USVString toJSON(); +}; + +enum URLHostType { "ipv4", "ipv6", "domain" };+ +
Each {{URLHost}} object has an associated host (a host). + +
The URLHost(input)
constructor steps
+are:
+
+
Let host be the result of host parsing input with true. + +
If host is failure, then throw a {{TypeError}}. + +
The type
getter steps are:
+
+
If this's host is an IPv4 address, then return
+ "ipv4
".
+
+
If this's host is an IPv6 address, then return
+ "ipv6
".
+
+
Return "domain
".
+
The stringification behavior and
+toJSON()
method steps, are to return this's
+host, serialized.
+
+