Skip to content

Commit c3c7393

Browse files
committed
[css-contain-2][css-contain-3] Rephrase containment exceptions into a list, and move to bottom of each section.
1 parent cf75d0c commit c3c7393

2 files changed

Lines changed: 86 additions & 64 deletions

File tree

css-contain-2/Overview.bs

Lines changed: 73 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -506,49 +506,7 @@ Types of Containment</h2>
506506
<h3 id='containment-size'>
507507
Size Containment</h3>
508508

509-
If the element does not generate a <a>principal box</a> (as is the case with ''display: contents'' or ''display: none''),
510-
or its [=inner display type=] is ''display/table'',
511-
or its principal box is an <a spec="css-display-3">internal table box</a>,
512-
or an <a spec="css-display-3">internal ruby box</a>,
513-
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
514-
size containment has no effect.
515-
516-
<wpt>
517-
contain-size-001.html
518-
contain-size-002.html
519-
contain-size-003.html
520-
contain-size-004.html
521-
contain-size-005.html
522-
contain-size-006.html
523-
contain-size-007.html
524-
contain-size-008.html
525-
contain-size-009.html
526-
contain-size-010.html
527-
contain-size-012.html
528-
contain-size-012b.html
529-
contain-size-051.html
530-
contain-size-052.html
531-
</wpt>
532-
533-
Note: Internal table boxes,
534-
which do not include table captions,
535-
are excluded,
536-
because the table layout algorithm
537-
does not allow boxes to become smaller than their inflow content.
538-
Sizing a table cell as if it was empty and then layout out its content inside without changing the size
539-
is effectively an undefined operation.
540-
Manually setting the 'width' or 'height' properties to ''0''
541-
cannot make it smaller than its content.
542-
This concern does not apply to table captions,
543-
which are perfectly capable of having a fixed size
544-
that is independent of their content.
545-
546-
<wpt>
547-
contain-size-011.html
548-
contain-size-056.html
549-
</wpt>
550-
551-
Otherwise, giving an element <dfn export>size containment</dfn>
509+
Giving an element <dfn export>size containment</dfn>
552510
makes its [=principal box=] a <dfn>size containment box</dfn>
553511
and has the following effects:
554512

@@ -700,6 +658,52 @@ Size Containment</h3>
700658
and its [=natural height=] is treated as 0.
701659
</div>
702660

661+
However, giving an element [=size containment=]
662+
has no effect if any of the following are true:
663+
664+
* if the element does not generate a <a>principal box</a>
665+
(as is the case with ''display: contents'' or ''display: none'')
666+
* if its [=inner display type=] is ''display/table''
667+
* if its [=principal box=] is
668+
an <a spec="css-display-3">internal table box</a>
669+
* if its [=principal box=] is
670+
an <a spec="css-display-3">internal ruby box</a>
671+
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box
672+
673+
<wpt>
674+
contain-size-001.html
675+
contain-size-002.html
676+
contain-size-003.html
677+
contain-size-004.html
678+
contain-size-005.html
679+
contain-size-006.html
680+
contain-size-007.html
681+
contain-size-008.html
682+
contain-size-009.html
683+
contain-size-010.html
684+
contain-size-012.html
685+
contain-size-012b.html
686+
contain-size-051.html
687+
contain-size-052.html
688+
</wpt>
689+
690+
Note: Internal table boxes,
691+
which do not include table captions,
692+
are excluded,
693+
because the table layout algorithm
694+
does not allow boxes to become smaller than their inflow content.
695+
Sizing a table cell as if it was empty and then laying out its content inside without changing the size
696+
is effectively an undefined operation.
697+
Manually setting the 'width' or 'height' properties to ''0''
698+
cannot make it smaller than its content.
699+
This concern does not apply to table captions,
700+
which are perfectly capable of having a fixed size
701+
that is independent of their content.
702+
703+
<wpt>
704+
contain-size-011.html
705+
contain-size-056.html
706+
</wpt>
703707

704708
<h4 id='containment-size-opt' class="no-toc">
705709
Possible Size-Containment Optimizations</h4>
@@ -731,12 +735,7 @@ Possible Size-Containment Optimizations</h4>
731735
<h3 id='containment-layout'>
732736
Layout Containment</h3>
733737

