diff --git a/url.bs b/url.bs index f9da78dc..ec3d5134 100644 --- a/url.bs +++ b/url.bs @@ -3219,6 +3219,53 @@ e.g., "newURL" and "oldURL". naming. [[!HTML]] +
+[Constructor(USVString host), + Exposed=(Window,Worker)] +interface URLHost { + 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, when
+invoked, must run these steps:
+
+
Let host be the result of host parsing input with true. + +
If host is failure, then throw a {{TypeError}}. + +
Return a new {{URLHost}} object whose host is host. +
The type
attribute's getter, must run these steps:
+
+
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, when invoked, must return this's
+host, serialized.
+
+
This standard is written by