Skip to content

Commit d7115f4

Browse files
authored
Merge pull request #3180 from frivoal/contain-bikeshed-wpt
[css-contain-1] Add bikeshed wpt info
2 parents 2540421 + 938685f commit d7115f4

File tree

1 file changed

+218
-1
lines changed

1 file changed

+218
-1
lines changed

css-contain-1/Overview.bs

+218-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Editor: Tab Atkins, Google, http://xanthir.com/contact/, w3cid 42199
1515
Editor: Florian Rivoal, On behalf of Bloomberg, https://florian.rivoal.net/, w3cid 43241
1616
Abstract: 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.
1717
Ignored Terms: scrollWidth, scrollHeight, clientWidth, clientHeight
18+
WPT Path Prefix: css/css-contain/
1819
</pre>
1920
<pre class="anchors">
2021
spec: css2; urlPrefix: https://www.w3.org/TR/CSS2/
@@ -66,6 +67,11 @@ Strong Containment: the 'contain' property</h2>
6667
Animation type: not animatable
6768
</pre>
6869

70+
<wpt>
71+
contain-animation-001.html
72+
inheritance.html
73+
</wpt
74+
6975
<p class=all-media>User Agents are expected to support this property on all media, including non-visual ones.</p>
7076

7177
The 'contain' property allows an author to indicate that an element and its contents are,
@@ -130,6 +136,16 @@ Strong Containment: the 'contain' property</h2>
130136
its descendants are also guaranteed to be not visible.
131137
</dl>
132138

