Skip to content

Commit d5afb6d

Browse files
committed
[css-contain=] improve terminology
Closes #5590
1 parent 7aac0a7 commit d5afb6d

File tree

2 files changed

+79
-76
lines changed

2 files changed

+79
-76
lines changed

css-contain-1/Overview.bs

+39-37
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Strong Containment: the 'contain' property</h2>
151151
<dt><dfn>size</dfn>
152152
<dd>
153153
The value turns on <a>size containment</a> for the element.
154-
This ensures that the containing box can be laid out
154+
This ensures that the [=size containment box|containment box=] can be laid out
155155
without needing to examine its descendants.
156156

157157
<wpt>
@@ -218,7 +218,7 @@ Strong Containment: the 'contain' property</h2>
218218
<dt><dfn>layout</dfn>
219219
<dd>
220220
This value turns on <a>layout containment</a> for the element.
221-
This ensures that the containing box is <em>totally opaque</em> for layout purposes;
221+
This ensures that the [=layout containment box|containment box=] is <em>totally opaque</em> for layout purposes;
222222
nothing outside can affect its internal layout,
223223
and vice versa.
224224

@@ -270,7 +270,7 @@ Strong Containment: the 'contain' property</h2>
270270
<dt><dfn>paint</dfn>
271271
<dd>
272272
This value turns on <a>paint containment</a> for the element.
273-
This ensures that the descendants of the containing box don't display outside its bounds,
273+
This ensures that the descendants of the [=paint containment box|containment box] don't display outside its bounds,
274274
so if an element is off-screen or otherwise not visible,
275275
its descendants are also guaranteed to be not visible.
276276
@@ -389,7 +389,7 @@ Size Containment</h3>
389389
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
390390
size containment has no effect.
391391
Otherwise, giving an element <dfn export>size containment</dfn>
392-
makes its [=principal box=] a <dfn for="size containment">containing box</dfn> for [=size containment=]
392+
makes its [=principal box=] a <dfn>size containment box</dfn>
393393
and has the following effects:
394394

395395
<wpt>
@@ -427,7 +427,7 @@ Size Containment</h3>
427427
contain-size-056.html
428428
</wpt>
429429

430-
1. When calculating the size of the [=size containment/containing box=],
430+
1. When calculating the size of the [=size containment box=],
431431
including when computing its [=intrinsic size=],
432432
it must be treated as having no contents.
433433

@@ -469,7 +469,7 @@ Size Containment</h3>
469469
</wpt>
470470

471471
Then,
472-
its contents must then be laid out into the [=size containment/containing box=]'s resolved size normally (including any pseudo-elements),
472+
its contents must then be laid out into the [=size containment box=]'s resolved size normally (including any pseudo-elements),
473473
i.e. [=size containment=] has no effect in this phase.
474474

475475
Note: [=size containment=] does not suppress baseline alignment.
@@ -495,36 +495,36 @@ Size Containment</h3>
495495
contain-size-replaced-006.html
496496
</wpt>
497497

498-
2. [=size containment/Containing boxes=] for <a>size containment</a> must be treated
498+
2. [=Size containment boxes=] must be treated
499499
as if they had no [=intrinsic aspect ratio=].
500500

