forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
annotated-2019-09-05.html
2103 lines (2087 loc) · 264 KB
/
annotated-2019-09-05.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">
<title>CSS Containment Module Level 1</title>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="stable" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<meta content="This CSS module describes the 'contain' property, which indicates that the element's subtree is independent of the rest of the page. This enables heavy optimizations by user agents when used well." name="abstract">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
}
</style>
<meta content="Bikeshed version 220086d88511a9c99d7a1f9b5447db7e7b99e053" name="generator">
<link href="https://www.w3.org/TR/css-contain-1/" rel="canonical">
<meta content="644be94b26bce2e0677f9cf38f38c8865681a231" name="document-revision">
<script defer src="https://test.csswg.org/harness/annotate.js#!css-contain-1_dev/css-contain-1" type="text/javascript"></script>
<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 */
.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: gray;
color: white;
font-style: normal;
transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
opacity: 1;
}
dfn > a.self-link:hover {
color: black;
}
a.self-link::before { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before { content: "#"; }</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-autolinks */
.css.css, .property.property, .descriptor.descriptor {
color: #005a9c;
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-dfn-panel */
.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: #DDDDDD;
color: black;
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: black; }
.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-syntax-highlighting */
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
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-wpt */
.wpt-tests-block {
list-style: none;
border-left: .5em solid hsl(290, 70%, 60%);
background: hsl(290, 70%, 95%);
margin: 1em auto;
padding: .5em;
display: grid;
grid-template-columns: 1fr auto auto;
grid-column-gap: .5em;
}
.wpt-tests-block::before {
content: "Tests";
grid-column: 1/-1;
color: hsl(290, 70%, 30%);
text-transform: uppercase;
}
.wpt-test {
display: contents;
}
.wpt-test > a {
text-decoration: underline;
border: none;
}
</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">CSS Containment Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2019-09-05">5 September 2019</time></span></h2>
<details>
<summary>Specification Metadata</summary>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://drafts.csswg.org/css-contain/">https://drafts.csswg.org/css-contain/</a>
<dt>Latest published version:
<dd><a href="https://www.w3.org/TR/css-contain-1/">https://www.w3.org/TR/css-contain-1/</a>
<dt>Previous Versions:
<dd><a href="https://www.w3.org/TR/2019/CR-css-contain-1-20190430/" rel="prev">https://www.w3.org/TR/2019/CR-css-contain-1-20190430/</a>
<dd><a href="https://www.w3.org/TR/2018/CR-css-contain-1-20181108/" rel="prev">https://www.w3.org/TR/2018/CR-css-contain-1-20181108/</a>
<dd><a href="https://www.w3.org/TR/2018/CR-css-contain-1-20180524/" rel="prev">https://www.w3.org/TR/2018/CR-css-contain-1-20180524/</a>
<dd><a href="https://www.w3.org/TR/2017/CR-css-contain-1-20170808/" rel="prev">https://www.w3.org/TR/2017/CR-css-contain-1-20170808/</a>
<dd><a href="https://www.w3.org/TR/2017/WD-css-contain-1-20170419/" rel="prev">https://www.w3.org/TR/2017/WD-css-contain-1-20170419/</a>
<dd><a href="https://www.w3.org/TR/2017/WD-css-contain-1-20170221/" rel="prev">https://www.w3.org/TR/2017/WD-css-contain-1-20170221/</a>
<dt>Test Suite:
<dd><a href="http://test.csswg.org/suites/css-contain-1_dev/nightly-unstable/">http://test.csswg.org/suites/css-contain-1_dev/nightly-unstable/</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins</a> (<span class="p-org org">Google</span>)
<dd class="editor p-author h-card vcard" data-editor-id="43241"><a class="p-name fn u-url url" href="https://florian.rivoal.net/">Florian Rivoal</a> (<span class="p-org org">On behalf of Bloomberg</span>)
<dt>Suggest an Edit for this Spec:
<dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-contain-1/Overview.bs">GitHub Editor</a>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/labels/css-contain-1">GitHub Issues</a>
</dl>
</div>
</details>
<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> © 2019 <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="https://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">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 CSS module describes the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain">contain</a> property, which indicates that the element’s subtree is independent of the rest of the page. This enables heavy optimizations by user agents when used well.</p>
<a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><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> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
When filing an issue, please put the text “css-contain” in the title,
preferably like this:
“[css-contain] <i data-lt>…summary of comment…</i>”.
All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
<p> This document was produced by the <a href="https://www.w3.org/Style/CSS/members">CSS 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/2004/01/pp-impl/32061/status" 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/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk">
<p>The following features are at-risk, and may be dropped during the CR period: </p>
<ul>
<li><a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment">style containment</a> and the <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①">contain: style</a> value
</ul>
<p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
</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>
<li><a href="#contain-property"><span class="secno">2</span> <span class="content"> Strong Containment: the <span class="property">contain</span> property</span></a>
<li>
<a href="#containment-types"><span class="secno">3</span> <span class="content"> Types of Containment</span></a>
<ol class="toc">
<li><a href="#containment-size"><span class="secno">3.1</span> <span class="content"> Size Containment</span></a>
<li><a href="#containment-layout"><span class="secno">3.2</span> <span class="content"> Layout Containment</span></a>
<li><a href="#containment-style"><span class="secno">3.3</span> <span class="content"> Style Containment</span></a>
<li><a href="#containment-paint"><span class="secno">3.4</span> <span class="content"> Paint Containment</span></a>
</ol>
<li><a href="#privsec"><span class="secno">4</span> <span class="content">Privacy and Security Considerations</span></a>
<li>
<a href="#changes"><span class="secno"></span> <span class="content">Appendix A. Changes</span></a>
<ol class="toc">
<li><a href="#2018-11-08-changes"><span class="secno"></span> <span class="content">Changes from the <span>Candidate Recommendation of 08 November 2018</span></span></a>
<li><a href="#2018-05-24-changes"><span class="secno"></span> <span class="content">Changes from the <span>Candidate Recommendation of 24 May 2018</span></span></a>
<li><a href="#2017-08-08-changes"><span class="secno"></span> <span class="content">Changes from the <span>Candidate Recommendation of 8 August 2017</span></span></a>
<li><a href="#2017-04-19-changes"><span class="secno"></span> <span class="content">Changes from the <span>Working Draft of 19 April 2017</span></span></a>
<li><a href="#fpwd-changes"><span class="secno"></span> <span class="content">Changes from the <span>First Public Working Draft of 21 February 2017</span></span></a>
</ol>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ol class="toc">
<li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li>
<a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
<ol class="toc">
<li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
<li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
<li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
</ol>
</ol>
<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="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
</ol>
</nav>
<main>
<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>Efficiently rendering a website relies on the User Agent being able to detect what parts of the page are being displayed,
which parts might affect the currently-displayed section,
and what can be ignored.</p>
<p>There are various heuristics that can be used to guess when a given sub-tree is independent of the rest of the page in some manner,
but they’re fragile,
so innocuous changes to a page may inadvertently make it flunk the heuristics and fall into a slow mode.
There are also many things that would be good to isolate which are difficult or impossible to detect in a heuristic manner.</p>
<p>To alleviate these problems
and allow strong, predictable isolation of a subtree from the rest of the page,
this specification defines a <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain②">contain</a> property.</p>
<h2 class="heading settled" data-level="2" id="contain-property"><span class="secno">2. </span><span class="content"> Strong Containment: the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain③">contain</a> property</span><a class="self-link" href="#contain-property"></a></h2>
<table class="def propdef" data-link-for-hint="contain">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-contain">contain</dfn>
<tr class="value">
<th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
<td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> strict <span id="ref-for-comb-one①">|</span> content <span id="ref-for-comb-one②">|</span> [ size <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-any" id="ref-for-comb-any">||</a> layout <span id="ref-for-comb-any①">||</span> style <span id="ref-for-comb-any②">||</span> paint ]
<tr>
<th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
<td>none
<tr>
<th>Applies to:
<td>See <a href="#contain-applies">below</a>
<tr>
<th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
<td>no
<tr>
<th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
<td>n/a
<tr>
<th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
<td>specified keyword(s)
<tr>
<th>Canonical order:
<td>per grammar
<tr>
<th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
<td>not animatable
</table>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-animation-001.html">contain-animation-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-animation-001.html" title="css/css-contain/contain-animation-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-animation-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/inheritance.html">inheritance.html</a> <a href="http://web-platform-tests.live/css/css-contain/inheritance.html" title="css/css-contain/inheritance.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/inheritance.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/parsing/contain-computed.html">contain-computed.html</a> <a href="http://web-platform-tests.live/css/css-contain/parsing/contain-computed.html" title="css/css-contain/parsing/contain-computed.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/parsing/contain-computed.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/parsing/contain-invalid.html">contain-invalid.html</a> <a href="http://web-platform-tests.live/css/css-contain/parsing/contain-invalid.html" title="css/css-contain/parsing/contain-invalid.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/parsing/contain-invalid.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/parsing/contain-valid.html">contain-valid.html</a> <a href="http://web-platform-tests.live/css/css-contain/parsing/contain-valid.html" title="css/css-contain/parsing/contain-valid.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/parsing/contain-valid.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-size-003.html">contain-layout-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-size-003.html" title="css/css-contain/contain-layout-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-001.html">contain-paint-size-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-001.html" title="css/css-contain/contain-paint-size-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-002.html">contain-paint-size-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-002.html" title="css/css-contain/contain-paint-size-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-003.html">contain-paint-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-003.html" title="css/css-contain/contain-paint-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-chrome-crash-001.html">contain-chrome-crash-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-chrome-crash-001.html" title="css/css-contain/contain-chrome-crash-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-chrome-crash-001.html"><small>(source)</small></a>
</ul>
<p class="all-media">User Agents are expected to support this property on all media, including non-visual ones.</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain④">contain</a> property allows an author to indicate that an element and its contents are,
as much as possible, <em>independent</em> of the rest of the document tree.
This allows user agents to utilize much stronger optimizations when rendering a page using <span class="property" id="ref-for-propdef-contain⑤">contain</span> properly,
and allows authors to be confident that their page won’t accidentally fall into a slow code path
due to an innocuous change.</p>
<dl>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-none">none<a class="self-link" href="#valdef-contain-none"></a></dfn>
<dd> This value indicates that the property has no effect.
The element renders as normal,
with no containment effects applied.
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-strict">strict<a class="self-link" href="#valdef-contain-strict"></a></dfn>
<dd>
This value turns on all forms of <a data-link-type="dfn" href="#containment" id="ref-for-containment">containment</a> <em>except</em> <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment①">style containment</a> for the element.
In other words, it behaves the same as <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑥">contain: size layout paint;</a>.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-strict-001.html">contain-strict-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-strict-001.html" title="css/css-contain/contain-strict-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-strict-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-strict-002.html">contain-strict-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-strict-002.html" title="css/css-contain/contain-strict-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-strict-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-strict-003.html">contain-strict-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-strict-003.html" title="css/css-contain/contain-strict-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-strict-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-strict-011.html">contain-strict-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-strict-011.html" title="css/css-contain/contain-strict-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-strict-011.html"><small>(source)</small></a>
</ul>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-content">content<a class="self-link" href="#valdef-contain-content"></a></dfn>
<dd>
This value turns on all forms of <a data-link-type="dfn" href="#containment" id="ref-for-containment①">containment</a> <em>except</em> <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment">size containment</a> and <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment②">style containment</a> for the element.
In other words, it behaves the same as <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑦">contain: layout paint;</a>.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-content-001.html">contain-content-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-content-001.html" title="css/css-contain/contain-content-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-content-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-content-002.html">contain-content-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-content-002.html" title="css/css-contain/contain-content-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-content-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-content-003.html">contain-content-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-content-003.html" title="css/css-contain/contain-content-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-content-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-content-004.html">contain-content-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-content-004.html" title="css/css-contain/contain-content-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-content-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-content-011.html">contain-content-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-content-011.html" title="css/css-contain/contain-content-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-content-011.html"><small>(source)</small></a>
</ul>
<p class="note" role="note"><span>Note:</span> <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑧">contain: content</a> is reasonably "safe" to apply widely;
its effects are fairly minor in practice,
and most content won’t run afoul of its restrictions.
However, because it doesn’t apply <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment①">size containment</a>,
the element can still respond to the size of its contents,
which can cause layout-invalidation to percolate further up the tree than desired.
Use <span class="css" id="ref-for-propdef-contain⑨">contain: strict</span> or <span class="css" id="ref-for-propdef-contain①⓪">contain: strict style</span> when possible,
to gain as much containment as you can.</p>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-size">size<a class="self-link" href="#valdef-contain-size"></a></dfn>
<dd>
The value turns on <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment②">size containment</a> for the element.
This ensures that the containing box can be laid out
without needing to examine its descendants.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-001.html">contain-size-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-001.html" title="css/css-contain/contain-size-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-002.html">contain-size-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-002.html" title="css/css-contain/contain-size-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-003.html">contain-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-003.html" title="css/css-contain/contain-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-004.html">contain-size-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-004.html" title="css/css-contain/contain-size-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-005.html">contain-size-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-005.html" title="css/css-contain/contain-size-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-006.html">contain-size-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-006.html" title="css/css-contain/contain-size-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-007.html">contain-size-007.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-007.html" title="css/css-contain/contain-size-007.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-007.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-008.html">contain-size-008.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-008.html" title="css/css-contain/contain-size-008.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-008.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-009.html">contain-size-009.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-009.html" title="css/css-contain/contain-size-009.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-009.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-010.html">contain-size-010.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-010.html" title="css/css-contain/contain-size-010.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-010.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-011.html">contain-size-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-011.html" title="css/css-contain/contain-size-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-012.html">contain-size-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-012.html" title="css/css-contain/contain-size-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-012b.html">contain-size-012b.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-012b.html" title="css/css-contain/contain-size-012b.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-012b.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-013.html">contain-size-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-013.html" title="css/css-contain/contain-size-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-021.html">contain-size-021.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-021.html" title="css/css-contain/contain-size-021.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-021.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-023.html">contain-size-023.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-023.html" title="css/css-contain/contain-size-023.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-023.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-025.html">contain-size-025.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-025.html" title="css/css-contain/contain-size-025.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-025.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-027.html">contain-size-027.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-027.html" title="css/css-contain/contain-size-027.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-027.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-041.html">contain-size-041.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-041.html" title="css/css-contain/contain-size-041.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-041.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-042.html">contain-size-042.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-042.html" title="css/css-contain/contain-size-042.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-042.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-051.html">contain-size-051.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-051.html" title="css/css-contain/contain-size-051.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-051.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-052.html">contain-size-052.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-052.html" title="css/css-contain/contain-size-052.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-052.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-056.html">contain-size-056.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-056.html" title="css/css-contain/contain-size-056.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-056.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-061.html">contain-size-061.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-061.html" title="css/css-contain/contain-size-061.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-061.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-062.html">contain-size-062.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-062.html" title="css/css-contain/contain-size-062.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-062.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-baseline-001.html">contain-size-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-baseline-001.html" title="css/css-contain/contain-size-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-baseline-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-borders.html">contain-size-borders.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-borders.html" title="css/css-contain/contain-size-borders.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-borders.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-breaks-001.html">contain-size-breaks-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-breaks-001.html" title="css/css-contain/contain-size-breaks-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-breaks-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-button-001.html">contain-size-button-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-button-001.html" title="css/css-contain/contain-size-button-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-button-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-fieldset-001.html">contain-size-fieldset-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-fieldset-001.html" title="css/css-contain/contain-size-fieldset-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-fieldset-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-fieldset-002.html">contain-size-fieldset-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-fieldset-002.html" title="css/css-contain/contain-size-fieldset-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-fieldset-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-flexbox-001.html">contain-size-flexbox-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-flexbox-001.html" title="css/css-contain/contain-size-flexbox-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-flexbox-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-flexbox-002.html">contain-size-flexbox-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-flexbox-002.html" title="css/css-contain/contain-size-flexbox-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-flexbox-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-grid-001.html">contain-size-grid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-grid-001.html" title="css/css-contain/contain-size-grid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-grid-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-grid-002.html">contain-size-grid-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-grid-002.html" title="css/css-contain/contain-size-grid-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-grid-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-monolithic-001.html">contain-size-monolithic-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-monolithic-001.html" title="css/css-contain/contain-size-monolithic-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-monolithic-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-multicol-001.html">contain-size-multicol-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-multicol-001.html" title="css/css-contain/contain-size-multicol-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-multicol-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-multicol-as-flex-item.html">contain-size-multicol-as-flex-item.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-multicol-as-flex-item.html" title="css/css-contain/contain-size-multicol-as-flex-item.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-multicol-as-flex-item.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-001.html">contain-size-replaced-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-001.html" title="css/css-contain/contain-size-replaced-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-002.html">contain-size-replaced-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-002.html" title="css/css-contain/contain-size-replaced-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003a.html">contain-size-replaced-003a.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003a.html" title="css/css-contain/contain-size-replaced-003a.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003a.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003b.html">contain-size-replaced-003b.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003b.html" title="css/css-contain/contain-size-replaced-003b.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003b.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003c.html">contain-size-replaced-003c.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003c.html" title="css/css-contain/contain-size-replaced-003c.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003c.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-004.html">contain-size-replaced-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-004.html" title="css/css-contain/contain-size-replaced-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-005.html">contain-size-replaced-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-005.html" title="css/css-contain/contain-size-replaced-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-006.html">contain-size-replaced-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-006.html" title="css/css-contain/contain-size-replaced-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-select-001.html">contain-size-select-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-select-001.html" title="css/css-contain/contain-size-select-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-select-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-select-002.html">contain-size-select-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-select-002.html" title="css/css-contain/contain-size-select-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-select-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-001.html">contain-size-scrollbars-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-001.html" title="css/css-contain/contain-size-scrollbars-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-002.html">contain-size-scrollbars-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-002.html" title="css/css-contain/contain-size-scrollbars-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-003.html">contain-size-scrollbars-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-003.html" title="css/css-contain/contain-size-scrollbars-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-size-003.html">contain-layout-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-size-003.html" title="css/css-contain/contain-layout-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-001.html">contain-paint-size-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-001.html" title="css/css-contain/contain-paint-size-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-002.html">contain-paint-size-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-002.html" title="css/css-contain/contain-paint-size-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-003.html">contain-paint-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-003.html" title="css/css-contain/contain-paint-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-003.html"><small>(source)</small></a>
</ul>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-layout">layout<a class="self-link" href="#valdef-contain-layout"></a></dfn>
<dd>
This value turns on <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment">layout containment</a> for the element.
This ensures that the containing box is <em>totally opaque</em> for layout purposes;
nothing outside can affect its internal layout,
and vice versa.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-001.html">contain-layout-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-001.html" title="css/css-contain/contain-layout-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-002.html">contain-layout-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-002.html" title="css/css-contain/contain-layout-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-003.html">contain-layout-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-003.html" title="css/css-contain/contain-layout-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-004.html">contain-layout-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-004.html" title="css/css-contain/contain-layout-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-005.html">contain-layout-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-005.html" title="css/css-contain/contain-layout-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-006.html">contain-layout-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-006.html" title="css/css-contain/contain-layout-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-007.html">contain-layout-007.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-007.html" title="css/css-contain/contain-layout-007.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-007.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-009.html">contain-layout-009.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-009.html" title="css/css-contain/contain-layout-009.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-009.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-010.html">contain-layout-010.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-010.html" title="css/css-contain/contain-layout-010.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-010.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-011.html">contain-layout-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-011.html" title="css/css-contain/contain-layout-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-012.html">contain-layout-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-012.html" title="css/css-contain/contain-layout-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-013.html">contain-layout-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-013.html" title="css/css-contain/contain-layout-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-014.html">contain-layout-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-014.html" title="css/css-contain/contain-layout-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-016.html">contain-layout-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-016.html" title="css/css-contain/contain-layout-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-017.html">contain-layout-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-017.html" title="css/css-contain/contain-layout-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-018.html">contain-layout-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-018.html" title="css/css-contain/contain-layout-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-018.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-001.html">contain-layout-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-001.html" title="css/css-contain/contain-layout-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-002.html">contain-layout-baseline-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-002.html" title="css/css-contain/contain-layout-baseline-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-003.html">contain-layout-baseline-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-003.html" title="css/css-contain/contain-layout-baseline-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-004.html">contain-layout-baseline-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-004.html" title="css/css-contain/contain-layout-baseline-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-005.html">contain-layout-baseline-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-005.html" title="css/css-contain/contain-layout-baseline-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-breaks-001.html">contain-layout-breaks-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-breaks-001.html" title="css/css-contain/contain-layout-breaks-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-breaks-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-breaks-002.html">contain-layout-breaks-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-breaks-002.html" title="css/css-contain/contain-layout-breaks-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-breaks-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-button-001.html">contain-layout-button-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-button-001.html" title="css/css-contain/contain-layout-button-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-button-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-cell-001.html">contain-layout-cell-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-cell-001.html" title="css/css-contain/contain-layout-cell-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-cell-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-cell-002.html">contain-layout-cell-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-cell-002.html" title="css/css-contain/contain-layout-cell-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-cell-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-flexbox-001.html">contain-layout-flexbox-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-flexbox-001.html" title="css/css-contain/contain-layout-flexbox-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-flexbox-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-grid-001.html">contain-layout-grid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-grid-001.html" title="css/css-contain/contain-layout-grid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-grid-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ifc-022.html">contain-layout-ifc-022.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ifc-022.html" title="css/css-contain/contain-layout-ifc-022.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ifc-022.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-001.html">contain-layout-independent-formatting-context-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-001.html" title="css/css-contain/contain-layout-independent-formatting-context-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-002.html">contain-layout-independent-formatting-context-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-002.html" title="css/css-contain/contain-layout-independent-formatting-context-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-003.html">contain-layout-independent-formatting-context-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-003.html" title="css/css-contain/contain-layout-independent-formatting-context-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-013.html">contain-layout-ink-overflow-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-013.html" title="css/css-contain/contain-layout-ink-overflow-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-014.html">contain-layout-ink-overflow-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-014.html" title="css/css-contain/contain-layout-ink-overflow-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-015.html">contain-layout-ink-overflow-015.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-015.html" title="css/css-contain/contain-layout-ink-overflow-015.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-015.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-016.html">contain-layout-ink-overflow-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-016.html" title="css/css-contain/contain-layout-ink-overflow-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-017.html">contain-layout-ink-overflow-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-017.html" title="css/css-contain/contain-layout-ink-overflow-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-018.html">contain-layout-ink-overflow-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-018.html" title="css/css-contain/contain-layout-ink-overflow-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-018.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-019.html">contain-layout-ink-overflow-019.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-019.html" title="css/css-contain/contain-layout-ink-overflow-019.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-019.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-020.html">contain-layout-ink-overflow-020.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-020.html" title="css/css-contain/contain-layout-ink-overflow-020.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-020.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-size-003.html">contain-layout-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-size-003.html" title="css/css-contain/contain-layout-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-subgrid-001.html">contain-subgrid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-subgrid-001.html" title="css/css-contain/contain-subgrid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-subgrid-001.html"><small>(source)</small></a>
</ul>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-style">style<a class="self-link" href="#valdef-contain-style"></a></dfn>
<dd>
This value turns on <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment③">style containment</a> for the element.
This ensures that,
for properties which can have effects on more than just an element and its descendants,
those effects don’t escape the element.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-baseline-001.html">contain-style-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-baseline-001.html" title="css/css-contain/contain-style-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-baseline-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-breaks-001.html">contain-style-breaks-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-breaks-001.html" title="css/css-contain/contain-style-breaks-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-breaks-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-breaks-002.html">contain-style-breaks-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-breaks-002.html" title="css/css-contain/contain-style-breaks-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-breaks-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-breaks-003.html">contain-style-breaks-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-breaks-003.html" title="css/css-contain/contain-style-breaks-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-breaks-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-breaks-004.html">contain-style-breaks-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-breaks-004.html" title="css/css-contain/contain-style-breaks-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-breaks-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-breaks-005.html">contain-style-breaks-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-breaks-005.html" title="css/css-contain/contain-style-breaks-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-breaks-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-counters-001.html">contain-style-counters-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-counters-001.html" title="css/css-contain/contain-style-counters-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-counters-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-counters-002.html">contain-style-counters-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-counters-002.html" title="css/css-contain/contain-style-counters-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-counters-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-counters-003.html">contain-style-counters-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-counters-003.html" title="css/css-contain/contain-style-counters-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-counters-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-style-counters-004.html">contain-style-counters-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-style-counters-004.html" title="css/css-contain/contain-style-counters-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-style-counters-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/counter-scoping-001.html">counter-scoping-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/counter-scoping-001.html" title="css/css-contain/counter-scoping-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/counter-scoping-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/counter-scoping-002.html">counter-scoping-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/counter-scoping-002.html" title="css/css-contain/counter-scoping-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/counter-scoping-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/counter-scoping-003.html">counter-scoping-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/counter-scoping-003.html" title="css/css-contain/counter-scoping-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/counter-scoping-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/quote-scoping-001.html">quote-scoping-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/quote-scoping-001.html" title="css/css-contain/quote-scoping-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/quote-scoping-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/quote-scoping-002.html">quote-scoping-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/quote-scoping-002.html" title="css/css-contain/quote-scoping-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/quote-scoping-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/quote-scoping-003.html">quote-scoping-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/quote-scoping-003.html" title="css/css-contain/quote-scoping-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/quote-scoping-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/quote-scoping-004.html">quote-scoping-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/quote-scoping-004.html" title="css/css-contain/quote-scoping-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/quote-scoping-004.html"><small>(source)</small></a>
</ul>
<p class="note" role="note"><span>Note:</span> This value is at-risk.</p>
<dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-paint">paint<a class="self-link" href="#valdef-contain-paint"></a></dfn>
<dd>
This value turns on <a data-link-type="dfn" href="#paint-containment" id="ref-for-paint-containment">paint containment</a> for the element.
This ensures that the descendants of the containing box don’t display outside its bounds,
so if an element is off-screen or otherwise not visible,
its descendants are also guaranteed to be not visible.
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-001.html">contain-paint-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-001.html" title="css/css-contain/contain-paint-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-002.html">contain-paint-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-002.html" title="css/css-contain/contain-paint-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-004.html">contain-paint-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-004.html" title="css/css-contain/contain-paint-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-005.html">contain-paint-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-005.html" title="css/css-contain/contain-paint-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-006.html">contain-paint-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-006.html" title="css/css-contain/contain-paint-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-007.html">contain-paint-007.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-007.html" title="css/css-contain/contain-paint-007.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-007.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-008.html">contain-paint-008.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-008.html" title="css/css-contain/contain-paint-008.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-008.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-009.html">contain-paint-009.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-009.html" title="css/css-contain/contain-paint-009.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-009.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-010.html">contain-paint-010.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-010.html" title="css/css-contain/contain-paint-010.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-010.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-011.html">contain-paint-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-011.html" title="css/css-contain/contain-paint-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-012.html">contain-paint-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-012.html" title="css/css-contain/contain-paint-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-014.html">contain-paint-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-014.html" title="css/css-contain/contain-paint-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-015.html">contain-paint-015.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-015.html" title="css/css-contain/contain-paint-015.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-015.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-016.html">contain-paint-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-016.html" title="css/css-contain/contain-paint-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-017.html">contain-paint-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-017.html" title="css/css-contain/contain-paint-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-018.html">contain-paint-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-018.html" title="css/css-contain/contain-paint-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-018.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-019.html">contain-paint-019.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-019.html" title="css/css-contain/contain-paint-019.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-019.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-020.html">contain-paint-020.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-020.html" title="css/css-contain/contain-paint-020.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-020.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-021.html">contain-paint-021.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-021.html" title="css/css-contain/contain-paint-021.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-021.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-022.html">contain-paint-022.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-022.html" title="css/css-contain/contain-paint-022.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-022.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-023.html">contain-paint-023.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-023.html" title="css/css-contain/contain-paint-023.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-023.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-024.html">contain-paint-024.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-024.html" title="css/css-contain/contain-paint-024.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-024.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-025.html">contain-paint-025.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-025.html" title="css/css-contain/contain-paint-025.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-025.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-047.html">contain-paint-047.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-047.html" title="css/css-contain/contain-paint-047.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-047.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-048.html">contain-paint-048.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-048.html" title="css/css-contain/contain-paint-048.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-048.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-baseline-001.html">contain-paint-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-baseline-001.html" title="css/css-contain/contain-paint-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-baseline-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-cell-001.html">contain-paint-cell-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-cell-001.html" title="css/css-contain/contain-paint-cell-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-cell-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-cell-002.html">contain-paint-cell-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-cell-002.html" title="css/css-contain/contain-paint-cell-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-cell-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-011.html">contain-paint-clip-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-011.html" title="css/css-contain/contain-paint-clip-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-012.html">contain-paint-clip-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-012.html" title="css/css-contain/contain-paint-clip-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-013.html">contain-paint-clip-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-013.html" title="css/css-contain/contain-paint-clip-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-014.html">contain-paint-clip-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-014.html" title="css/css-contain/contain-paint-clip-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-015.html">contain-paint-clip-015.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-015.html" title="css/css-contain/contain-paint-clip-015.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-015.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-016.html">contain-paint-clip-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-016.html" title="css/css-contain/contain-paint-clip-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-017.html">contain-paint-clip-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-017.html" title="css/css-contain/contain-paint-clip-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-018.html">contain-paint-clip-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-018.html" title="css/css-contain/contain-paint-clip-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-018.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-clip-019.html">contain-paint-clip-019.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-clip-019.html" title="css/css-contain/contain-paint-clip-019.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-clip-019.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-ifc-011.html">contain-paint-ifc-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-ifc-011.html" title="css/css-contain/contain-paint-ifc-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-ifc-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-independent-formatting-context-001.html">contain-paint-independent-formatting-context-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-independent-formatting-context-001.html" title="css/css-contain/contain-paint-independent-formatting-context-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-independent-formatting-context-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-independent-formatting-context-002.html">contain-paint-independent-formatting-context-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-independent-formatting-context-002.html" title="css/css-contain/contain-paint-independent-formatting-context-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-independent-formatting-context-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-independent-formatting-context-003.html">contain-paint-independent-formatting-context-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-independent-formatting-context-003.html" title="css/css-contain/contain-paint-independent-formatting-context-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-independent-formatting-context-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-001.html">contain-paint-size-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-001.html" title="css/css-contain/contain-paint-size-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-002.html">contain-paint-size-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-002.html" title="css/css-contain/contain-paint-size-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-size-003.html">contain-paint-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-size-003.html" title="css/css-contain/contain-paint-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-table-001.html">contain-paint-table-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-table-001.html" title="css/css-contain/contain-paint-table-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-table-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-paint-table-002.html">contain-paint-table-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-paint-table-002.html" title="css/css-contain/contain-paint-table-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-paint-table-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-subgrid-001.html">contain-subgrid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-subgrid-001.html" title="css/css-contain/contain-subgrid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-subgrid-001.html"><small>(source)</small></a>
</ul>
</dl>
<p><span id="contain-applies">This property generally applies to all elements (including <a href="https://www.w3.org/TR/css-pseudo-4/#generated-content">CSS Pseudo-Elements 4 §4.1 Generated Content Pseudo-elements: ::before and ::after</a>)</span>,
although some types of containment have no effect on some elements,
as detailed in <a href="#containment-types">§ 3 Types of Containment</a>.
In addition, in the case of <a data-link-type="biblio" href="#biblio-svg2">[SVG2]</a>,
the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①①">contain</a> property only applies to <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/struct.html#elementdef-svg" id="ref-for-elementdef-svg">svg</a></code> elements that have an associated CSS layout box.</p>
<div class="example" id="example-ace3db03">
<a class="self-link" href="#example-ace3db03"></a> <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①②">contain</a> is useful when used widely on a page,
particularly when a page contains a lot of "widgets" which are all independent.
<p>For example, assume a micropost social network had markup something like this:</p>
<pre><code class="highlight"><c- p><</c-><c- f>body</c-><c- p>></c->
<c- p><</c-><c- f>aside</c-><c- p>></c->...<c- p></</c-><c- f>aside</c-><c- p>></c->
<c- p><</c-><c- f>section</c-><c- p>></c->
<c- p><</c-><c- f>h2</c-><c- p>></c->Messages<c- p></</c-><c- f>h2</c-><c- p>></c->
<c- p><</c-><c- f>article</c-><c- p>></c->
Lol, check out this dog: images.example.com/jsK3jkl
<c- p></</c-><c- f>article</c-><c- p>></c->
<c- p><</c-><c- f>article</c-><c- p>></c->
I had a ham sandwich today. #goodtimes
<c- p></</c-><c- f>article</c-><c- p>></c->
<c- p><</c-><c- f>article</c-><c- p>></c->
I have political opinions that you need to hear!
<c- p></</c-><c- f>article</c-><c- p>></c->
…
<c- p></</c-><c- f>section</c-><c- p>></c->
<c- p></</c-><c- f>body</c-><c- p>></c->
</code></pre>
<p>There are probably a <em>lot</em> of messages displayed on the site,
but each is independent and won’t affect anything else on the site.
As such, each can be marked with <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①③">contain: content</a> to communicate this to the user agent,
so it can optimize the page and skip a lot of computation for messages that are off-screen.
If the size of each message is known ahead of time, <span class="css" id="ref-for-propdef-contain①④">contain: strict</span> can be applied to communicate further restrictions.</p>
</div>
<h2 class="heading settled" data-level="3" id="containment-types"><span class="secno">3. </span><span class="content"> Types of Containment</span><a class="self-link" href="#containment-types"></a></h2>
<p>There are several varieties of <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="containment">containment</dfn> that an element can be subject to,
restricting the effects that its descendants can have on the rest of the page in various ways. <a data-link-type="dfn" href="#containment" id="ref-for-containment②">Containment</a> enables much more powerful optimizations by user agents,
and helps authors compose their page out of functional units,
as it limits how widely a given change can affect a document.</p>
<p><strong class="advisement"> Specification authors introducing new properties or mechanisms
need to consider whether and how the various types of containment
affect what they are introducing,
and include in their specification any effect not described here.</strong></p>
<h3 class="heading settled" data-level="3.1" id="containment-size"><span class="secno">3.1. </span><span class="content"> Size Containment</span><a class="self-link" href="#containment-size"></a></h3>
<p>If the element does not generate a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#principal-box" id="ref-for-principal-box">principal box</a> (as is the case with <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display: contents</a> or <span class="css" id="ref-for-propdef-display①">display: none</span>),
or its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inner-display-type" id="ref-for-inner-display-type">inner display type</a> is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table" id="ref-for-valdef-display-table">table</a>,
or its principal box is an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-table-box" id="ref-for-internal-table-box">internal table box</a>,
or an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-ruby-box" id="ref-for-internal-ruby-box">internal ruby box</a>,
or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#atomic-inline" id="ref-for-atomic-inline">non-atomic</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline-level" id="ref-for-inline-level">inline-level</a> box,
size containment has no effect.
Otherwise, giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="size-containment">size containment</dfn> makes its <span id="ref-for-principal-box①">principal box</span> a <dfn class="dfn-paneled" data-dfn-for="size-containment" data-dfn-type="dfn" data-noexport id="size-containment-containing-box">containing box</dfn> for <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment③">size containment</a> and has the following effects:</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-001.html">contain-size-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-001.html" title="css/css-contain/contain-size-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-002.html">contain-size-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-002.html" title="css/css-contain/contain-size-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-003.html">contain-size-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-003.html" title="css/css-contain/contain-size-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-004.html">contain-size-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-004.html" title="css/css-contain/contain-size-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-005.html">contain-size-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-005.html" title="css/css-contain/contain-size-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-006.html">contain-size-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-006.html" title="css/css-contain/contain-size-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-007.html">contain-size-007.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-007.html" title="css/css-contain/contain-size-007.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-007.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-008.html">contain-size-008.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-008.html" title="css/css-contain/contain-size-008.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-008.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-009.html">contain-size-009.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-009.html" title="css/css-contain/contain-size-009.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-009.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-010.html">contain-size-010.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-010.html" title="css/css-contain/contain-size-010.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-010.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-012.html">contain-size-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-012.html" title="css/css-contain/contain-size-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-012b.html">contain-size-012b.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-012b.html" title="css/css-contain/contain-size-012b.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-012b.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-051.html">contain-size-051.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-051.html" title="css/css-contain/contain-size-051.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-051.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-052.html">contain-size-052.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-052.html" title="css/css-contain/contain-size-052.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-052.html"><small>(source)</small></a>
</ul>
<p class="note" role="note"><span>Note:</span> Internal table boxes,
which do not include table captions,
are excluded,
because the table layout algorithm
does not allow boxes to become smaller than their inflow content.
Sizing a table cell as if it was empty and then layout out its content inside without changing the size
is effectively an undefined operation.
Manually setting the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width">width</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height">height</a> properties to <span class="css">0</span> cannot make it smaller than its content.
This concern does not apply to table captions,
which are perfectly capable of having a fixed size
that is independent of their content.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-011.html">contain-size-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-011.html" title="css/css-contain/contain-size-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-056.html">contain-size-056.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-056.html" title="css/css-contain/contain-size-056.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-056.html"><small>(source)</small></a>
</ul>
<ol>
<li data-md>
<p>When calculating the size of the <a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box">containing box</a>,
it must be treated as having no contents.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-021.html">contain-size-021.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-021.html" title="css/css-contain/contain-size-021.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-021.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-023.html">contain-size-023.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-023.html" title="css/css-contain/contain-size-023.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-023.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-025.html">contain-size-025.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-025.html" title="css/css-contain/contain-size-025.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-025.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-027.html">contain-size-027.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-027.html" title="css/css-contain/contain-size-027.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-027.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-061.html">contain-size-061.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-061.html" title="css/css-contain/contain-size-061.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-061.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-062.html">contain-size-062.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-062.html" title="css/css-contain/contain-size-062.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-062.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-borders.html">contain-size-borders.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-borders.html" title="css/css-contain/contain-size-borders.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-borders.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-fieldset-001.html">contain-size-fieldset-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-fieldset-001.html" title="css/css-contain/contain-size-fieldset-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-fieldset-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-fieldset-002.html">contain-size-fieldset-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-fieldset-002.html" title="css/css-contain/contain-size-fieldset-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-fieldset-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-select-001.html">contain-size-select-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-select-001.html" title="css/css-contain/contain-size-select-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-select-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-select-002.html">contain-size-select-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-select-002.html" title="css/css-contain/contain-size-select-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-select-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-001.html">contain-size-scrollbars-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-001.html" title="css/css-contain/contain-size-scrollbars-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-002.html">contain-size-scrollbars-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-002.html" title="css/css-contain/contain-size-scrollbars-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-scrollbars-003.html">contain-size-scrollbars-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-scrollbars-003.html" title="css/css-contain/contain-size-scrollbars-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-scrollbars-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-button-001.html">contain-size-button-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-button-001.html" title="css/css-contain/contain-size-button-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-button-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-flexbox-001.html">contain-size-flexbox-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-flexbox-001.html" title="css/css-contain/contain-size-flexbox-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-flexbox-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-flexbox-002.html">contain-size-flexbox-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-flexbox-002.html" title="css/css-contain/contain-size-flexbox-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-flexbox-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-grid-001.html">contain-size-grid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-grid-001.html" title="css/css-contain/contain-size-grid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-grid-001.html"><small>(source)</small></a>
</ul>
<p class="note" role="note"><span>Note:</span> Even when the element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-sizing-3/#sizing-property" id="ref-for-sizing-property">sizing properties</a> are <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto">auto</a> this does not necessarily make the element zero-sized:
properties set on the element itself,
such as the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-multicol-1/#propdef-columns" id="ref-for-propdef-columns">columns</a> property or the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-grid-1/#propdef-grid" id="ref-for-propdef-grid">grid</a> property,
continue to be taken into account.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-grid-002.html">contain-size-grid-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-grid-002.html" title="css/css-contain/contain-size-grid-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-grid-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-grid-003.html">contain-size-grid-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-grid-003.html" title="css/css-contain/contain-size-grid-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-grid-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-multicol-001.html">contain-size-multicol-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-multicol-001.html" title="css/css-contain/contain-size-multicol-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-multicol-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-multicol-as-flex-item.html">contain-size-multicol-as-flex-item.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-multicol-as-flex-item.html" title="css/css-contain/contain-size-multicol-as-flex-item.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-multicol-as-flex-item.html"><small>(source)</small></a>
</ul>
<p>Then,
its contents must then be laid out into the <a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box①">containing box</a>'s resolved size.</p>
<p class="note" role="note"><span>Note:</span> <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment④">size containment</a> does not suppress baseline alignment.
See <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment①">layout containment</a> for that.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-baseline-001.html">contain-size-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-baseline-001.html" title="css/css-contain/contain-size-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-baseline-001.html"><small>(source)</small></a>
</ul>
<p><a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#replaced-element" id="ref-for-replaced-element">Replaced elements</a> must be treated as having an intrinsic width and height of 0.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-013.html">contain-size-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-013.html" title="css/css-contain/contain-size-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-041.html">contain-size-041.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-041.html" title="css/css-contain/contain-size-041.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-041.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-042.html">contain-size-042.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-042.html" title="css/css-contain/contain-size-042.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-042.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-001.html">contain-size-replaced-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-001.html" title="css/css-contain/contain-size-replaced-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-002.html">contain-size-replaced-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-002.html" title="css/css-contain/contain-size-replaced-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003a.html">contain-size-replaced-003a.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003a.html" title="css/css-contain/contain-size-replaced-003a.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003a.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003b.html">contain-size-replaced-003b.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003b.html" title="css/css-contain/contain-size-replaced-003b.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003b.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-003c.html">contain-size-replaced-003c.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-003c.html" title="css/css-contain/contain-size-replaced-003c.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-003c.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-004.html">contain-size-replaced-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-004.html" title="css/css-contain/contain-size-replaced-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-005.html">contain-size-replaced-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-005.html" title="css/css-contain/contain-size-replaced-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-replaced-006.html">contain-size-replaced-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-replaced-006.html" title="css/css-contain/contain-size-replaced-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-replaced-006.html"><small>(source)</small></a>
</ul>
<li data-md>
<p><a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box②">Containing boxes</a> for <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment⑤">size containment</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#monolithic" id="ref-for-monolithic">monolithic</a> (See <a href="https://www.w3.org/TR/css-break-3/#possible-breaks">CSS Fragmentation Module Level 3 §possible-breaks</a>).</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-breaks-001.html">contain-size-breaks-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-breaks-001.html" title="css/css-contain/contain-size-breaks-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-breaks-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-size-monolithic-001.html">contain-size-monolithic-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-size-monolithic-001.html" title="css/css-contain/contain-size-monolithic-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-size-monolithic-001.html"><small>(source)</small></a>
</ul>
</ol>
<p>By itself, <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment⑥">size containment</a> does not offer much optimization opportunity.
Its primary benefit on its own is that tools which want to lay out the containing box’s contents
based on the containing box’s size
(such as a JS library implementing the "container query" concept)
can do so without fear of "infinite loops",
where having a child’s size respond to the size of the containing box
causes the containing box’s size to change as well,
possibly triggering <em>further</em> changes in how the child sizes itself
and possibly thus more changes to the containing box’s size,
ad infinitum.</p>
<p>When paired with <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment②">layout containment</a>, though,
possible optimizations that can be enabled include (but are not limited to):</p>
<ol>
<li data-md>
<p>When the style or contents of a descendant of the containing box is changed,
calculating what part of the DOM tree is "dirtied" and might need to be re-laid out
can stop at the containing box.</p>
<li data-md>
<p>When laying out the page,
if the containing box is off-screen or obscured,
the layout of its contents can be delayed or done at a lower priority.</p>
</ol>
<h3 class="heading settled" data-level="3.2" id="containment-layout"><span class="secno">3.2. </span><span class="content"> Layout Containment</span><a class="self-link" href="#containment-layout"></a></h3>
<p>If the element does not generate a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#principal-box" id="ref-for-principal-box②">principal box</a> (as is the case with <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display②">display</a> values of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents" id="ref-for-valdef-display-contents">contents</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>),
or its <span id="ref-for-principal-box③">principal box</span> is an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-table-box" id="ref-for-internal-table-box①">internal table box</a> other than <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table-cell" id="ref-for-valdef-display-table-cell">table-cell</a>,
or an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-ruby-box" id="ref-for-internal-ruby-box①">internal ruby box</a>,
or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#atomic-inline" id="ref-for-atomic-inline①">non-atomic</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline-level" id="ref-for-inline-level①">inline-level</a> box,
layout containment has no effect.
Otherwise, giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="layout-containment">layout containment</dfn> makes its <span id="ref-for-principal-box④">principal box</span> a <dfn class="dfn-paneled" data-dfn-for="layout-containment" data-dfn-type="dfn" data-noexport id="layout-containment-containing-box">containing box</dfn> for <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment③">layout containment</a> and has the following effects:</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-001.html">contain-layout-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-001.html" title="css/css-contain/contain-layout-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-002.html">contain-layout-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-002.html" title="css/css-contain/contain-layout-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-003.html">contain-layout-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-003.html" title="css/css-contain/contain-layout-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-004.html">contain-layout-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-004.html" title="css/css-contain/contain-layout-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-005.html">contain-layout-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-005.html" title="css/css-contain/contain-layout-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-005.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-009.html">contain-layout-009.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-009.html" title="css/css-contain/contain-layout-009.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-009.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-010.html">contain-layout-010.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-010.html" title="css/css-contain/contain-layout-010.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-010.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-011.html">contain-layout-011.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-011.html" title="css/css-contain/contain-layout-011.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-011.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-012.html">contain-layout-012.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-012.html" title="css/css-contain/contain-layout-012.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-012.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-013.html">contain-layout-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-013.html" title="css/css-contain/contain-layout-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-014.html">contain-layout-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-014.html" title="css/css-contain/contain-layout-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-003.html">contain-layout-independent-formatting-context-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-003.html" title="css/css-contain/contain-layout-independent-formatting-context-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-003.html"><small>(source)</small></a>
</ul>
<ol>
<li data-md>
<p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box">containing box</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#establish-an-independent-formatting-context" id="ref-for-establish-an-independent-formatting-context">establishes an independent formatting context</a>.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ifc-022.html">contain-layout-ifc-022.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ifc-022.html" title="css/css-contain/contain-layout-ifc-022.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ifc-022.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-001.html">contain-layout-independent-formatting-context-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-001.html" title="css/css-contain/contain-layout-independent-formatting-context-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-independent-formatting-context-002.html">contain-layout-independent-formatting-context-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-independent-formatting-context-002.html" title="css/css-contain/contain-layout-independent-formatting-context-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-independent-formatting-context-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-subgrid-001.html">contain-subgrid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-subgrid-001.html" title="css/css-contain/contain-subgrid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-subgrid-001.html"><small>(source)</small></a>
</ul>
<li data-md>
<p>If at least one <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-container" id="ref-for-fragmentation-container">fragmentation container</a> of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-context" id="ref-for-fragmentation-context">fragmentation context</a> has <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment④">layout containment</a>,
or if at least one <span id="ref-for-fragmentation-container①">fragmentation container</span> of a <span id="ref-for-fragmentation-context①">fragmentation context</span> is a descendant of <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box①">containing box</a> for layout containment <strong>and</strong> at least one subsequent <span id="ref-for-fragmentation-container②">fragmentation container</span> of the same <span id="ref-for-fragmentation-context②">fragmentation context</span> is not a descendant of that same element with layout containment,
then the first <span id="ref-for-layout-containment-containing-box②">containing box</span> for <span id="ref-for-layout-containment⑤">layout containment</span> which is either a <span id="ref-for-fragmentation-container③">fragmentation container</span> itself
or is an ancestor of a <span id="ref-for-fragmentation-container④">fragmentation container</span> must “trap” the remainder of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmented-flow" id="ref-for-fragmented-flow">fragmented flow</a>: <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation" id="ref-for-fragmentation">fragmentation</a> must not continue past the <span id="ref-for-layout-containment⑥">layout containment</span> boundary,
and the last <span id="ref-for-fragmentation-container⑤">fragmentation container</span> within the first <span id="ref-for-layout-containment⑦">layout containment</span> boundary
is treated as if it is the last <span id="ref-for-fragmentation-container⑥">fragmentation container</span> in its <span id="ref-for-fragmentation-context③">fragmentation context</span>.</p>
<p>If subsequent <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-container" id="ref-for-fragmentation-container⑦">fragmentation containers</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-context" id="ref-for-fragmentation-context④">fragmentation context</a> are only generated when more content remains in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmented-flow" id="ref-for-fragmented-flow①">fragmented flow</a>,
then they are not generated.
If they would exist regardless,
they remain part of the <span id="ref-for-fragmentation-context⑤">fragmentation context</span>,
but do not receive any content from the <span id="ref-for-fragmented-flow②">fragmented flow</span>.</p>
<p class="note" role="note"><span>Note:</span> At the time of writing, no stable specification is affected by this point.
Only specifications that would enable some (but not all) fragmentation containers of a fragmentation context
to be layout-contained (or descendants of a layout contained element)
are concerned.
This is not the case of <a data-link-type="biblio" href="#biblio-css-page-3">[CSS-PAGE-3]</a> nor of <a data-link-type="biblio" href="#biblio-css-multicol-1">[CSS-MULTICOL-1]</a>.
This requirement is nonetheless included because
several mechanisms that would make this a possibility have been considered
(e.g.: <a data-link-type="biblio" href="#biblio-css-regions-1">[CSS-REGIONS-1]</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#selectordef-nth-fragment" id="ref-for-selectordef-nth-fragment">::nth-fragment()</a>, a hypothetical selector for individual columns of a multicol…),
and the guarantees that layout containment is intended to offer would not be realized
if such mechanisms did not abide by this rule. <span>[CSS-REGIONS-1]</span> has details over how <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment⑧">layout containment</a> affects
regions.</p>
<div class="example" id="example-328aa2be">
<a class="self-link" href="#example-328aa2be"></a>
<pre><code class="highlight"><c- p><</c-><c- f>article</c-><c- p>></c->Lorem ipsum…<c- p></</c-><c- f>article</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>a</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
<c- p><</c-><c- f>aside</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>b</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>c</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
<c- p></</c-><c- f>aside</c-><c- p>></c->
<c- p><</c-><c- f>aside</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>d</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>e</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
<c- p></</c-><c- f>aside</c-><c- p>></c->
<c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>f</c-><c- p>></</c-><c- f>div</c-><c- p>></c->
</code></pre>
<pre><code class="highlight"><c- f>article </c-><c- p>{</c-><c- k>flow-into</c-><c- p>:</c-> foo<c- p>;}</c->
<c- f>#a, #b, #c, #d, #e, #f </c-><c- p>{</c-><c- k>flow-from</c-><c- p>:</c-> foo<c- p>;}</c->
<c- f>aside </c-><c- p>{</c-><c- k>contain</c-><c- p>:</c-> layout<c- p>}</c->
</code></pre>
<p>In this <a data-link-type="biblio" href="#biblio-css-regions-1">[CSS-REGIONS-1]</a> example,
content can flow from <code>#a</code> to <code>#b</code>,
from <code>#b</code> to <code>#c</code>.
However as <code>#c</code> is the last fragment container in the first containing box for layout containment,
it traps all the remaining content,
and nothing gets flowed into <code>#d</code>, <code>#e</code>, or <code>#f</code>.</p>
</div>
<li data-md>
<p>If the computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a> property is
either <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible" id="ref-for-valdef-overflow-visible">visible</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip" id="ref-for-valdef-overflow-clip">clip</a> or a combination thereof,
any overflow must be treated as <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#ink-overflow" id="ref-for-ink-overflow">ink overflow</a>.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-013.html">contain-layout-ink-overflow-013.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-013.html" title="css/css-contain/contain-layout-ink-overflow-013.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-013.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-014.html">contain-layout-ink-overflow-014.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-014.html" title="css/css-contain/contain-layout-ink-overflow-014.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-014.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-015.html">contain-layout-ink-overflow-015.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-015.html" title="css/css-contain/contain-layout-ink-overflow-015.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-015.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-016.html">contain-layout-ink-overflow-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-016.html" title="css/css-contain/contain-layout-ink-overflow-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-017.html">contain-layout-ink-overflow-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-017.html" title="css/css-contain/contain-layout-ink-overflow-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-018.html">contain-layout-ink-overflow-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-018.html" title="css/css-contain/contain-layout-ink-overflow-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-018.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-019.html">contain-layout-ink-overflow-019.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-019.html" title="css/css-contain/contain-layout-ink-overflow-019.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-019.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-ink-overflow-020.html">contain-layout-ink-overflow-020.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-ink-overflow-020.html" title="css/css-contain/contain-layout-ink-overflow-020.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-ink-overflow-020.html"><small>(source)</small></a>
</ul>
<li data-md>
<p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box③">containing box</a> acts as a containing block for absolutely positioned and fixed positioned descendants.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-006.html">contain-layout-006.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-006.html" title="css/css-contain/contain-layout-006.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-006.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-007.html">contain-layout-007.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-007.html" title="css/css-contain/contain-layout-007.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-007.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-cell-001.html">contain-layout-cell-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-cell-001.html" title="css/css-contain/contain-layout-cell-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-cell-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-cell-002.html">contain-layout-cell-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-cell-002.html" title="css/css-contain/contain-layout-cell-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-cell-002.html"><small>(source)</small></a>
</ul>
<li data-md>
<p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box④">containing box</a> creates a <a data-link-type="dfn" href="https://drafts.csswg.org/css2/visuren.html#x43" id="ref-for-x43">stacking context</a>.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-016.html">contain-layout-016.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-016.html" title="css/css-contain/contain-layout-016.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-016.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-017.html">contain-layout-017.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-017.html" title="css/css-contain/contain-layout-017.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-017.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-018.html">contain-layout-018.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-018.html" title="css/css-contain/contain-layout-018.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-018.html"><small>(source)</small></a>
</ul>
<li data-md>
<p><a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#forced-break" id="ref-for-forced-break">Forced breaks</a> are allowed within <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box⑤">containing boxes</a> for <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment⑨">layout containment</a>,
but do not propagate to the parent as otherwise described in <a href="https://www.w3.org/TR/css-break-3/#break-between">CSS Fragmentation Module Level 3 §break-between</a>.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-breaks-001.html">contain-layout-breaks-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-breaks-001.html" title="css/css-contain/contain-layout-breaks-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-breaks-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-breaks-002.html">contain-layout-breaks-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-breaks-002.html" title="css/css-contain/contain-layout-breaks-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-breaks-002.html"><small>(source)</small></a>
</ul>
<p class="note" role="note"><span>Note:</span> This introduces the previously non-existent possibility that <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#forced-break" id="ref-for-forced-break①">forced breaks</a> may occur between a box and its container (See <a href="https://www.w3.org/TR/css-break-3/#possible-breaks">CSS Fragmentation Module Level 3 §possible-breaks</a>).</p>
<li data-md>
<p>For the purpose of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align" id="ref-for-propdef-vertical-align">vertical-align</a> property,
or any other property whose effects
need to relate the position of the <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box⑥">containing box</a>'s baseline
to something other than its descendants,
the <span id="ref-for-layout-containment-containing-box⑦">containing box</span> is treated as having no baseline.</p>
<ul class="wpt-tests-block">
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-001.html">contain-layout-baseline-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-001.html" title="css/css-contain/contain-layout-baseline-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-button-001.html">contain-layout-button-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-button-001.html" title="css/css-contain/contain-layout-button-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-button-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-flexbox-001.html">contain-layout-flexbox-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-flexbox-001.html" title="css/css-contain/contain-layout-flexbox-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-flexbox-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-grid-001.html">contain-layout-grid-001.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-grid-001.html" title="css/css-contain/contain-layout-grid-001.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-grid-001.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-002.html">contain-layout-baseline-002.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-002.html" title="css/css-contain/contain-layout-baseline-002.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-002.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-003.html">contain-layout-baseline-003.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-003.html" title="css/css-contain/contain-layout-baseline-003.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-003.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-004.html">contain-layout-baseline-004.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-004.html" title="css/css-contain/contain-layout-baseline-004.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-004.html"><small>(source)</small></a>
<li class="wpt-test"><a href="https://wpt.fyi/results/css/css-contain/contain-layout-baseline-005.html">contain-layout-baseline-005.html</a> <a href="http://web-platform-tests.live/css/css-contain/contain-layout-baseline-005.html" title="css/css-contain/contain-layout-baseline-005.html"><small>(live test)</small></a> <a href="https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/contain-layout-baseline-005.html"><small>(source)</small></a>
</ul>
</ol>
<p>Possible optimizations that can be enabled by <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment①⓪">layout containment</a> include (but are not limited to):</p>
<ol>
<li data-md>
<p>When laying out the page,
the contents of separate containing boxes
can be laid out in parallel,