139+
<wpt>
140+
contain-layout-size-003.html
141+
contain-paint-size-001.html
142+
contain-paint-size-002.html
143+
contain-paint-size-003.html
144+
contain-strict-001.html
145+
contain-strict-002.html
146+
contain-strict-003.html
147+
</wpt>
148+
133149
<span id="contain-applies">This property generally applies to all elements (including [[css-pseudo-4#generated-content]])</span>,
134150
although some types of containment have no effect on some elements,
135151
as detailed in [[#containment-types]].
@@ -195,6 +211,22 @@ Size Containment</h3>
195211
size containment has no effect.
196212
Otherwise, giving an element <dfn export>size containment</dfn> has the following effects:
197213

214+
<wpt>
215+
contain-size-001.html
216+
contain-size-002.html
217+
contain-size-003.html
218+
contain-size-004.html
219+
contain-size-005.html
220+
contain-size-006.html
221+
contain-size-007.html
222+
contain-size-008.html
223+
contain-size-009.html
224+
contain-size-010.html
225+
contain-size-012.html
226+
contain-size-051.html
227+
contain-size-052.html
228+
</wpt>
229+
198230
Note: Internal table elements,
199231
which do not include table captions,
200232
are excluded,
@@ -208,24 +240,65 @@ Size Containment</h3>
208240
which are perfectly capable of having a fixed size
209241
that is independent of their content.
210242

243+
<wpt>
244+
contain-size-011.html
245+
contain-size-056.html
246+
</wpt>
247+
211248
1. When calculating the size of the containing element,
212249
it must be treated as having no contents.
213250

251+
<wpt>
252+
contain-size-021.html
253+
contain-size-023.html
254+
contain-size-025.html
255+
contain-size-027.html
256+
contain-size-061.html
257+
contain-size-062.html
258+
contain-size-borders.html
259+
contain-size-fieldset-001.html
260+
contain-size-scrollbars-001.html
261+
262+
contain-size-button-001.html
263+
contain-size-flexbox-001.html
264+
contain-size-grid-001.html
265+
</wpt>
266+
214267
Note: Even when the element's [=sizing properties=] are ''height/auto''
215268
this does not necessarily make the element zero-sized:
216269
properties set on the element itself,
217270
such as the 'columns' property or the 'grid' property,
218271
continue to be taken into account.
219272

273+
<wpt>
274+
contain-size-grid-002.html
275+
contain-size-multicol-001.html
276+
</wpt>
277+
220278
Then,
221279
its contents must then be laid out into the containing element's resolved size.
222280

223281
Note: [=size containment=] does not suppress baseline alignment.
224282
See [=layout containment=] for that.
225283

284+
<wpt>
285+
contain-size-baseline-001.html
286+
</wpt>
287+
226288
<a>Replaced elements</a> must be treated as having an intrinsic width and height of 0.
289+
290+
<wpt>
291+
contain-size-013.html
292+
contain-size-041.html
293+
contain-size-042.html
294+
</wpt>
227295
2. Elements with <a>size containment</a> are <a spec=css-break-3>monolithic</a> (See [[CSS-BREAK-3#possible-breaks]]).
228296

297+
<wpt>
298+
contain-size-breaks-001.html
299+
contain-size-monolithic-001.html
300+
</wpt>
301+
229302
By itself, <a>size containment</a> does not offer much optimization opportunity.
230303
Its primary benefit on its own is that tools which want to lay out the containing element's contents
231304
based on the containing element's size
@@ -258,8 +331,29 @@ Layout Containment</h3>
258331
layout containment has no effect.
259332
Otherwise, giving an element <dfn export>layout containment</dfn> has the following effects:
260333

334+
<wpt>
335+
contain-layout-001.html
336+
contain-layout-002.html
337+
contain-layout-003.html
338+
contain-layout-004.html
339+
contain-layout-005.html
340+
contain-layout-009.html
341+
contain-layout-010.html
342+
contain-layout-011.html
343+
contain-layout-012.html
344+
contain-layout-013.html
345+
contain-layout-014.html
346+
contain-layout-independent-formatting-context-003.html
347+
</wpt>
348+
261349
1. The element [=establishes an independent formatting context=].
262350

351+
<wpt>
352+
contain-layout-ifc-022.html
353+
contain-layout-independent-formatting-context-001.html
354+
contain-layout-independent-formatting-context-002.html
355+
</wpt>
356+
263357
2. If at least one [=fragmentation container=] of a [=fragmentation context=] has [=layout containment=],
264358
or if at least one [=fragmentation container=] of a [=fragmentation context=] is a descendant of an element with layout containment
265359
<strong>and</strong> at least one subsequent [=fragmentation container=] of the same [=fragmentation context=]
@@ -326,13 +420,42 @@ Layout Containment</h3>
326420
either ''overflow/visible'' or ''overflow/clip'' or a combination thereof,
327421
any overflow must be treated as [=ink overflow=].
328422

423+
<wpt>
424+
contain-layout-ink-overflow-013.html
425+
contain-layout-ink-overflow-014.html
426+
contain-layout-ink-overflow-015.html
427+
contain-layout-ink-overflow-016.html
428+
contain-layout-ink-overflow-017.html
429+
contain-layout-ink-overflow-018.html
430+
contain-layout-ink-overflow-019.html
431+
contain-layout-ink-overflow-020.html
432+
</wpt>
433+
329434
4. The element acts as a containing block for absolutely positioned and fixed positioned descendants.
330435

436+
<wpt>
437+
contain-layout-006.html
438+
contain-layout-007.html
439+
contain-layout-cell-001.html
440+
contain-layout-cell-002.html
441+
</wpt>
442+
331443
5. The element creates a <a>stacking context</a>.
332444

445+
<wpt>
446+
contain-layout-016.html
447+
contain-layout-017.html
448+
contain-layout-018.html
449+
</wpt>
450+
333451
6. [=Forced breaks=] are allowed within elements with [=layout containment=],
334452
but do not propagate to the parent as otherwise described in [[CSS-BREAK-3#break-between]].
335453

454+
<wpt>
455+
contain-layout-breaks-001.html
456+
contain-layout-breaks-002.html
457+
</wpt>
458+
336459
Note: This introduces the previously non-existent possibility that [=forced breaks=]
337460
may occur between a box and its container (See [[CSS-BREAK-3#possible-breaks]]).
338461

@@ -342,6 +465,13 @@ Layout Containment</h3>
342465
to something other than its descendants,
343466
the containing element is treated as having no baseline.
344467

468+
<wpt>
469+
contain-layout-baseline-001.html
470+
css/css-contain/contain-layout-button-001.html
471+
css/css-contain/contain-layout-flexbox-001.html
472+
css/css-contain/contain-layout-grid-001.html
473+
</wpt>
474+
345475
Possible optimizations that can be enabled by <a>layout containment</a> include (but are not limited to):
346476

347477
1. When laying out the page,
@@ -368,6 +498,13 @@ Style Containment</h3>
368498
must be <a for=property>scoped to the element's sub-tree</a>
369499
and create a new counter.
370500

501+
<wpt>
502+
contain-style-counters-001.html
503+
contain-style-counters-002.html
504+
contain-style-counters-003.html
505+
contain-style-counters-004.html
506+
</wpt>
507+
371508
2. The effects of the 'content' property's
372509
''content/open-quote'', ''content/close-quote'', ''content/no-open-quote'' and ''content/no-close-quote''
373510
must be <a for=property>scoped to the element's sub-tree</a>.
@@ -377,6 +514,22 @@ Style Containment</h3>
377514
but that changes to the depth of quote nesting by these values inside the subtree
378515
do not affect the depth of quote nesting outside the subtree.
379516

517+
<wpt>
518+
quote-scoping-001.html
519+
quote-scoping-002.html
520+
quote-scoping-003.html
521+
quote-scoping-004.html
522+
</wpt>
523+
524+
<wpt>
525+
contain-style-baseline-001.html
526+
contain-style-breaks-001.html
527+
contain-style-breaks-002.html
528+
contain-style-breaks-003.html
529+
contain-style-breaks-004.html
530+
contain-style-breaks-005.html
531+
</wpt>
532+
380533
Note: [[CSS-REGIONS-1]] has normative requirements on how <a>style containment</a> affects regions.
381534

382535
A <dfn export for=property lt="scoped | scoped property | scoped properties">scoped property</dfn> has its effects scoped to a particular element or subtree.
@@ -397,6 +550,12 @@ Style Containment</h3>
397550
When considering the effects of the scoped property on elements <em>inside</em> the subtree,
398551
the element at the base of the subtree is treated as if it was the root of the document.
399552

553+
<wpt>
554+
counter-scoping-001.html
555+
counter-scoping-002.html
556+
counter-scoping-003.html
557+
</wpt>
558+
400559
<div class=example>
401560
As 'counter-increment' is scoped to an element's subtree,
402561
the first use of it within the subtree acts as if the named counter were set to 0 at the scoping element,
@@ -438,6 +597,23 @@ Paint Containment</h3>
438597
paint containment has no effect.
439598
Otherwise, giving an element <dfn export>paint containment</dfn> has the following effects:
440599

600+
<wpt>
601+
contain-paint-002.html
602+
contain-paint-005.html
603+
contain-paint-006.html
604+
contain-paint-007.html
605+
contain-paint-008.html
606+
contain-paint-011.html
607+
contain-paint-012.html
608+
contain-paint-014.html
609+
contain-paint-015.html
610+
contain-paint-016.html
611+
contain-paint-017.html
612+
contain-paint-018.html
613+
contain-paint-019.html
614+
contain-paint-independent-formatting-context-003.html
615+
</wpt>
616+
441617
1. The contents of the element
442618
including both the paint of the descendants and their geometry
443619
must be clipped to the <a>padding edge</a> of the element's <a>principal box</a>,
@@ -447,10 +623,52 @@ Paint Containment</h3>
447623
nor does it inhibit the creation of any such mechanism through other properties,
448624
<span class=informative>such as 'overflow', 'resize', or 'text-overflow'</span>.
449625
<span class=note>This is as if ''overflow: visible'' was changed to ''overflow: clip'' at used value.</span>
626+
627+
<wpt>
628+
contain-paint-001.html
629+
contain-paint-004.html
630+
contain-paint-047.html
631+
contain-paint-048.html
632+
contain-paint-cell-001.html
633+
contain-paint-cell-002.html
634+
contain-paint-clip-011.html
635+
contain-paint-clip-012.html
636+
contain-paint-clip-013.html
637+
contain-paint-clip-014.html
638+
contain-paint-clip-015.html
639+
contain-paint-clip-016.html
640+
contain-paint-clip-017.html
641+
contain-paint-clip-018.html
642+
contain-paint-clip-019.html
643+
</wpt>
450644
2. The element acts as a containing block for absolutely positioned and fixed positioned descendants.
645+
646+
<wpt>
647+
contain-paint-009.html
648+
contain-paint-010.html
649+
contain-paint-022.html
650+
contain-paint-023.html
651+
contain-paint-024.html
652+
</wpt>
451653
3. The element creates a <a>stacking context</a>.
654+
655+
<wpt>
656+
contain-paint-020.html
657+
contain-paint-021.html
658+
contain-paint-025.html
659+
</wpt>
452660
4. The element [=establishes an independent formatting context=].
453661

662+
<wpt>
663+
contain-paint-ifc-011.html
664+
contain-paint-independent-formatting-context-001.html
665+
contain-paint-independent-formatting-context-002.html
666+
</wpt>
667+
668+
<wpt>
669+
contain-paint-baseline-001.html
670+
</wpt>
671+
454672
<div class=informative>
455673
Possible optimizations that can be enabled by <a>paint containment</a> include (but are not limited to):
456674

@@ -471,7 +689,6 @@ Paint Containment</h3>
471689
scrolling elements can be painted into a single GPU layer.
472690
</div>
473691

474-
475692
Privacy and Security Considerations {#privsec}
476693
==============================================
477694

0 commit comments

Comments
 (0)