forked from w3c/webtransport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
3102 lines (2994 loc) · 254 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<title>WebTransport</title>
<meta content="w3c/ED" name="w3c-status">
<link href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED" rel="stylesheet">
<link href="https://www.w3.org/2008/site/images/favicon.ico" rel="icon">
<meta content="Bikeshed version 89ebb6ab, updated Fri Oct 9 15:32:07 2020 -0700" name="generator">
<link href="https://github.com/w3c/webtransport" rel="canonical">
<style>/* style-autolinks */
.css.css, .property.property, .descriptor.descriptor {
color: var(--a-normal-text);
font-size: inherit;
font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
content: "‘";
}
.css::after, .property::after, .descriptor::after {
content: "’";
}
.property, .descriptor {
/* Don't wrap property and descriptor names */
white-space: nowrap;
}
.type { /* CSS value <type> */
font-style: italic;
}
pre .property::before, pre .property::after {
content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
content: "’";
}
[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
content: "";
}
[data-link-type=element],
[data-link-type=element-attr] {
font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after { content: ">" }
[data-link-type=biblio] {
white-space: pre;
}</style>
<style>/* style-colors */
/* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */
:root {
color-scheme: light dark;
--text: black;
--bg: white;
--logo-bg: #1a5e9a;
--logo-active-bg: #c00;
--logo-text: white;
--tocnav-normal-text: #707070;
--tocnav-normal-bg: var(--bg);
--tocnav-hover-text: var(--tocnav-normal-text);
--tocnav-hover-bg: #f8f8f8;
--tocnav-active-text: #c00;
--tocnav-active-bg: var(--tocnav-normal-bg);
--tocsidebar-text: var(--text);
--tocsidebar-bg: #f7f8f9;
--tocsidebar-shadow: rgba(0,0,0,.1);
--tocsidebar-heading-text: hsla(203,20%,40%,.7);
--toclink-text: var(--text);
--toclink-underline: #3980b5;
--toclink-visited-text: var(--toclink-text);
--toclink-visited-underline: #054572;
--heading-text: #005a9c;
--hr-text: var(--text);
--algo-border: #def;
--del-text: red;
--del-bg: transparent;
--ins-text: #080;
--ins-bg: transparent;
--a-normal-text: #034575;
--a-normal-underline: #707070;
--a-visited-text: var(--a-normal-text);
--a-visited-underline: #bbb;
--a-hover-bg: rgba(75%, 75%, 75%, .25);
--a-active-text: #c00;
--a-active-underline: #c00;
--blockquote-border: silver;
--blockquote-bg: transparent;
--blockquote-text: currentcolor;
--issue-border: #e05252;
--issue-bg: #fbe9e9;
--issue-text: var(--text);
--issueheading-text: #831616;
--example-border: #e0cb52;
--example-bg: #fcfaee;
--example-text: var(--text);
--exampleheading-text: #574b0f;
--note-border: #52e052;
--note-bg: #e9fbe9;
--note-text: var(--text);
--noteheading-text: hsl(120, 70%, 30%);
--notesummary-underline: silver;
--assertion-border: #aaa;
--assertion-bg: #eee;
--assertion-text: black;
--advisement-border: orange;
--advisement-bg: #fec;
--advisement-text: var(--text);
--advisementheading-text: #b35f00;
--warning-border: red;
--warning-bg: hsla(40,100%,50%,0.95);
--warning-text: var(--text);
--amendment-border: #330099;
--amendment-bg: #F5F0FF;
--amendment-text: var(--text);
--amendmentheading-text: #220066;
--def-border: #8ccbf2;
--def-bg: #def;
--def-text: var(--text);
--defrow-border: #bbd7e9;
--datacell-border: silver;
--indexinfo-text: #707070;
--indextable-hover-text: black;
--indextable-hover-bg: #f7f8f9;
--outdatedspec-bg: rgba(0, 0, 0, .5);
--outdatedspec-text: black;
--outdated-bg: maroon;
--outdated-text: white;
--outdated-shadow: red;
--editedrec-bg: darkorange;
}</style>
<style>/* style-counters */
body {
counter-reset: example figure issue;
}
.issue {
counter-increment: issue;
}
.issue:not(.no-marker)::before {
content: "Issue " counter(issue);
}
.example {
counter-increment: example;
}
.example:not(.no-marker)::before {
content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
content: "Invalid Example" counter(example);
}
figcaption {
counter-increment: figure;
}
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-dfn-panel */
:root {
--dfnpanel-bg: #ddd;
--dfnpanel-text: var(--text);
}
.dfn-panel {
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
width: fit-content;
max-width: 300px;
max-height: 500px;
overflow: auto;
padding: 0.5em 0.75em;
font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
background: var(--dfnpanel-bg);
color: var(--dfnpanel-text);
border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: var(--dfnpanel-text); }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
display: inline-block;
position: fixed;
left: .5em;
bottom: 2em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}
.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-md-lists */
/* This is a weird hack for me not yet following the commonmark spec
regarding paragraph and lists. */
[data-md] > :first-child {
margin-top: 0;
}
[data-md] > :last-child {
margin-bottom: 0;
}</style>
<style>/* style-selflinks */
:root {
--selflink-text: white;
--selflink-bg: gray;
--selflink-hover-text: black;
}
.heading, .issue, .note, .example, li, dt {
position: relative;
}
a.self-link {
position: absolute;
top: 0;
left: calc(-1 * (3.5rem - 26px));
width: calc(3.5rem - 26px);
height: 2em;
text-align: center;
border: none;
transition: opacity .2s;
opacity: .5;
}
a.self-link:hover {
opacity: 1;
}
.heading > a.self-link {
font-size: 83%;
}
li > a.self-link {
left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
top: auto;
left: auto;
opacity: 0;
width: 1.5em;
height: 1.5em;
background: var(--selflink-bg);
color: var(--selflink-text);
font-style: normal;
transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
opacity: 1;
}
dfn > a.self-link:hover {
color: var(--selflink-hover-text);
}
a.self-link::before { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before { content: "#"; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight {
background: var(--borderedblock-bg, var(--def-bg));
}
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
.highlight:not(.idl) { background: rgba(0, 0, 0, .03); }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
<style>/* style-var-click-highlighting */
var { cursor: pointer; }
var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
</style>
<style>/* style-darkmode */
@media (prefers-color-scheme: dark) {
:root {
--text: #ddd;
--bg: black;
--logo-bg: #1a5e9a;
--logo-active-bg: #c00;
--logo-text: white;
--tocnav-normal-text: #999;
--tocnav-normal-bg: var(--bg);
--tocnav-hover-text: var(--tocnav-normal-text);
--tocnav-hover-bg: #080808;
--tocnav-active-text: #f44;
--tocnav-active-bg: var(--tocnav-normal-bg);
--tocsidebar-text: var(--text);
--tocsidebar-bg: #080808;
--tocsidebar-shadow: rgba(255,255,255,.1);
--tocsidebar-heading-text: hsla(203,20%,40%,.7);
--toclink-text: var(--text);
--toclink-underline: #6af;
--toclink-visited-text: var(--toclink-text);
--toclink-visited-underline: #054572;
--heading-text: #8af;
--hr-text: var(--text);
--algo-border: #456;
--del-text: #f44;
--del-bg: transparent;
--ins-text: #4a4;
--ins-bg: transparent;
--a-normal-text: #6af;
--a-normal-underline: #555;
--a-visited-text: var(--a-normal-text);
--a-visited-underline: var(--a-normal-underline);
--a-hover-bg: rgba(25%, 25%, 25%, .2);
--a-active-text: #f44;
--a-active-underline: var(--a-active-text);
--borderedblock-bg: rgba(255, 255, 255, .05);
--blockquote-border: silver;
--blockquote-bg: var(--borderedblock-bg);
--blockquote-text: currentcolor;
--issue-border: #e05252;
--issue-bg: var(--borderedblock-bg);
--issue-text: var(--text);
--issueheading-text: hsl(0deg, 70%, 70%);
--example-border: hsl(50deg, 90%, 60%);
--example-bg: var(--borderedblock-bg);
--example-text: var(--text);
--exampleheading-text: hsl(50deg, 70%, 70%);
--note-border: hsl(120deg, 100%, 35%);
--note-bg: var(--borderedblock-bg);
--note-text: var(--text);
--noteheading-text: hsl(120, 70%, 70%);
--notesummary-underline: silver;
--assertion-border: #444;
--assertion-bg: var(--borderedblock-bg);
--assertion-text: var(--text);
--advisement-border: orange;
--advisement-bg: #222218;
--advisement-text: var(--text);
--advisementheading-text: #f84;
--warning-border: red;
--warning-bg: hsla(40,100%,20%,0.95);
--warning-text: var(--text);
--amendment-border: #330099;
--amendment-bg: #080010;
--amendment-text: var(--text);
--amendmentheading-text: #cc00ff;
--def-border: #8ccbf2;
--def-bg: #080818;
--def-text: var(--text);
--defrow-border: #136;
--datacell-border: silver;
--indexinfo-text: #aaa;
--indextable-hover-text: var(--text);
--indextable-hover-bg: #181818;
--outdatedspec-bg: rgba(255, 255, 255, .5);
--outdatedspec-text: black;
--outdated-bg: maroon;
--outdated-text: white;
--outdated-shadow: red;
--editedrec-bg: darkorange;
}
/* In case a transparent-bg image doesn't expect to be on a dark bg,
which is quite common in practice... */
img { background: white; }
}
@media (prefers-color-scheme: dark) {
:root {
--selflink-text: black;
--selflink-bg: silver;
--selflink-hover-text: white;
}
}
@media (prefers-color-scheme: dark) {
:root {
--dfnpanel-bg: #222;
--dfnpanel-text: var(--text);
}
}
@media (prefers-color-scheme: dark) {
.highlight:not(.idl) { background: rgba(255, 255, 255, .05); }
c-[a] { color: #d33682 } /* Keyword.Declaration */
c-[b] { color: #d33682 } /* Keyword.Type */
c-[c] { color: #2aa198 } /* Comment */
c-[d] { color: #2aa198 } /* Comment.Multiline */
c-[e] { color: #268bd2 } /* Name.Attribute */
c-[f] { color: #b58900 } /* Name.Tag */
c-[g] { color: #cb4b16 } /* Name.Variable */
c-[k] { color: #d33682 } /* Keyword */
c-[l] { color: #657b83 } /* Literal */
c-[m] { color: #657b83 } /* Literal.Number */
c-[n] { color: #268bd2 } /* Name */
c-[o] { color: #657b83 } /* Operator */
c-[p] { color: #657b83 } /* Punctuation */
c-[s] { color: #6c71c4 } /* Literal.String */
c-[t] { color: #6c71c4 } /* Literal.String.Single */
c-[u] { color: #6c71c4 } /* Literal.String.Double */
c-[ch] { color: #2aa198 } /* Comment.Hashbang */
c-[cp] { color: #2aa198 } /* Comment.Preproc */
c-[cpf] { color: #2aa198 } /* Comment.PreprocFile */
c-[c1] { color: #2aa198 } /* Comment.Single */
c-[cs] { color: #2aa198 } /* Comment.Special */
c-[kc] { color: #d33682 } /* Keyword.Constant */
c-[kn] { color: #d33682 } /* Keyword.Namespace */
c-[kp] { color: #d33682 } /* Keyword.Pseudo */
c-[kr] { color: #d33682 } /* Keyword.Reserved */
c-[ld] { color: #657b83 } /* Literal.Date */
c-[nc] { color: #268bd2 } /* Name.Class */
c-[no] { color: #268bd2 } /* Name.Constant */
c-[nd] { color: #268bd2 } /* Name.Decorator */
c-[ni] { color: #268bd2 } /* Name.Entity */
c-[ne] { color: #268bd2 } /* Name.Exception */
c-[nf] { color: #268bd2 } /* Name.Function */
c-[nl] { color: #268bd2 } /* Name.Label */
c-[nn] { color: #268bd2 } /* Name.Namespace */
c-[py] { color: #268bd2 } /* Name.Property */
c-[ow] { color: #657b83 } /* Operator.Word */
c-[mb] { color: #657b83 } /* Literal.Number.Bin */
c-[mf] { color: #657b83 } /* Literal.Number.Float */
c-[mh] { color: #657b83 } /* Literal.Number.Hex */
c-[mi] { color: #657b83 } /* Literal.Number.Integer */
c-[mo] { color: #657b83 } /* Literal.Number.Oct */
c-[sa] { color: #6c71c4 } /* Literal.String.Affix */
c-[sb] { color: #6c71c4 } /* Literal.String.Backtick */
c-[sc] { color: #6c71c4 } /* Literal.String.Char */
c-[dl] { color: #6c71c4 } /* Literal.String.Delimiter */
c-[sd] { color: #6c71c4 } /* Literal.String.Doc */
c-[se] { color: #6c71c4 } /* Literal.String.Escape */
c-[sh] { color: #6c71c4 } /* Literal.String.Heredoc */
c-[si] { color: #6c71c4 } /* Literal.String.Interpol */
c-[sx] { color: #6c71c4 } /* Literal.String.Other */
c-[sr] { color: #6c71c4 } /* Literal.String.Regex */
c-[ss] { color: #6c71c4 } /* Literal.String.Symbol */
c-[fm] { color: #268bd2 } /* Name.Function.Magic */
c-[vc] { color: #cb4b16 } /* Name.Variable.Class */
c-[vg] { color: #cb4b16 } /* Name.Variable.Global */
c-[vi] { color: #cb4b16 } /* Name.Variable.Instance */
c-[vm] { color: #cb4b16 } /* Name.Variable.Magic */
c-[il] { color: #657b83 } /* Literal.Number.Integer.Long */
}
</style>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">WebTransport</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2020-11-11">11 November 2020</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://github.com/w3c/webtransport">https://github.com/w3c/webtransport</a>
<dt>Issue Tracking:
<dd><a href="https://github.com/wicg/web-transport/issues/">GitHub</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><span class="p-name fn">Bernard Aboba</span> (<span class="p-org org">Microsoft Corporation</span>)
<dd class="editor p-author h-card vcard"><span class="p-name fn">Victor Vasiliev</span> (<span class="p-org org">Google</span>)
<dd class="editor p-author h-card vcard"><span class="p-name fn">Yutaka Hirano</span> (<span class="p-org org">Google</span>)
<dt class="editor">Former Editors:
<dd class="editor p-author h-card vcard"><span class="p-name fn">Peter Thatcher</span> (<span class="p-org org">Google</span>)
<dd class="editor p-author h-card vcard"><span class="p-name fn">Robin Raymond</span> (<span class="p-org org">Optical Tone Ltd.</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2020 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document" rel="license">permissive document license</a> rules apply. </p>
<hr title="Separator for header">
</div>
<div class="p-summary" data-fill-with="abstract">
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<p>This document defines a set of ECMAScript APIs in WebIDL to allow data to be
sent and received between a browser and server, implementing pluggable
protocols underneath with common APIs on top. APIs specific to QUIC are also
provided. This specification is being developed in conjunction with a
protocol specification developed by the IETF QUIC Working Group.</p>
</div>
<h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p></p>
</div>
<div data-fill-with="at-risk"></div>
<nav data-fill-with="table-of-contents" id="toc">
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<ol class="toc" role="directory">
<li><a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
<li><a href="#conformance"><span class="secno">2</span> <span class="content">Conformance</span></a>
<li><a href="#terminology"><span class="secno">3</span> <span class="content">Terminology</span></a>
<li>
<a href="#unidirectional-streams-transport"><span class="secno">4</span> <span class="content"><code>UnidirectionalStreamsTransport</code> Mixin</span></a>
<ol class="toc">
<li><a href="##unidirectional-streams-transport-methods"><span class="secno">4.1</span> <span class="content">Methods</span></a>
<li>
<a href="##unidirectional-streams-transport-procedures"><span class="secno">4.2</span> <span class="content">Procedures</span></a>
<ol class="toc">
<li><a href="#add-sendstream"><span class="secno">4.2.1</span> <span class="content">Add SendStream to UnidirectionalStreamsTransport</span></a>
</ol>
<li><a href="#send-stream-parameters"><span class="secno">4.3</span> <span class="content">SendStreamParameters Dictionary</span></a>
</ol>
<li>
<a href="#bidirectional-streams-transport"><span class="secno">5</span> <span class="content"><code>BidirectionalStreamsTransport</code> Mixin</span></a>
<ol class="toc">
<li><a href="##bidirectional-streams-transport-methods"><span class="secno">5.1</span> <span class="content">Methods</span></a>
<li>
<a href="##bidirectional-streams-transport-procedures"><span class="secno">5.2</span> <span class="content">Procedures</span></a>
<ol class="toc">
<li><a href="#add-bidirectionalstream"><span class="secno">5.2.1</span> <span class="content">Add BidirectionalStream to BidirectionalStreamsTransport</span></a>
</ol>
</ol>
<li>
<a href="#datagram-transport"><span class="secno">6</span> <span class="content"><code>DatagramTransport</code> Mixin</span></a>
<ol class="toc">
<li><a href="#datagram-transport-attributes"><span class="secno">6.1</span> <span class="content">Attributes</span></a>
</ol>
<li>
<a href="#web-transport"><span class="secno">7</span> <span class="content"><code>WebTransport</code> Interface</span></a>
<ol class="toc">
<li><a href="#webtransport-constructor"><span class="secno">7.1</span> <span class="content">Constructor</span></a>
<li><a href="#webtransport-attributes"><span class="secno">7.2</span> <span class="content">Attributes</span></a>
<li><a href="#webtransport-methods"><span class="secno">7.3</span> <span class="content">Methods</span></a>
<li><a href="#web-transport-configuration"><span class="secno">7.4</span> <span class="content">Configuration</span></a>
<li><a href="#web-transport-state-enum"><span class="secno">7.5</span> <span class="content"><code>WebTransportState</code> Enum</span></a>
<li><a href="#web-transport-close-info"><span class="secno">7.6</span> <span class="content"><code>WebTransportCloseInfo</code> Dictionary</span></a>
<li><a href="#web-transport-stats"><span class="secno">7.7</span> <span class="content"><code>WebTransportStats</code> Dictionary</span></a>
</ol>
<li>
<a href="#outgoing-stream"><span class="secno">8</span> <span class="content">Interface Mixin <code>OutgoingStream</code></span></a>
<ol class="toc">
<li><a href="#outgoing-stream-overview"><span class="secno">8.1</span> <span class="content">Overview</span></a>
<li><a href="#outgoing-stream-attributes"><span class="secno">8.2</span> <span class="content">Attributes</span></a>
<li><a href="#outgoing-stream-methods"><span class="secno">8.3</span> <span class="content">Methods</span></a>
<li><a href="#stream-abort-info"><span class="secno">8.4</span> <span class="content"><code>StreamAbortInfo</code> Dictionary</span></a>
</ol>
<li>
<a href="#incoming-stream"><span class="secno">9</span> <span class="content">Interface Mixin <code>IncomingStream</code></span></a>
<ol class="toc">
<li><a href="#incoming-stream-overview"><span class="secno">9.1</span> <span class="content">Overview</span></a>
<li><a href="#incoming-stream-attributes"><span class="secno">9.2</span> <span class="content">Attributes</span></a>
<li><a href="#incoming-stream-methods"><span class="secno">9.3</span> <span class="content">Methods</span></a>
</ol>
<li><a href="#bidirectional-stream"><span class="secno">10</span> <span class="content">Interface <code>BidirectionalStream</code></span></a>
<li><a href="#send-stream"><span class="secno">11</span> <span class="content">Interface <code>SendStream</code></span></a>
<li><a href="#receive-stream"><span class="secno">12</span> <span class="content">Interface <code>ReceiveStream</code></span></a>
<li>
<a href="#privacy-security"><span class="secno">13</span> <span class="content">Privacy and Security Considerations</span></a>
<ol class="toc">
<li><a href="#confidentiality"><span class="secno">13.1</span> <span class="content">Confidentiality of Communications</span></a>
<li><a href="#state-persistence"><span class="secno">13.2</span> <span class="content">State Persistence</span></a>
<li><a href="#protocol-security"><span class="secno">13.3</span> <span class="content">Protocol Security</span></a>
</ol>
<li>
<a href="#examples"><span class="secno">14</span> <span class="content">Examples</span></a>
<ol class="toc">
<li><a href="#example-datagrams"><span class="secno">14.1</span> <span class="content">Sending a buffer of datagrams</span></a>
<li><a href="#example-fixed-rate"><span class="secno">14.2</span> <span class="content">Sending datagrams at a fixed rate</span></a>
<li><a href="#example-receiving-datagrams"><span class="secno">14.3</span> <span class="content">Receiving datagrams</span></a>
<li><a href="#example-receiving-from-receivestream"><span class="secno">14.4</span> <span class="content">Receiving from ReceiveStream</span></a>
<li><a href="#example-complete"><span class="secno">14.5</span> <span class="content">Complete example</span></a>
</ol>
<li><a href="#acknowledgements"><span class="secno">15</span> <span class="content">Acknowledgements</span></a>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ol class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ol>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ol class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ol>
<li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
<p><em>This section is non-normative.</em></p>
<p>This specification uses pluggable protocols, with QUIC <a data-link-type="biblio" href="#biblio-quic-transport">[QUIC-TRANSPORT]</a> as
one such protocol, to send data to and receive data from servers. It can be
used like WebSockets but with support for multiple streams, unidirectional
streams, out-of-order delivery, and reliable as well as unreliable transport.</p>
<p class="note" role="note"><span>Note:</span> The API presented in this specification represents a preliminary proposal
based on work-in-progress within the IETF QUIC WG. Since the QUIC transport
specification is a work-in-progress, both the protocol and API are likely to
change significantly going forward.</p>
<h2 class="heading settled" data-level="2" id="conformance"><span class="secno">2. </span><span class="content">Conformance</span><a class="self-link" href="#conformance"></a></h2>
<p>As well as sections marked as non-normative, all authoring guidelines,
diagrams, examples, and notes in this specification are non-normative.
Everything else in this specification is normative.</p>
<p>The key words <em>MUST</em> and <em>SHOULD</em> are to be interpreted as described in <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a>.</p>
<p>This specification defines conformance criteria that apply to a single product:
the user agent that implements the interfaces that it contains.</p>
<p>Conformance requirements phrased as algorithms or specific steps may be
implemented in any manner, so long as the end result is equivalent. (In
particular, the algorithms defined in this specification are intended to be
easy to follow, and not intended to be performant.)</p>
<p>Implementations that use ECMAScript to implement the APIs defined in this
specification MUST implement them in a manner consistent with the ECMAScript
Bindings defined in the Web IDL specification <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a>, as this
specification uses that specification and terminology.</p>
<h2 class="heading settled" data-level="3" id="terminology"><span class="secno">3. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2>
<p>The <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler">EventHandler</a></code> interface, representing a callback used for event
handlers, and the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#errorevent" id="ref-for-errorevent">ErrorEvent</a></code> interface are defined in <a data-link-type="biblio" href="#biblio-html">[HTML]</a>.</p>
<p>The concepts <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">queue a task</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source" id="ref-for-networking-task-source">networking task source</a> are defined in <a data-link-type="biblio" href="#biblio-html">[HTML]</a>.</p>
<p>The terms <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event" id="ref-for-concept-event">event</a>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers">event handlers</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type">event handler event types</a> are
defined in <a data-link-type="biblio" href="#biblio-html">[HTML]</a>.</p>
<p>When referring to exceptions, the terms <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw">throw</a> and <a data-link-type="dfn" href="https://streams.spec.whatwg.org/#readablestream-create" id="ref-for-readablestream-create">create</a> are defined in <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a>.</p>
<p>The terms <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects">fulfilled</a>, <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①">rejected</a>, <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects②">resolved</a>, <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects③">pending</a> and <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects④">settled</a> used in the context of Promises are defined in <a data-link-type="biblio" href="#biblio-ecmascript-60">[ECMASCRIPT-6.0]</a>.</p>
<p>The terms <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream">ReadableStream</a></code> and <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#writablestream" id="ref-for-writablestream">WritableStream</a></code> are defined in <a data-link-type="biblio" href="#biblio-whatwg-streams">[WHATWG-STREAMS]</a>. Note that despite sharing the name "stream", these are
distinct from the IncomingStream, OutgoingStream, and BidirectionalStream
defined here. The IncomingStream, OutgoingStream, and BidirectionalStream
defined here correspend to a higher level of abstraction that contain and
depend on the lower-level concepts of "streams" defined in <a data-link-type="biblio" href="#biblio-whatwg-streams">[WHATWG-STREAMS]</a>.</p>
<h2 class="heading settled" data-level="4" id="unidirectional-streams-transport"><span class="secno">4. </span><span class="content"><code>UnidirectionalStreamsTransport</code> Mixin</span><a class="self-link" href="#unidirectional-streams-transport"></a></h2>
<p>A <code class="idl"><a data-link-type="idl" href="#unidirectionalstreamstransport" id="ref-for-unidirectionalstreamstransport">UnidirectionalStreamsTransport</a></code> can send and receive unidirectional
streams. Data within a stream is delivered in order, but data between streams
may be delivered out of order. Data is generally sent reliably, but
retransmissions may be disabled or the stream may aborted to produce a form of
unreliability. All stream data is encrypted and congestion-controlled.</p>
<pre class="idl highlight def"><c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="unidirectionalstreamstransport"><code><c- g>UnidirectionalStreamsTransport</c-></code></dfn> {
<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise"><c- b>Promise</c-></a><<a data-link-type="idl-name" href="#sendstream" id="ref-for-sendstream"><c- n>SendStream</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-unidirectionalstreamstransport-createunidirectionalstream" id="ref-for-dom-unidirectionalstreamstransport-createunidirectionalstream"><c- g>createUnidirectionalStream</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-sendstreamparameters" id="ref-for-dictdef-sendstreamparameters"><c- n>SendStreamParameters</c-></a> <dfn class="idl-code" data-dfn-for="UnidirectionalStreamsTransport/createUnidirectionalStream(parameters), UnidirectionalStreamsTransport/createUnidirectionalStream()" data-dfn-type="argument" data-export id="dom-unidirectionalstreamstransport-createunidirectionalstream-parameters-parameters"><code><c- g>parameters</c-></code><a class="self-link" href="#dom-unidirectionalstreamstransport-createunidirectionalstream-parameters-parameters"></a></dfn> = {});
/* a ReadableStream of ReceiveStream objects */
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream①"><c- n>ReadableStream</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ReadableStream" href="#dom-unidirectionalstreamstransport-incomingunidirectionalstreams" id="ref-for-dom-unidirectionalstreamstransport-incomingunidirectionalstreams"><c- g>incomingUnidirectionalStreams</c-></a>;
};
</pre>
<h3 class="heading settled" data-level="4.1" id="#unidirectional-streams-transport-methods"><span class="secno">4.1. </span><span class="content">Methods</span><a class="self-link" href="#%23unidirectional-streams-transport-methods"></a></h3>
<dl>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="UnidirectionalStreamsTransport" data-dfn-type="method" data-export data-lt="createUnidirectionalStream(parameters)|createUnidirectionalStream()" id="dom-unidirectionalstreamstransport-createunidirectionalstream"><code>createUnidirectionalStream()</code></dfn>
<dd data-md>
<p>Creates a <code class="idl"><a data-link-type="idl" href="#sendstream" id="ref-for-sendstream①">SendStream</a></code> object for an outgoing unidirectional stream. Note
that in some transports, the mere creation of a stream is not immediately
visible to the peer until it is used to send data.</p>
<p>When <code>createUnidirectionalStream()</code> method is called, the user agent MUST
run the following steps:</p>
<ol>
<li data-md>
<p>Let <var>transport</var> be the <code>UnidirectionalStreamsTransport</code> on which <code>createUnidirectionalStream</code> is invoked.</p>
<li data-md>
<p>If <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state">state</a></code> is <code>"closed"</code> or <code>"failed"</code>,
immediately return a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects⑤">rejected</a> promise with a newly created <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code> and abort these steps.</p>
<li data-md>
<p>Let <var>p</var> be a new promise.</p>
<li data-md>
<p>Return <var>p</var> and continue the following steps in background.</p>
<li data-md>
<p><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects⑥">Resolve</a> <var>p</var> with a newly created <code class="idl"><a data-link-type="idl" href="#sendstream" id="ref-for-sendstream②">SendStream</a></code> object and <a data-link-type="dfn" href="#add-the-sendstream" id="ref-for-add-the-sendstream">add the
SendStream</a> to <var>transport</var> when all of the following conditions are met:</p>
<ol>
<li data-md>
<p>The <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state①">state</a></code> has transitioned to <code>"connected"</code>.</p>
<li data-md>
<p>Stream creation flow control is not being violated by exceeding the
max stream limit set by the remote endpoint. For QUIC, this is
specified in <a data-link-type="biblio" href="#biblio-quic-transport">[QUIC-TRANSPORT]</a>.</p>
<li data-md>
<p><var>p</var> has not been <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects⑦">settled</a>.</p>
</ol>
<li data-md>
<p><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects⑧">Reject</a> <var>p</var> with a newly created <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code> when all of
the following conditions are met:</p>
<ol>
<li data-md>
<p>The <var>transport</var>’s state transitions to <code>"closed"</code> or <code>"failed"</code>.</p>
<li data-md>
<p><var>p</var> has not been <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects⑨">settled</a>.</p>
</ol>
</ol>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="UnidirectionalStreamsTransport" data-dfn-type="attribute" data-export id="dom-unidirectionalstreamstransport-incomingunidirectionalstreams"><code>incomingUnidirectionalStreams</code></dfn>, <span> of type <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream②">ReadableStream</a>, readonly</span>
<dd data-md>
<p>A <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream③">ReadableStream</a></code> of unidirectional streams, each represented by a <code class="idl"><a data-link-type="idl" href="#receivestream" id="ref-for-receivestream">ReceiveStream</a></code> object, that have been received from the remote host.</p>
<p>The getter steps for <code>incomingUnidirectionalStreams</code> are:</p>
<ol>
<li data-md>
<p>Let <var>transport</var> be the <code>UnidirectionalStreamsTransport</code> on which
the <code>incomingUnidirectionalStreams</code> getter is invoked.</p>
<li data-md>
<p>Return the value of the <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receivedstreams-slot" id="ref-for-dom-webtransport-receivedstreams-slot">[[ReceivedStreams]]</a></code> internal slot.</p>
<li data-md>
<p>For each unidirectional stream received, create a corresponding <code class="idl"><a data-link-type="idl" href="#receivestream" id="ref-for-receivestream①">ReceiveStream</a></code> and insert it into <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receivedstreams-slot" id="ref-for-dom-webtransport-receivedstreams-slot①">[[ReceivedStreams]]</a></code>. As data
is received over the unidirectional stream, insert that data into the
corresponding <code>ReceiveStream</code> object. When the remote side closes or
aborts the stream, close or abort the corresponding <code>ReceiveStream</code>.</p>
</ol>
</dl>
<h3 class="heading settled" data-level="4.2" id="#unidirectional-streams-transport-procedures"><span class="secno">4.2. </span><span class="content">Procedures</span><a class="self-link" href="#%23unidirectional-streams-transport-procedures"></a></h3>
<h4 class="heading settled" data-level="4.2.1" id="add-sendstream"><span class="secno">4.2.1. </span><span class="content">Add SendStream to UnidirectionalStreamsTransport</span><a class="self-link" href="#add-sendstream"></a></h4>
<div class="algorithm" data-algorithm="add the SendStream">
<p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="add-the-sendstream">add the SendStream</dfn> to a <code class="idl"><a data-link-type="idl" href="#unidirectionalstreamstransport" id="ref-for-unidirectionalstreamstransport①">UnidirectionalStreamsTransport</a></code>, run
the following steps:</p>
<ol>
<li data-md>
<p>Let <var>transport</var> be the <code class="idl"><a data-link-type="idl" href="#unidirectionalstreamstransport" id="ref-for-unidirectionalstreamstransport②">UnidirectionalStreamsTransport</a></code> in question.</p>
<li data-md>
<p>Let <var>stream</var> be the newly created <code class="idl"><a data-link-type="idl" href="#sendstream" id="ref-for-sendstream③">SendStream</a></code> object.</p>
<li data-md>
<p>Add <var>stream</var> to <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-outgoingstreams-slot" id="ref-for-dom-webtransport-outgoingstreams-slot">[[OutgoingStreams]]</a></code> slot.</p>
<li data-md>
<p>Continue the following steps in the background.</p>
<li data-md>
<p>Create <var>stream</var>’s associated underlying transport.</p>
</ol>
</div>
<h3 class="heading settled" data-level="4.3" id="send-stream-parameters"><span class="secno">4.3. </span><span class="content">SendStreamParameters Dictionary</span><a class="self-link" href="#send-stream-parameters"></a></h3>
<p>The <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-sendstreamparameters"><code>SendStreamParameters</code></dfn> dictionary includes information
relating to stream configuration.</p>
<pre class="idl highlight def"><c- b>dictionary</c-> <a class="idl-code" data-link-type="dictionary" href="#dictdef-sendstreamparameters" id="ref-for-dictdef-sendstreamparameters①"><c- g>SendStreamParameters</c-></a> {
};
</pre>
<h2 class="heading settled" data-level="5" id="bidirectional-streams-transport"><span class="secno">5. </span><span class="content"><code>BidirectionalStreamsTransport</code> Mixin</span><a class="self-link" href="#bidirectional-streams-transport"></a></h2>
<p>A <code class="idl"><a data-link-type="idl" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport">BidirectionalStreamsTransport</a></code> can send and receive bidirectional streams.
Data within a stream is delivered in order, but data between streams may be
delivered out of order. Data is generally sent reliably, but retransmissions
may be disabled or the stream may aborted to produce a form of unreliability.
All stream data is encrypted and congestion-controlled.</p>
<pre class="idl highlight def"><c- b>interface</c-> <c- b>mixin</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="bidirectionalstreamstransport"><code><c- g>BidirectionalStreamsTransport</c-></code></dfn> {
<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise①"><c- b>Promise</c-></a><<a data-link-type="idl-name" href="#bidirectionalstream" id="ref-for-bidirectionalstream"><c- n>BidirectionalStream</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-bidirectionalstreamstransport-createbidirectionalstream" id="ref-for-dom-bidirectionalstreamstransport-createbidirectionalstream"><c- g>createBidirectionalStream</c-></a>();
/* a ReadableStream of BidirectionalStream objects */
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream④"><c- n>ReadableStream</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ReadableStream" href="#dom-bidirectionalstreamstransport-incomingbidirectionalstreams" id="ref-for-dom-bidirectionalstreamstransport-incomingbidirectionalstreams"><c- g>incomingBidirectionalStreams</c-></a>;
};
</pre>
<h3 class="heading settled" data-level="5.1" id="#bidirectional-streams-transport-methods"><span class="secno">5.1. </span><span class="content">Methods</span><a class="self-link" href="#%23bidirectional-streams-transport-methods"></a></h3>
<dl>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="BidirectionalStreamsTransport" data-dfn-type="method" data-export id="dom-bidirectionalstreamstransport-createbidirectionalstream"><code>createBidirectionalStream()</code></dfn>
<dd data-md>
<p>Creates a <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream①">BidirectionalStream</a></code> object for an outgoing bidirectional
stream. Note that in some transports, the mere creation of a stream is not
immediately visible to the peer until it is used to send data.</p>
<p>When <code>createBidirectionalStream</code> is called, the user agent MUST run the
following steps:</p>
<ol>
<li data-md>
<p>Let <var>transport</var> be the <code class="idl"><a data-link-type="idl" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport①">BidirectionalStreamsTransport</a></code> on which <code class="idl"><a data-link-type="idl" href="#dom-bidirectionalstreamstransport-createbidirectionalstream" id="ref-for-dom-bidirectionalstreamstransport-createbidirectionalstream①">createBidirectionalStream</a></code> is invoked.</p>
<li data-md>
<p>If <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state②">state</a></code> is <code>"closed"</code> or <code>"failed"</code>,
immediately return a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①⓪">rejected</a> promise with a newly created <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror②">InvalidStateError</a></code> and abort these steps.</p>
<li data-md>
<p>If <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state③">state</a></code> is <code>"connected"</code>, immediately
return a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①①">fulfilled</a> promise with a newly created <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream②">BidirectionalStream</a></code> object, <a data-link-type="dfn" href="#add-the-bidirectionalstream" id="ref-for-add-the-bidirectionalstream">add the BidirectionalStream</a> to the
transport and abort these steps.</p>
<li data-md>
<p>Let <var>p</var> be a new promise.</p>
<li data-md>
<p>Return <var>p</var> and continue the following steps in background.</p>
<li data-md>
<p><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①②">Resolve</a> <var>p</var> with a newly created <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream③">BidirectionalStream</a></code> object and <a data-link-type="dfn" href="#add-the-bidirectionalstream" id="ref-for-add-the-bidirectionalstream①">add the BidirectionalStream</a> to <var>transport</var> when all of the following
conditions are met:</p>
<ol>
<li data-md>
<p>The <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state④">state</a></code> has transitioned to <code>"connected"</code>.</p>
<li data-md>
<p>Stream creation flow control is not being violated by exceeding the
max stream limit set by the remote endpoint. For QUIC, this is
specified in <a data-link-type="biblio" href="#biblio-quic-transport">[QUIC-TRANSPORT]</a>.</p>
<li data-md>
<p><var>p</var> has not been <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①③">settled</a>.</p>
</ol>
<li data-md>
<p><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①④">Reject</a> <var>p</var> with a newly created <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror③">InvalidStateError</a></code> when all of
the following conditions are met:</p>
<ol>
<li data-md>
<p>The <var>transport</var>’s state transitions to <code>"closed"</code> or <code>"failed"</code>.</p>
<li data-md>
<p><var>p</var> has not been <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise-objects" id="ref-for-sec-promise-objects①⑤">settled</a>.</p>
</ol>
</ol>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="BidirectionalStreamsTransport" data-dfn-type="attribute" data-export id="dom-bidirectionalstreamstransport-incomingbidirectionalstreams"><code>incomingBidirectionalStreams</code></dfn>, <span> of type <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream⑤">ReadableStream</a>, readonly</span>
<dd data-md>
<p>Returns a <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream⑥">ReadableStream</a></code> of <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream④">BidirectionalStream</a></code>s that have been
received from the remote host.</p>
<p>The getter steps for the <code>incomingBidirectionalStreams</code> attribute SHALL be:</p>
<ol>
<li data-md>
<p>Return the value of the <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receivedbidirectionalstreams-slot" id="ref-for-dom-webtransport-receivedbidirectionalstreams-slot">[[ReceivedBidirectionalStreams]]</a></code> internal slot.</p>
<li data-md>
<p>For each bidirectional stream received, create a corresponding <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream⑤">BidirectionalStream</a></code> and insert it into <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receivedbidirectionalstreams-slot" id="ref-for-dom-webtransport-receivedbidirectionalstreams-slot①">[[ReceivedBidirectionalStreams]]</a></code>.
As data is received over the bidirectional stream, insert that data into the
corresponding <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream⑥">BidirectionalStream</a></code>. When the remote side closes or aborts
the stream, close or abort the corresponding <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream⑦">BidirectionalStream</a></code>.</p>
</ol>
</dl>
<h3 class="heading settled" data-level="5.2" id="#bidirectional-streams-transport-procedures"><span class="secno">5.2. </span><span class="content">Procedures</span><a class="self-link" href="#%23bidirectional-streams-transport-procedures"></a></h3>
<h4 class="heading settled" data-level="5.2.1" id="add-bidirectionalstream"><span class="secno">5.2.1. </span><span class="content">Add BidirectionalStream to BidirectionalStreamsTransport</span><a class="self-link" href="#add-bidirectionalstream"></a></h4>
<div class="algorithm" data-algorithm="add the BidirectionalStream">
<p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="add-the-bidirectionalstream">add the BidirectionalStream</dfn> to a <code class="idl"><a data-link-type="idl" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport②">BidirectionalStreamsTransport</a></code>, run the following steps:</p>
<ol>
<li data-md>
<p>Let <var>transport</var> be the <code class="idl"><a data-link-type="idl" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport③">BidirectionalStreamsTransport</a></code> in question.</p>
<li data-md>
<p>Let <var>stream</var> be the newly created <code class="idl"><a data-link-type="idl" href="#bidirectionalstream" id="ref-for-bidirectionalstream⑧">BidirectionalStream</a></code> object.</p>
<li data-md>
<p>Add <var>stream</var> to <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receivedbidirectionalstreams-slot" id="ref-for-dom-webtransport-receivedbidirectionalstreams-slot②">[[ReceivedBidirectionalStreams]]</a></code> slot.</p>
<li data-md>
<p>Add <var>stream</var> to <var>transport</var>’s <code class="idl"><a data-link-type="idl" href="#dom-webtransport-outgoingstreams-slot" id="ref-for-dom-webtransport-outgoingstreams-slot①">[[OutgoingStreams]]</a></code> slot.</p>
<li data-md>
<p>Continue the following steps in the background.</p>
<li data-md>
<p>Create <var>stream</var>’s associated underlying transport.</p>
</ol>
</div>
<h2 class="heading settled" data-level="6" id="datagram-transport"><span class="secno">6. </span><span class="content"><code>DatagramTransport</code> Mixin</span><a class="self-link" href="#datagram-transport"></a></h2>
<p>A <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="datagramtransport"><code>DatagramTransport</code></dfn> can send and receive datagrams,
as defined in <a data-link-type="biblio" href="#biblio-quic-datagram">[QUIC-DATAGRAM]</a>.
Datagrams are sent out of order, unreliably, and have a limited maximum size.
Datagrams are encrypted and congestion controlled.</p>
<pre class="idl highlight def"><c- b>interface</c-> <c- b>mixin</c-> <a class="idl-code" data-link-type="interface" href="#datagramtransport" id="ref-for-datagramtransport"><c- g>DatagramTransport</c-></a> {
<c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short"><c- b>unsigned</c-> <c- b>short</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned short" href="#dom-datagramtransport-maxdatagramsize" id="ref-for-dom-datagramtransport-maxdatagramsize"><c- g>maxDatagramSize</c-></a>;
/* both streams are streams of Uint8Array objects */
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream⑦"><c- n>ReadableStream</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ReadableStream" href="#dom-datagramtransport-datagramreadable" id="ref-for-dom-datagramtransport-datagramreadable"><c- g>datagramReadable</c-></a>;
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#writablestream" id="ref-for-writablestream①"><c- n>WritableStream</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="WritableStream" href="#dom-datagramtransport-datagramwritable" id="ref-for-dom-datagramtransport-datagramwritable"><c- g>datagramWritable</c-></a>;
};
</pre>
<h3 class="heading settled" data-level="6.1" id="datagram-transport-attributes"><span class="secno">6.1. </span><span class="content">Attributes</span><a class="self-link" href="#datagram-transport-attributes"></a></h3>
<dl>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="DatagramTransport" data-dfn-type="attribute" data-export id="dom-datagramtransport-maxdatagramsize"><code>maxDatagramSize</code></dfn>, <span> of type <a data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-unsigned-short" id="ref-for-idl-unsigned-short①">unsigned short</a>, readonly</span>
<dd data-md>
<p>The maximum size data that may be passed to <code class="idl"><a data-link-type="idl" href="#dom-datagramtransport-datagramwritable" id="ref-for-dom-datagramtransport-datagramwritable①">datagramWritable</a></code>.</p>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="DatagramTransport" data-dfn-type="attribute" data-export id="dom-datagramtransport-datagramwritable"><code>datagramWritable</code></dfn>, <span> of type <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#writablestream" id="ref-for-writablestream②">WritableStream</a>, readonly</span>
<dd data-md>
<p>Sends datagrams that are written to the returned <code class="idl"><a data-link-type="idl" href="https://streams.spec.whatwg.org/#writablestream" id="ref-for-writablestream③">WritableStream</a></code>.</p>
<p>The getter steps for the <code>datagramWritable</code> attribute SHALL be:</p>
<ol>
<li data-md>
<p>Return the value of the <code class="idl"><a data-link-type="idl" href="#dom-webtransport-sentdatagrams-slot" id="ref-for-dom-webtransport-sentdatagrams-slot">[[SentDatagrams]]</a></code> internal slot.</p>
</ol>
<dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="DatagramTransport" data-dfn-type="attribute" data-export id="dom-datagramtransport-datagramreadable"><code>datagramReadable</code></dfn>, <span> of type <a data-link-type="idl-name" href="https://streams.spec.whatwg.org/#readablestream" id="ref-for-readablestream⑧">ReadableStream</a>, readonly</span>
<dd data-md>
<p>Return the value of the <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receiveddatagrams-slot" id="ref-for-dom-webtransport-receiveddatagrams-slot">[[ReceivedDatagrams]]</a></code> internal slot.</p>
<p>For each datagram received, insert it into <code class="idl"><a data-link-type="idl" href="#dom-webtransport-receiveddatagrams-slot" id="ref-for-dom-webtransport-receiveddatagrams-slot①">[[ReceivedDatagrams]]</a></code>. If too
many datagrams are queued because the stream is not being read quickly
enough, drop datagrams to avoid queueing. Implementations should drop older
datagrams in favor of newer datagrams. The number of datagrams to queue
should be kept small enough to avoid adding significant latency to packet
delivery when the stream is being read slowly (due to the reader being slow)
but large enough to avoid dropping packets when for the stream is not read
for short periods of time (due to the reader being paused).</p>
</dl>
<h2 class="heading settled" data-level="7" id="web-transport"><span class="secno">7. </span><span class="content"><code>WebTransport</code> Interface</span><a class="self-link" href="#web-transport"></a></h2>
<p><code>WebTransport</code> provides a unified interface to all client-server transports
that are supported by the WebTransport API. It implements all of the transport
mixins (<code class="idl"><a data-link-type="idl" href="#unidirectionalstreamstransport" id="ref-for-unidirectionalstreamstransport③">UnidirectionalStreamsTransport</a></code>, <code class="idl"><a data-link-type="idl" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport④">BidirectionalStreamsTransport</a></code>, <code class="idl"><a data-link-type="idl" href="#datagramtransport" id="ref-for-datagramtransport①">DatagramTransport</a></code>), as well as stats and transport state information.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="webtransport"><code><c- g>WebTransport</c-></code></dfn> {
<dfn class="dfn-paneled idl-code" data-dfn-for="WebTransport" data-dfn-type="constructor" data-export data-lt="WebTransport(url, options)|constructor(url, options)|WebTransport(url)|constructor(url)" id="dom-webtransport-webtransport"><code><c- g>constructor</c-></code></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="WebTransport/WebTransport(url, options), WebTransport/constructor(url, options), WebTransport/WebTransport(url), WebTransport/constructor(url)" data-dfn-type="argument" data-export id="dom-webtransport-webtransport-url-options-url"><code><c- g>url</c-></code></dfn>, <c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-webtransportoptions" id="ref-for-dictdef-webtransportoptions"><c- n>WebTransportOptions</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="WebTransport/WebTransport(url, options), WebTransport/constructor(url, options), WebTransport/WebTransport(url), WebTransport/constructor(url)" data-dfn-type="argument" data-export id="dom-webtransport-webtransport-url-options-options"><code><c- g>options</c-></code></dfn> = {});
<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise②"><c- b>Promise</c-></a><<a data-link-type="idl-name" href="#dictdef-webtransportstats" id="ref-for-dictdef-webtransportstats"><c- n>WebTransportStats</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-webtransport-getstats" id="ref-for-dom-webtransport-getstats"><c- g>getStats</c-></a>();
<c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#enumdef-webtransportstate" id="ref-for-enumdef-webtransportstate"><c- n>WebTransportState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="WebTransportState" href="#dom-webtransport-state" id="ref-for-dom-webtransport-state⑤"><c- g>state</c-></a>;
<c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise③"><c- b>Promise</c-></a><<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-undefined" id="ref-for-idl-undefined"><c- b>undefined</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<undefined>" href="#dom-webtransport-ready" id="ref-for-dom-webtransport-ready"><c- g>ready</c-></a>;
<c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise④"><c- b>Promise</c-></a><<a data-link-type="idl-name" href="#dictdef-webtransportcloseinfo" id="ref-for-dictdef-webtransportcloseinfo"><c- n>WebTransportCloseInfo</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<WebTransportCloseInfo>" href="#dom-webtransport-closed" id="ref-for-dom-webtransport-closed"><c- g>closed</c-></a>;
<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-undefined" id="ref-for-idl-undefined①"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-webtransport-close" id="ref-for-dom-webtransport-close"><c- g>close</c-></a>(<c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-webtransportcloseinfo" id="ref-for-dictdef-webtransportcloseinfo①"><c- n>WebTransportCloseInfo</c-></a> <dfn class="idl-code" data-dfn-for="WebTransport/close(closeInfo), WebTransport/close()" data-dfn-type="argument" data-export id="dom-webtransport-close-closeinfo-closeinfo"><code><c- g>closeInfo</c-></code><a class="self-link" href="#dom-webtransport-close-closeinfo-closeinfo"></a></dfn> = {});
<c- b>attribute</c-> <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-webtransport-onstatechange" id="ref-for-dom-webtransport-onstatechange"><c- g>onstatechange</c-></a>;
};
<a data-link-type="idl-name" href="#webtransport" id="ref-for-webtransport"><c- n>WebTransport</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#unidirectionalstreamstransport" id="ref-for-unidirectionalstreamstransport④"><c- n>UnidirectionalStreamsTransport</c-></a>;
<a data-link-type="idl-name" href="#webtransport" id="ref-for-webtransport①"><c- n>WebTransport</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#bidirectionalstreamstransport" id="ref-for-bidirectionalstreamstransport⑤"><c- n>BidirectionalStreamsTransport</c-></a>;
<a data-link-type="idl-name" href="#webtransport" id="ref-for-webtransport②"><c- n>WebTransport</c-></a> <c- b>includes</c-> <a data-link-type="idl-name" href="#datagramtransport" id="ref-for-datagramtransport②"><c- n>DatagramTransport</c-></a>;
</pre>
<h3 class="heading settled" data-level="7.1" id="webtransport-constructor"><span class="secno">7.1. </span><span class="content">Constructor</span><a class="self-link" href="#webtransport-constructor"></a></h3>
<p>When the <code class="idl"><a data-link-type="idl" href="#dom-webtransport-webtransport" id="ref-for-dom-webtransport-webtransport">WebTransport()</a></code> constructor is invoked, the user
agent MUST run the following steps:</p>
<ol>
<li data-md>
<p>Let <var>parsedURL</var> be the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url" id="ref-for-concept-url">URL record</a> resulting from <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser">parsing</a> <code class="idl"><a data-link-type="idl" href="#dom-webtransport-webtransport-url-options-url" id="ref-for-dom-webtransport-webtransport-url-options-url">url</a></code>.</p>
<li data-md>
<p>If <var>parsedURL</var> is a failure, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror" id="ref-for-syntaxerror">SyntaxError</a></code> exception.</p>
<li data-md>
<p>If <var>parsedURL</var> <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme">scheme</a> is not <code>quic-transport</code> or <code>https</code>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror" id="ref-for-syntaxerror①">SyntaxError</a></code> exception.</p>
<li data-md>