@@ -3208,6 +3208,65 @@ e.g., "newURL" and "oldURL".
3208
3208
naming. [[!HTML]]
3209
3209
3210
3210
3211
+ <h3 id=urlhost-class>URLHost class</h3>
3212
+
3213
+ <pre class=idl>
3214
+ [Constructor(USVString host),
3215
+ Exposed=(Window,Worker)]
3216
+ interface URLHost {
3217
+ USVString unicode();
3218
+ readonly attribute URLHostType type;
3219
+
3220
+ stringifier USVString toJSON();
3221
+ };
3222
+
3223
+ enum URLHostType { "ipv4", "ipv6", "domain" };</pre>
3224
+
3225
+ <p> Each {{URLHost}} object has an associated <dfn for=URLHost>host</dfn> (a <a for=/>host</a> ).
3226
+
3227
+ <hr>
3228
+
3229
+ <p> The <dfn constructor for=URLHost><code>URLHost(<var>input</var>)</code></dfn> constructor, when
3230
+ invoked, must run these steps:
3231
+
3232
+ <ol>
3233
+ <li><p> Let <var> host</var> be the result of <a>host parsing</a> <var> input</var> with true.
3234
+
3235
+ <li><p> If <var> host</var> is failure, then <a>throw</a> a {{TypeError}} .
3236
+
3237
+ <li><p> Return a new {{URLHost}} object whose <a for=URLHost>host</a> is <var> host</var> .
3238
+ </ol>
3239
+
3240
+ <p> The <dfn method for=URLHost><code>unicode()</code></dfn> method, when invoked, must run these
3241
+ steps:
3242
+
3243
+ <ol>
3244
+ <li><p> If <a>context object</a> 's <a for=URLHost>host</a> is not a <a>domain</a> , then <a>throw</a>
3245
+ a {{TypeError}} .
3246
+
3247
+ <li><p> Let <var> unicodeDomain</var> be the result of running <a>domain to Unicode</a> on
3248
+ <a>context object</a> 's <a for=URLHost>host</a> .
3249
+
3250
+ <li><p> Return <var> unicodeDomain</var> , <a lt="host serializer">serialized</a> .
3251
+ </ol>
3252
+
3253
+ <p> The <dfn attribute for=URLHost><code>type</code></dfn> attribute's getter, must run these steps:
3254
+
3255
+ <ol>
3256
+ <li><p> If <a>context object</a> 's <a for=URLHost>host</a> is an <a>IPv4 address</a> , then return
3257
+ "<code> ipv4</code> ".
3258
+
3259
+ <li><p> If <a>context object</a> 's <a for=URLHost>host</a> is an <a>IPv6 address</a> , then return
3260
+ "<code> ipv6</code> ".
3261
+
3262
+ <li><p> Return "<code> domain</code> ".
3263
+ </ol>
3264
+
3265
+ <p> The <dfn for=URLHost>stringification behavior</dfn> and
3266
+ <dfn method for=URLHost><code>toJSON()</code></dfn> method, when invoked, must return
3267
+ <a>context object</a> 's <a for=URLHost>host</a> , <a lt="host serializer">serialized</a> .
3268
+
3269
+
3211
3270
3212
3271
<h2 id=acknowledgments class=no-num>Acknowledgments</h2>
3213
3272
@@ -3302,8 +3361,9 @@ Trevor Rowbotham,
3302
3361
Valentin Gosu,
3303
3362
Vyacheslav Matva,
3304
3363
Wei Wang,
3305
- 山岸和利 (Yamagishi Kazutoshi), and
3306
- 成瀬ゆい (Yui Naruse)
3364
+ 山岸和利 (Yamagishi Kazutoshi),
3365
+ 成瀬ゆい (Yui Naruse), and
3366
+ Zach Lym
3307
3367
for being awesome!
3308
3368
3309
3369
<p> This standard is written by
0 commit comments