501-
3. [=size containment/Containing boxes=] for <a>size containment</a> are <a spec=css-break-3>monolithic</a> (See [[CSS-BREAK-3#possible-breaks]]).
501+
3. [=Size containment boxes=] are <a spec=css-break-3>monolithic</a> (See [[CSS-BREAK-3#possible-breaks]]).
502502

503503
<wpt>
504504
contain-size-breaks-001.html
505505
contain-size-monolithic-001.html
506506
</wpt>
507507

508508
By itself, <a>size containment</a> does not offer much optimization opportunity.
509-
Its primary benefit on its own is that tools which want to lay out the containing box's contents
510-
based on the containing box's size
509+
Its primary benefit on its own is that tools which want to lay out the [=size containment box|containment box=]'s contents
510+
based on the [=size containment box|containment box=]'s size
511511
(such as a JS library implementing the "container query" concept)
512512
can do so without fear of "infinite loops",
513-
where having a child's size respond to the size of the containing box
514-
causes the containing box's size to change as well,
513+
where having a child's size respond to the size of the [=size containment box|containment box=]
514+
causes the [=size containment box|containment box=]'s size to change as well,
515515
possibly triggering <em>further</em> changes in how the child sizes itself
516-
and possibly thus more changes to the containing box's size,
516+
and possibly thus more changes to the [=size containment box|containment box=]'s size,
517517
ad infinitum.
518518

519519
When paired with <a>layout containment</a>, though,
520520
possible optimizations that can be enabled include (but are not limited to):
521521

522-
1. When the style or contents of a descendant of the containing box is changed,
522+
1. When the style or contents of a descendant of the [=size containment box|containment box=] is changed,
523523
calculating what part of the DOM tree is "dirtied" and might need to be re-laid out
524-
can stop at the containing box.
524+
can stop at the [=size containment box|containment box=].
525525

526526
2. When laying out the page,
527-
if the containing box is off-screen or obscured,
527+
if the [=size containment box|containment box=] is off-screen or obscured,
528528
the layout of its contents can be delayed or done at a lower priority.
529529

530530
<h3 id='containment-layout'>
@@ -536,7 +536,7 @@ Layout Containment</h3>
536536
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
537537
layout containment has no effect.
538538
Otherwise, giving an element <dfn export>layout containment</dfn>
539-
makes its [=principal box=] a <dfn for="layout containment">containing box</dfn> for [=layout containment=]
539+
makes its [=principal box=] a <dfn>layout containment box</dfn>
540540
and has the following effects:
541541

542542
<wpt>
@@ -554,7 +554,7 @@ Layout Containment</h3>
554554
contain-layout-independent-formatting-context-003.html
555555
</wpt>
556556

557-
1. The [=layout containment/containing box=] [=establishes an independent formatting context=].
557+
1. The [=layout containment box=] [=establishes an independent formatting context=].
558558

559559
<wpt>
560560
contain-layout-ifc-022.html
@@ -564,10 +564,10 @@ Layout Containment</h3>
564564
</wpt>
565565

566566
2. If at least one [=fragmentation container=] of a [=fragmentation context=] has [=layout containment=],
567-
or if at least one [=fragmentation container=] of a [=fragmentation context=] is a descendant of [=layout containment/containing box=] for layout containment
567+
or if at least one [=fragmentation container=] of a [=fragmentation context=] is a descendant of [=layout containment box=]
568568
<strong>and</strong> at least one subsequent [=fragmentation container=] of the same [=fragmentation context=]
569569
is not a descendant of that same element with layout containment,
570-
then the first [=layout containment/containing box=] for [=layout containment=]
570+
then the first [=layout containment box=]
571571
which is either a [=fragmentation container=] itself
572572
or is an ancestor of a [=fragmentation container=]
573573
must “trap” the remainder of the [=fragmented flow=]:
@@ -620,7 +620,7 @@ Layout Containment</h3>
620620
In this [[CSS-REGIONS-1]] example,
621621
content can flow from <code>#a</code> to <code>#b</code>,
622622
from <code>#b</code> to <code>#c</code>.
623-
However as <code>#c</code> is the last fragment container in the first containing box for layout containment,
623+
However as <code>#c</code> is the last fragment container in the first [=layout containment box=]
624624
it traps all the remaining content,
625625
and nothing gets flowed into <code>#d</code>, <code>#e</code>, or <code>#f</code>.
626626
</div>
@@ -640,7 +640,7 @@ Layout Containment</h3>
640640
contain-layout-ink-overflow-020.html
641641
</wpt>
642642

643-
4. The [=layout containment/containing box=] acts as a containing block for absolutely positioned and fixed positioned descendants.
643+
4. The [=layout containment box=] acts as a containing block for absolutely positioned and fixed positioned descendants.
644644

645645
<wpt>
646646
contain-layout-006.html
@@ -649,15 +649,15 @@ Layout Containment</h3>
649649
contain-layout-cell-002.html
650650
</wpt>
651651

652-
5. The [=layout containment/containing box=] creates a <a>stacking context</a>.
652+
5. The [=layout containment box=] creates a <a>stacking context</a>.
653653

654654
<wpt>
655655
contain-layout-016.html
656656
contain-layout-017.html
657657
contain-layout-018.html
658658
</wpt>
659659

660-
6. [=Forced breaks=] are allowed within [=layout containment/containing boxes=] for [=layout containment=],
660+
6. [=Forced breaks=] are allowed within [=layout containment boxes=]
661661
but do not propagate to the parent as otherwise described in [[CSS-BREAK-3#break-between]].
662662

663663
<wpt>
@@ -670,9 +670,9 @@ Layout Containment</h3>
670670

671671
7. For the purpose of the 'vertical-align' property,
672672
or any other property whose effects
673-
need to relate the position of the [=layout containment/containing box=]'s baseline
673+
need to relate the position of the [=layout containment box=]'s baseline
674674
to something other than its descendants,
675-
the [=layout containment/containing box=] is treated as having no baseline.
675+
the [=layout containment box|containment box=] is treated as having no baseline.
676676

677677
<wpt>
678678
contain-layout-baseline-001.html
@@ -688,16 +688,16 @@ Layout Containment</h3>
688688
Possible optimizations that can be enabled by <a>layout containment</a> include (but are not limited to):
689689

690690
1. When laying out the page,
691-
the contents of separate containing boxes
691+
the contents of separate [=layout containment boxes|containment boxes=]
692692
can be laid out in parallel,
693693
as they're guaranteed not to affect each other.
694694

695695
2. When laying out the page,
696-
if the containing box is off-screen or obscured
697-
and the layout of the visible parts of the screen do not depend on the size of the containing box
698-
(for example, if the containing box is near the end of a block container,
696+
if the [=layout containment box|containment box] is off-screen or obscured
697+
and the layout of the visible parts of the screen do not depend on the size of the [=layout containment box|containment box=]
698+
(for example, if the [=layout containment box|containment box=] is near the end of a block container,
699699
and you're viewing the beginning of the block container),
700-
the layout of the containing box' contents can be delayed or done at a lower priority.
700+
the layout of the [=layout containment box|containment box]' contents can be delayed or done at a lower priority.
701701
702702
(When paired with <a>size containment</a>,
703703
this optimization can be applied more liberally.)
@@ -711,7 +711,7 @@ Paint Containment</h3>
711711
or a <a spec="css-display-3" lt="atomic inline">non-atomic</a> <a spec="css-display-3">inline-level</a> box,
712712
paint containment has no effect.
713713
Otherwise, giving an element <dfn export>paint containment</dfn>
714-
makes its [=principal box=] a <dfn for="paint containment">containing box</dfn> for [=paint containment=]
714+
makes its [=principal box=] a <dfn>paint containment box</dfn>
715715
and has the following effects:
716716

717717
<wpt>
@@ -733,7 +733,7 @@ Paint Containment</h3>
733733

734734
1. The contents of the element
735735
including any [=ink overflow|ink=] or [=scrollable overflow=]
736-
must be clipped to the <a>padding edge</a> of the [=paint containment/containing box=],
736+
must be clipped to the <a>padding edge</a> of the [=paint containment box=],
737737
taking <a>corner clipping</a> into account.
738738
This does not include the creation of any mechanism
739739
to access or indicate the presence of the clipped content;
@@ -772,7 +772,7 @@ Paint Containment</h3>
772772
contain-paint-table-001.html
773773
contain-paint-table-002.html
774774
</wpt>
775-
2. The [=paint containment/containing box=] acts as a containing block for absolutely positioned and fixed positioned descendants.
775+
2. The [=paint containment box=] acts as a containing block for absolutely positioned and fixed positioned descendants.
776776

777777
<wpt>
778778
contain-paint-009.html
@@ -781,15 +781,15 @@ Paint Containment</h3>
781781
contain-paint-023.html
782782
contain-paint-024.html
783783
</wpt>
784-
3. The [=paint containment/containing box=] creates a <a>stacking context</a>.
784+
3. The [=paint containment box=] creates a <a>stacking context</a>.
785785

786786
<wpt>
787787
contain-paint-020.html
788788
contain-paint-021.html
789789
contain-paint-025.html
790790
contain-subgrid-001.html
791791
</wpt>
792-
4. The [=paint containment/containing box=] [=establishes an independent formatting context=].
792+
4. The [=paint containment box=] [=establishes an independent formatting context=].
793793

794794
<wpt>
795795
contain-paint-ifc-011.html
@@ -804,7 +804,7 @@ Paint Containment</h3>
804804
<div class=informative>
805805
Possible optimizations that can be enabled by <a>paint containment</a> include (but are not limited to):
806806

807-
1. If the containing box is off-screen or obscured,
807+
1. If the [=paint containment box|containment box=] is off-screen or obscured,
808808
the UA can directly skip trying to paint its contents,
809809
as they're guaranteed to be off-screen/obscured as well.
810810

@@ -909,6 +909,8 @@ This appendix is <em>informative</em>.
909909
<li>
910910
phrasing improvement in note in [[#containment-paint]]
911911

912+
<li>
913+
terminology change: replace "containing box" with "containment box"
912914
</ul>
913915
<li>
914916
Be explicit that size containment suppresses intrinsic aspect ratio

0 commit comments

Comments
 (0)