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]] +

URLHost class

+ +
+[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: + +

    +
  1. Let host be the result of host parsing input with true. + +

  2. If host is failure, then throw a {{TypeError}}. + +

  3. Return a new {{URLHost}} object whose host is host. +

+ +

The type attribute's getter, must run these steps: + +

    +
  1. If this's host is an IPv4 address, then return + "ipv4". + +

  2. If this's host is an IPv6 address, then return + "ipv6". + +

  3. Assert: this's host is an domain. + +

  4. Return "domain". +

+ +

The stringification behavior and +toJSON() method, when invoked, must return this's +host, serialized. + +

Acknowledgments

@@ -3317,8 +3364,9 @@ Trevor Rowbotham, Valentin Gosu, Vyacheslav Matva, Wei Wang, -山岸和利 (Yamagishi Kazutoshi), and -成瀬ゆい (Yui Naruse) +山岸和利 (Yamagishi Kazutoshi), +成瀬ゆい (Yui Naruse), and +Zach Lym for being awesome!

This standard is written by