734-
If the element does not generate a <a>principal box</a> (as is the case with 'display' values of ''display/contents'' or ''display/none''),
735-
or its [=principal box=] is an <a spec="css-display-3">internal table box</a> other than ''display/table-cell'',
736-
or an <a spec="css-display-3">internal ruby box</a>,
737-
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
738-
layout containment has no effect.
739-
Otherwise, giving an element <dfn export>layout containment</dfn>
738+
Giving an element <dfn export>layout containment</dfn>
740739
makes its [=principal box=] a <dfn>layout containment box</dfn>
741740
and has the following effects:
742741

@@ -886,6 +885,18 @@ Layout Containment</h3>
886885
contain-layout-baseline-005.html
887886
</wpt>
888887

888+
However, giving an element [=layout containment=]
889+
has no effect if any of the following are true:
890+
891+
* if the element does not generate a <a>principal box</a>
892+
(as is the case with ''display: contents'' or ''display: none'')
893+
* if its [=principal box=] is
894+
an <a spec="css-display-3">internal table box</a>
895+
other than ''display/table-cell''
896+
* if its [=principal box=] is
897+
an <a spec="css-display-3">internal ruby box</a>
898+
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box
899+
889900
<h4 id='containment-layout-opt' class="no-toc">
890901
Possible Layout-Containment Optimizations</h4>
891902

@@ -1017,12 +1028,7 @@ Possible Style-Containment Optimizations</h4>
10171028
<h3 id='containment-paint'>
10181029
Paint Containment</h3>
10191030

1020-
If the element does not generate a <a>principal box</a> (as is the case with 'display' values of ''display/contents'' or ''display/none''),
1021-
or its [=principal box=] is an <a spec="css-display-3">internal table box</a> other than ''display/table-cell'',
1022-
or an <a spec="css-display-3">internal ruby box</a>,
1023-
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
1024-
paint containment has no effect.
1025-
Otherwise, giving an element <dfn export>paint containment</dfn>
1031+
Giving an element <dfn export>paint containment</dfn>
10261032
makes its [=principal box=] a <dfn>paint containment box</dfn>
10271033
and has the following effects:
10281034

@@ -1111,6 +1117,18 @@ Paint Containment</h3>
11111117
contain-paint-baseline-001.html
11121118
</wpt>
11131119

1120+
However, giving an element [=paint containment=]
1121+
has no effect if any of the following are true:
1122+
1123+
* if the element does not generate a <a>principal box</a>
1124+
(as is the case with ''display: contents'' or ''display: none'')
1125+
* if its [=principal box=] is
1126+
an <a spec="css-display-3">internal table box</a>
1127+
other than ''display/table-cell''
1128+
* if its [=principal box=] is
1129+
an <a spec="css-display-3">internal ruby box</a>
1130+
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box
1131+
11141132
<h4 id='containment-paint-opt' class="no-toc">
11151133
Possible Paint-Containment Optimizations</h4>
11161134

css-contain-3/Overview.bs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,7 @@ Types of Containment</h2>
100100
<h3 id='containment-inline-size'>
101101
Inline-Size Containment</h3>
102102

103-
If the element does not generate a <a>principal box</a>
104-
(as is the case with ''display: contents'' or ''display: none''),
105-
or its [=inner display type=] is ''display/table'',
106-
or its [=principal box=] is an <a spec="css-display-3">internal table box</a>,
107-
or an <a spec="css-display-3">internal ruby box</a>,
108-
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
109-
[=inline-size containment=] has no effect.
110-
111-
Otherwise, giving an element <dfn export>inline-size containment</dfn>
103+
Giving an element <dfn export>inline-size containment</dfn>
112104
applies [=size containment=] to the [=inline-axis=] sizing of its [=principal box=].
113105
This means the [=inline-axis=] [=intrinsic sizes=] of the [=principal box=]
114106
are determined as if the element had no content.
@@ -242,6 +234,18 @@ Inline-Size Containment</h3>
242234
</div>
243235
</div>
244236

237+
However, giving an element [=inline-size containment=]
238+
has no effect if any of the following are true:
239+
240+
* if the element does not generate a <a>principal box</a>
241+
(as is the case with ''display: contents'' or ''display: none'')
242+
* if its [=inner display type=] is ''display/table''
243+
* if its [=principal box=] is
244+
an <a spec="css-display-3">internal table box</a>
245+
* if its [=principal box=] is
246+
an <a spec="css-display-3">internal ruby box</a>
247+
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box
248+
245249
Issue(1031): Define inline-size containment in more detail
246250
(including additional examples)
247251

0 commit comments

Comments
 (0)