-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.html
2366 lines (2255 loc) · 152 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>Clear Site Data</title>
<meta content="ED" name="w3c-status">
<link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet">
<meta content="Bikeshed version 82ce88815, updated Thu Sep 7 16:33:55 2023 -0700" name="generator">
<link href="http://www.w3.org/TR/clear-site-data/" rel="canonical">
<meta content="60cb809bb06587cd5accad4c907f3223d90dca79" name="document-revision">
<style>/* Boilerplate: 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;
}
@media (prefers-color-scheme: dark) {
:root {
--selflink-text: black;
--selflink-bg: silver;
--selflink-hover-text: white;
}
}
</style>
<style>/* Boilerplate: 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;
--unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark);
--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: #bbb;
--a-visited-text: var(--a-normal-text);
--a-visited-underline: #707070;
--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;
}
@media (prefers-color-scheme: dark) {
:root {
--text: #ddd;
--bg: black;
--unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E");
--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; }
}
</style>
<style>/* Boilerplate: 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>/* Boilerplate: style-dfn-panel */
:root {
--dfnpanel-bg: #ddd;
--dfnpanel-text: var(--text);
}
@media (prefers-color-scheme: dark) {
:root {
--dfnpanel-bg: #222;
--dfnpanel-text: var(--text);
}
}
.dfn-panel {
position: absolute;
z-index: 35;
width: 20em;
width: 300px;
height: auto;
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;
white-space: normal; /* in case it's moved into a pre */
}
.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 0 0 1em; list-style: none; }
.dfn-panel li a {
white-space: pre;
display: inline-block;
max-width: calc(300px - 1.5em - 1em);
overflow: hidden;
text-overflow: ellipsis;
}
.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[role="button"] { cursor: pointer; }
</style>
<style>/* Boilerplate: style-dfn-panel */
:root {
--dfnpanel-bg: #ddd;
--dfnpanel-text: var(--text);
}
@media (prefers-color-scheme: dark) {
:root {
--dfnpanel-bg: #222;
--dfnpanel-text: var(--text);
}
}
.dfn-panel {
position: absolute;
z-index: 35;
width: 20em;
width: 300px;
height: auto;
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;
white-space: normal; /* in case it's moved into a pre */
}
.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 0 0 1em; list-style: none; }
.dfn-panel li a {
white-space: pre;
display: inline-block;
max-width: calc(300px - 1.5em - 1em);
overflow: hidden;
text-overflow: ellipsis;
}
.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[role="button"] { cursor: pointer; }
</style>
<style>/* Boilerplate: style-issues */
a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* Boilerplate: 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>/* Boilerplate: style-mdn-anno */
:root {
--mdn-bg: #EEE;
--mdn-shadow: #999;
--mdn-nosupport-text: #ccc;
}
@media (prefers-color-scheme: dark) {
:root {
--mdn-bg: #222;
--mdn-shadow: #444;
--mdn-nosupport-text: #666;
}
}
.mdn-anno {
background: var(--mdn-bg, #EEE);
border-radius: .25em;
box-shadow: 0 0 3px var(--mdn-shadow, #999);
color: var(--text, black);
font: 1em sans-serif;
hyphens: none;
max-width: min-content;
overflow: hidden;
padding: 0.2em;
position: absolute;
right: 0.3em;
top: auto;
white-space: nowrap;
word-wrap: normal;
z-index: 8;
}
.mdn-anno.unpositioned {
display: none;
}
.mdn-anno.overlapping-main {
opacity: .2;
transition: opacity .1s;
}
.mdn-anno[open] {
opacity: 1;
z-index: 9;
min-width: 9em;
}
.mdn-anno:hover {
opacity: 1;
outline: var(--text, black) 1px solid;
}
.mdn-anno > summary {
font-weight: normal;
text-align: right;
cursor: pointer;
display: block;
}
.mdn-anno > summary > .less-than-two-engines-flag {
color: red;
padding-right: 2px;
}
.mdn-anno > summary > .all-engines-flag {
color: green;
padding-right: 2px;
}
.mdn-anno > summary > span {
color: #fff;
background-color: #000;
font-weight: normal;
font-family: zillaslab, Palatino, "Palatino Linotype", serif;
padding: 2px 3px 0px 3px;
line-height: 1.3em;
vertical-align: top;
}
.mdn-anno > .feature {
margin-top: 20px;
}
.mdn-anno > .feature:not(:first-of-type) {
border-top: 1px solid #999;
margin-top: 6px;
padding-top: 2px;
}
.mdn-anno > .feature > .less-than-two-engines-text {
color: red;
}
.mdn-anno > .feature > .all-engines-text {
color: green;
}
.mdn-anno > .feature > p {
font-size: .75em;
margin-top: 6px;
margin-bottom: 0;
}
.mdn-anno > .feature > p + p {
margin-top: 3px;
}
.mdn-anno > .feature > .support {
display: block;
font-size: 0.6em;
margin: 0;
padding: 0;
margin-top: 2px;
}
.mdn-anno > .feature > .support + div {
padding-top: 0.5em;
}
.mdn-anno > .feature > .support > hr {
display: block;
border: none;
border-top: 1px dotted #999;
padding: 3px 0px 0px 0px;
margin: 2px 3px 0px 3px;
}
.mdn-anno > .feature > .support > hr::before {
content: "";
}
.mdn-anno > .feature > .support > span {
padding: 0.2em 0;
display: block;
display: table;
}
.mdn-anno > .feature > .support > span.no {
color: var(--mdn-nosupport-text);
filter: grayscale(100%);
}
.mdn-anno > .feature > .support > span.no::before {
opacity: 0.5;
}
.mdn-anno > .feature > .support > span:first-of-type {
padding-top: 0.5em;
}
.mdn-anno > .feature > .support > span > span {
padding: 0 0.5em;
display: table-cell;
}
.mdn-anno > .feature > .support > span > span:first-child {
width: 100%;
}
.mdn-anno > .feature > .support > span > span:last-child {
width: 100%;
white-space: pre;
padding: 0;
}
.mdn-anno > .feature > .support > span::before {
content: ' ';
display: table-cell;
min-width: 1.5em;
height: 1.5em;
background: no-repeat center center;
background-size: contain;
text-align: right;
font-size: 0.75em;
font-weight: bold;
}
.mdn-anno > .feature > .support > .chrome_android::before {
background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);
}
.mdn-anno > .feature > .support > .firefox_android::before {
background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);
}
.mdn-anno > .feature > .support > .chrome::before {
background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg);
}
.mdn-anno > .feature > .support > .edge_blink::before {
background-image: url(https://resources.whatwg.org/browser-logos/edge.svg);
}
.mdn-anno > .feature > .support > .edge::before {
background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg);
}
.mdn-anno > .feature > .support > .firefox::before {
background-image: url(https://resources.whatwg.org/browser-logos/firefox.png);
}
.mdn-anno > .feature > .support > .ie::before {
background-image: url(https://resources.whatwg.org/browser-logos/ie.png);
}
.mdn-anno > .feature > .support > .safari_ios::before {
background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg);
}
.mdn-anno > .feature > .support > .nodejs::before {
background-image: url(https://nodejs.org/static/images/favicons/favicon.ico);
}
.mdn-anno > .feature > .support > .opera_android::before {
background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);
}
.mdn-anno > .feature > .support > .opera::before {
background-image: url(https://resources.whatwg.org/browser-logos/opera.svg);
}
.mdn-anno > .feature > .support > .safari::before {
background-image: url(https://resources.whatwg.org/browser-logos/safari.png);
}
.mdn-anno > .feature > .support > .samsunginternet_android::before {
background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg);
}
.mdn-anno > .feature > .support > .webview_android::before {
background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png);
}
.name-slug-mismatch {
color: red;
}
.caniuse-status:hover {
z-index: 9;
}
/* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */;
.h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno {
right: -6.7em;
}
.h-entry p + .mdn-anno {
margin-top: 0;
}
h2 + .mdn-anno.after {
margin: -48px 0 0 0;
}
h3 + .mdn-anno.after {
margin: -46px 0 0 0;
}
h4 + .mdn-anno.after {
margin: -42px 0 0 0;
}
h5 + .mdn-anno.after {
margin: -40px 0 0 0;
}
h6 + .mdn-anno.after {
margin: -40px 0 0 0;
}
</style>
<style>/* Boilerplate: 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%;
}
.example > a.self-link,
.note > a.self-link,
.issue > a.self-link {
/* These blocks are overflow:auto, so positioning outside
doesn't work. */
left: auto;
right: 0;
}
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>/* Boilerplate: style-var-click-highlighting */
/*
Colors were chosen in Lab using https://nixsensor.com/free-color-converter/
D50 2deg illuminant, L in [0,100], a and b in [-128, 128]
0 = lab(85,0,85)
1 = lab(85,80,30)
2 = lab(85,-40,40)
3 = lab(85,-50,0)
4 = lab(85,5,15)
5 = lab(85,-10,-50)
6 = lab(85,35,-15)
*/
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>
<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/2021/logos/W3C" width="72"> </a> </p>
<h1>Clear Site Data</h1>
<p id="w3c-state"><a href="https://www.w3.org/standards/types#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2023-11-10">10 November 2023</time></p>
<details open>
<summary>More details about this document</summary>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://w3c.github.io/webappsec-clear-site-data/">https://w3c.github.io/webappsec-clear-site-data/</a>
<dt>Latest published version:
<dd><a href="http://www.w3.org/TR/clear-site-data/">http://www.w3.org/TR/clear-site-data/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2016/WD-clear-site-data-20160720/" rel="prev">http://www.w3.org/TR/2016/WD-clear-site-data-20160720/</a>
<dt>Version History:
<dd><a href="https://github.com/w3c/webappsec-clear-site-data/commits/main/index.src.html">https://github.com/w3c/webappsec-clear-site-data/commits/main/index.src.html</a>
<dt>Feedback:
<dd><span><a href="mailto:public-webappsec@w3.org?subject=%5Bclear-site-data%5D%20YOUR%20TOPIC%20HERE">public-webappsec@w3.org</a> with subject line “<kbd>[clear-site-data] <i data-lt>… message topic …</i></kbd>” (<a href="https://lists.w3.org/Archives/Public/public-webappsec/" rel="discussion">archives</a>)</span>
<dt class="editor">Editor:
<dd class="editor p-author h-card vcard" data-editor-id="56384"><a class="p-name fn u-email email" href="mailto:mkwst@google.com">Mike West</a> (<span class="p-org org">Google Inc.</span>)
<dt>Participate:
<dd><a href="https://github.com/w3c/webappsec-clear-site-data/issues/new">File an issue</a> (<a href="https://github.com/w3c/webappsec-clear-site-data/issues">open issues</a>)
</dl>
</div>
</details>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2023 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/" rel="license" title="W3C Software and Document 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 an imperative mechanism which allows web developers to
instruct a user agent to clear a site’s locally stored data related to a
host.</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> This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress. </p>
<p> <strong>Changes to this document may be tracked at <a href="https://github.com/w3c/webappsec">https://github.com/w3c/webappsec</a>.</strong> </p>
<p> The (<a href="https://lists.w3.org/Archives/Public/public-webappsec/">archived</a>) public mailing list <a href="mailto:public-webappsec@w3.org?Subject=%5Bclear-site-data%5D%20PUT%20SUBJECT%20HERE">public-webappsec@w3.org</a> (see <a href="https://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “clear-site-data” in the subject,
preferably like this:
“[clear-site-data] <em>…summary of comment…</em>” </p>
<p> This document was produced by the <a href="https://www.w3.org/groups/wg/webappsec">Web Application Security Working Group</a>. </p>
<p> This document was produced by a group operating under
the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
W3C maintains a <a href="https://www.w3.org/groups/wg/webappsec/ipr" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="https://www.w3.org/2023/Process-20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p>
<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="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
<ol class="toc">
<li>
<a href="#examples"><span class="secno">1.1</span> <span class="content">Examples</span></a>
<ol class="toc">
<li><a href="#example-signout"><span class="secno">1.1.1</span> <span class="content">Signing Out</span></a>
<li><a href="#example-targeted"><span class="secno">1.1.2</span> <span class="content">Targeted Clearing</span></a>
<li><a href="#example-keepcookies"><span class="secno">1.1.3</span> <span class="content">Keep Critical Cookies</span></a>
<li><a href="#example-killswitch"><span class="secno">1.1.4</span> <span class="content">Kill Switch</span></a>
</ol>
<li><a href="#goals"><span class="secno">1.2</span> <span class="content">Goals</span></a>
</ol>
<li><a href="#infra"><span class="secno">2</span> <span class="content">Infrastructure</span></a>
<li>
<a href="#clearing"><span class="secno">3</span> <span class="content">Clearing Site Data</span></a>
<ol class="toc">
<li><a href="#header"><span class="secno">3.1</span> <span class="content"> The <code>Clear-Site-Data</code> HTTP Response Header Field </span></a>
<li><a href="#fetch-integration"><span class="secno">3.2</span> <span class="content">Fetch Integration</span></a>
</ol>
<li>
<a href="#algorithms"><span class="secno">4</span> <span class="content">Algorithms</span></a>
<ol class="toc">
<li><a href="#parsing"><span class="secno">4.1</span> <span class="content">Parsing</span></a>
<li>
<a href="#clear-response"><span class="secno">4.2</span> <span class="content"> Clear data for <var>response</var> </span></a>
<ol class="toc">
<li><a href="#prepare"><span class="secno">4.2.1</span> <span class="content"> Prepare to clear <var>origin</var>’s data </span></a>
<li><a href="#reload-contexts"><span class="secno">4.2.2</span> <span class="content"> Reload <var>browsing contexts</var> </span></a>
<li><a href="#clear-cache"><span class="secno">4.2.3</span> <span class="content"> Clear cache for <var>origin</var> </span></a>
<li><a href="#clear-cookies"><span class="secno">4.2.4</span> <span class="content"> Clear cookies for <var>origin</var> </span></a>
<li><a href="#clear-dom"><span class="secno">4.2.5</span> <span class="content"> Clear DOM-accessible storage for <var>origin</var> </span></a>
</ol>
</ol>
<li>
<a href="#security"><span class="secno">5</span> <span class="content">Security Considerations</span></a>
<ol class="toc">
<li><a href="#incomplete"><span class="secno">5.1</span> <span class="content">Incomplete Clearing</span></a>
<li><a href="#service-workers"><span class="secno">5.2</span> <span class="content">Service workers</span></a>
</ol>
<li>
<a href="#privacy"><span class="secno">6</span> <span class="content">Privacy Considerations</span></a>
<ol class="toc">
<li><a href="#user-vs-author"><span class="secno">6.1</span> <span class="content">Web developers control the timing.</span></a>
<li><a href="#remnants"><span class="secno">6.2</span> <span class="content">Remnants of data on disk.</span></a>
</ol>
<li>
<a href="#iana-considerations"><span class="secno">7</span> <span class="content">IANA Considerations</span></a>
<ol class="toc">
<li><a href="#iana-clear-site-data"><span class="secno">7.1</span> <span class="content"> Clear-Site-Data </span></a>
</ol>
<li><a href="#acknowledgements"><span class="secno">8</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="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<section>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
<p><em>This section is not normative.</em></p>
<p>Web applications store data locally on a user’s computer in order to provide
functionality while the user is offline, and to increase performance when the
user is online. These local caches have significant advantages for both users
and developers, but present risks as well.</p>
<p>A user’s data is both sensitive and valuable; web developers ought to take
reasonable steps to protect it. One such step would be to encrypt data before
storing it. Another would be to remove data from the user’s machine when it is
no longer necessary (for example, when the user signs out of the application,
or deletes their account).</p>
<p>Site authors can remove data from a number of storage mechanisms via
JavaScript, but others are difficult to deal with reliably. Consider cookies,
for instance, which can be partially cleared via JavaScript access to <code>document.cookie</code>. <code>HttpOnly</code> cookies, however, can only
be removed via a number of <code>Set-Cookie</code> headers in an HTTP
response. This, of course, requires exhaustive knowledge of all the cookies
set for a host, which can be complicated to ascertain. Cache is still harder;
no imperative interface to a browser’s network cache exists, period.</p>
<p>This document defines a new mechanism to deal with removing data from these
and other types of local storage, giving web developers the ability to clear
out a user’s local cache of data via the <a data-link-type="http-header" href="#http-headerdef-clear-site-data" id="ref-for-http-headerdef-clear-site-data">Clear-Site-Data</a> HTTP response
header.</p>
<h3 class="heading settled" data-level="1.1" id="examples"><span class="secno">1.1. </span><span class="content">Examples</span><a class="self-link" href="#examples"></a></h3>
<h4 class="heading settled" data-level="1.1.1" id="example-signout"><span class="secno">1.1.1. </span><span class="content">Signing Out</span><a class="self-link" href="#example-signout"></a></h4>
<div class="example" id="example-29397d10">
<a class="self-link" href="#example-29397d10"></a> A user signs out of Super Secret Social Network via a CSRF-protected POST to <code>https://supersecretsocialnetwork.example.com/logout</code>, and the
site author wishes to ensure that locally stored data is removed as a
result.
<p>They can do so by sending the following HTTP header in the response:</p>
<pre><a data-link-type="http-header" href="#http-headerdef-clear-site-data" id="ref-for-http-headerdef-clear-site-data①">Clear-Site-Data</a>: "<a data-link-type="grammar" href="#grammardef-cache" id="ref-for-grammardef-cache">cache</a>", "<a data-link-type="grammar" href="#grammardef-cookies" id="ref-for-grammardef-cookies">cookies</a>", "<a data-link-type="grammar" href="#grammardef-storage" id="ref-for-grammardef-storage">storage</a>", "<a data-link-type="grammar" href="#grammardef-executioncontexts" id="ref-for-grammardef-executioncontexts">executionContexts</a>"
</pre>
</div>
<h4 class="heading settled" data-level="1.1.2" id="example-targeted"><span class="secno">1.1.2. </span><span class="content">Targeted Clearing</span><a class="self-link" href="#example-targeted"></a></h4>
<div class="example" id="example-41e1a27a">
<a class="self-link" href="#example-41e1a27a"></a> A user signs out of Megacorp Inc.'s site via a CSRF-protected POST to <code>https://megacorp.example.com/logout</code>. Megacorp has a large
number of services available as subdomains, so many that it’s not entirely
clear which of them would be safe to clear as a response to a logout action.
One option would be to simply clear everything, and deal with the fallout.
Megacorp’s CEO, however, once lost hours and hours of progress in "Irate
Ibexes" due to inadvertent site-data clearing, and so refuses to allow such
a sweeping impact to the site’s users.
<p>The developers know, however, that the "Minus" application is certainly safe
to clear out. They can target this specific subdomain by including a request
to that subdomain as part of the logout landing page (ideally as a
CORS-enabled, CSRF-protected POST):</p>
<pre>fetch("https://minus.megacorp.example.com/clear-site-data",
{
method: "POST",
mode: "cors",
headers: new Headers({
"CSRF": "[<em>insert sekrit token here</em>]"
})
});
</pre>
<p>That endpoint would return proper CORS headers in response to that request’s
preflight, and would return the following header for the actual request:</p>
<pre><a data-link-type="http-header" href="#http-headerdef-clear-site-data" id="ref-for-http-headerdef-clear-site-data②">Clear-Site-Data</a>: "<a data-link-type="grammar" href="#grammardef-cache" id="ref-for-grammardef-cache①">cache</a>", "<a data-link-type="grammar" href="#grammardef-cookies" id="ref-for-grammardef-cookies①">cookies</a>", "<a data-link-type="grammar" href="#grammardef-storage" id="ref-for-grammardef-storage①">storage</a>", "<a data-link-type="grammar" href="#grammardef-executioncontexts" id="ref-for-grammardef-executioncontexts①">executionContexts</a>"
</pre>
</div>
<h4 class="heading settled" data-level="1.1.3" id="example-keepcookies"><span class="secno">1.1.3. </span><span class="content">Keep Critical Cookies</span><a class="self-link" href="#example-keepcookies"></a></h4>
<div class="example" id="example-469476c0">
<a class="self-link" href="#example-469476c0"></a> A user opts-out of interest-based advertising via a CSRF-protected POST to <code>https://ads-are-awesome.example.com/optout</code>. The site author
wishes to remove DOM-accessible data which might contain tracking
information, but needs to ensure that the opt-out cookie which the user has
just received isn’t wiped along with it.
<p>They can do so by sending the following HTTP header in the response, which
includes all the types except for "<a data-link-type="grammar" href="#grammardef-cookies" id="ref-for-grammardef-cookies②">cookies</a>":</p>
<pre><a data-link-type="http-header" href="#http-headerdef-clear-site-data" id="ref-for-http-headerdef-clear-site-data③">Clear-Site-Data</a>: "<a data-link-type="grammar" href="#grammardef-cache" id="ref-for-grammardef-cache②">cache</a>", "<a data-link-type="grammar" href="#grammardef-storage" id="ref-for-grammardef-storage②">storage</a>", "<a data-link-type="grammar" href="#grammardef-executioncontexts" id="ref-for-grammardef-executioncontexts②">executionContexts</a>"
</pre>
</div>
<h4 class="heading settled" data-level="1.1.4" id="example-killswitch"><span class="secno">1.1.4. </span><span class="content">Kill Switch</span><a class="self-link" href="#example-killswitch"></a></h4>
<div class="example" id="example-a7640e05">
<a class="self-link" href="#example-a7640e05"></a> Super Secret Social Network’s developers learn that the site was vulnerable
to cross-site scripting attacks which allowed malicious parties to inject
arbitrary code into its origin. They fixed the site, and added a strong
Content Security Policy <a data-link-type="biblio" href="#biblio-csp" title="Content Security Policy Level 3">[CSP]</a> to mitigate the risk going forward, but
they can’t be entirely sure that clients are really back to a trustworthy
state. Perhaps the attackers found a clever persistence mechanism?
<p>They can reduce the risk of a persistent client-side XSS by sending the
following HTTP header in a response to wipe out local sources of data:</p>
<pre><a data-link-type="http-header" href="#http-headerdef-clear-site-data" id="ref-for-http-headerdef-clear-site-data④">Clear-Site-Data</a>: "<a data-link-type="grammar" href="#grammardef-cache" id="ref-for-grammardef-cache③">cache</a>", "<a data-link-type="grammar" href="#grammardef-cookies" id="ref-for-grammardef-cookies③">cookies</a>", "<a data-link-type="grammar" href="#grammardef-storage" id="ref-for-grammardef-storage③">storage</a>", "<a data-link-type="grammar" href="#grammardef-executioncontexts" id="ref-for-grammardef-executioncontexts③">executionContexts</a>"
</pre>
<p class="note" role="note"><span class="marker">Note:</span> Installing a Service Worker guarantees that a request will go out to
a server every ~24 hours. That update ping would be a wonderful time to send
a header like this one in case of catastrophe. <a data-link-type="biblio" href="#biblio-service-workers" title="Service Workers">[SERVICE-WORKERS]</a></p>
</div>
<h3 class="heading settled" data-level="1.2" id="goals"><span class="secno">1.2. </span><span class="content">Goals</span><a class="self-link" href="#goals"></a></h3>
<p>Generally, the goal is to allow web developers more control over the data
stored locally by a user agent for their origins. In particular, developers
should be able to reliably ensure the following:</p>
<ol>
<li data-md>
<p>Data stored in an origin’s client-side storage mechanisms like <a data-link-type="biblio" href="#biblio-indexeddb" title="Indexed Database API">[INDEXEDDB]</a>,
WebSQL, Filesystem, <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage" id="ref-for-dom-localstorage">localStorage</a></code>, and <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage" id="ref-for-dom-sessionstorage">sessionStorage</a></code> is cleared.</p>
<li data-md>
<p>Cookies for an origin’s host are removed <a data-link-type="biblio" href="#biblio-rfc6265" title="HTTP State Management Mechanism">[RFC6265]</a>.</p>
<li data-md>
<p>Web Workers (dedicated and shared) running for an origin are terminated.</p>
<li data-md>
<p>Service Workers registered for an origin are terminated and deregistered.</p>
<li data-md>
<p>Resources from an origin are removed from the user agent’s local cache.</p>
<li data-md>
<p>The <a data-link-type="dfn" href="https://wicg.github.io/client-hints-infrastructure/#accept-ch-cache" id="ref-for-accept-ch-cache">Accept-CH cache</a> for an origin is purged.</p>
<li data-md>
<p>None of the above can be bypassed by a maliciously active document that
retains interesting data in memory, and rewrites it if it’s cleared.</p>
</ol>
</section>
<section>
<h2 class="heading settled" data-level="2" id="infra"><span class="secno">2. </span><span class="content">Infrastructure</span><a class="self-link" href="#infra"></a></h2>