Title: CSS Containment Module Level 1
Level: 1
Shortname: css-contain
Status: REC
Date: 2022-10-25
Deadline: 2023-01-10
Prepare for TR: yes
Implementation Report: https://drafts.csswg.org/css-contain-1/implementation-report-2022-09
Work Status: completed
Group: csswg
ED: https://drafts.csswg.org/css-contain-1/
TR: https://www.w3.org/TR/css-contain-1/
Previous Version: https://www.w3.org/TR/2020/REC-css-contain-1-20201222/
Previous Version: https://www.w3.org/TR/2019/REC-css-contain-1-20191121/
Editor: Tab Atkins, Google, http://xanthir.com/contact/, w3cid 42199
Editor: Florian Rivoal, On behalf of Bloomberg, https://florian.rivoal.net/, w3cid 43241
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.
Status Text: 

This document was published by the CSS Working Group as a Recommendation using the Recommendation track. It includes proposed corrections.

Proposed corrections are marked in the document.

W3C recommends the wide deployment of this specification as a standard for the Web.

WPT Path Prefix: css/css-contain/ Include MDN Panels: no
spec: css2; urlPrefix: https://www.w3.org/TR/CSS2/
	type: property; url: visudet.html#propdef-vertical-align; text: vertical-align
	type: dfn; url: box.html#padding-edge; text: padding edge

spec: css-backgrounds-3;
	type: dfn; url: https://drafts.csswg.org/css-backgrounds-3/#corner-clipping; text: corner clipping

Introduction

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. 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 fail such heuristic tests, causing rendering to fall into a slow code path. There are also many things that would be good to isolate which are difficult or impossible to detect in a heuristic manner. To alleviate these problems and allow strong, predictable isolation of a subtree from the rest of the page, this specification defines a 'contain' property.

Value Definitions

This specification follows the CSS property definition conventions from [[!CSS2]] using the value definition syntax from [[!CSS-VALUES-3]]. Value types not defined in this specification are defined in CSS Values & Units [[!CSS-VALUES-3]]. Combination with other CSS modules may expand the definitions of these value types. In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the CSS-wide keywords as their property value. For readability they have not been repeated explicitly.

Strong Containment: the 'contain' property

contain-chrome-thcrash-001.html contain-crash.html contain-flexbox-outline.html crashtests/contain-nested-crash-001.html crashtests/contain-nested-crash-002.html crashtests/contain-nested-crash-003.html
Proposed Correction 1: This makes a minor adjustment to the way the computed value of the 'contain' property is determined: the shortcut values (''strict'' and ''content''), instead of computing to themselves, compute to the corresponding keywords. Given that the effect is identical, this allows implementations not to store the precise syntax through which this was achieved. Also, thanks to the shortest-serialization principle, this makes this unimportant difference non observable via serialization.
This change has tests A test for this change has been added to WPT. The results can be viewed at wpt.fyi. Note that a few subtests of this test (those involving the style or inline-size values) only relate to later levels of this specification.
		Name: contain
		Value: none | strict | content | [ size || layout || paint ]
		Initial: none
		Inherited: no
		Applies to: See below
		Computed value: specified keyword(s)the keyword ''contain/none'' or one or more of ''size'', ''layout'', ''paint''
		Animation type: not animatable
	
contain-animation-001.html inheritance.html parsing/contain-computed.html parsing/contain-invalid.html parsing/contain-valid.html parsing/contain-computed-children.html contain-layout-size-003.html contain-paint-size-001.html contain-paint-size-002.html contain-paint-size-003.html

User agents are expected to support this property on all media, including non-visual ones.

The 'contain' property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. This allows user agents to utilize much stronger optimizations when rendering a page using 'contain' properly, and allows authors to be confident that their page won't accidentally fall into a slow code path due to an innocuous change.
none
This value indicates that the property has no effect. The element renders as normal, with no containment effects applied.
strict
This value computes to ''size layout paint'', and thus turns on all forms of containment for the element. In other words, it behaves the same as ''contain: size layout paint;''.. contain-strict-001.html contain-strict-002.html contain-strict-003.html contain-flexbox-outline.html
content
This value computes to ''layout paint'', and thus turns on all forms of containment except size containment for the element. In other words, it behaves the same as ''contain: layout paint;''.. contain-content-001.html contain-content-002.html contain-content-003.html contain-content-004.html Note: ''contain: content'' 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 size containment, 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 ''contain: strict'' when possible, to gain as much containment as you can.
size
The value turns on size containment for the element. This ensures that the [=size containment box|containment box=] can be laid out without needing to examine its descendants. contain-size-001.html contain-size-002.html contain-size-003.html contain-size-004.html contain-size-005.html contain-size-006.html contain-size-007.html contain-size-008.html contain-size-009.html contain-size-010.html contain-size-011.html contain-size-012.html contain-size-012b.html contain-size-013.html contain-size-021.html contain-size-023.html contain-size-025.html contain-size-027.html contain-size-041.html contain-size-042.html contain-size-051.html contain-size-052.html contain-size-056.html contain-size-061.html contain-size-062.html contain-size-063.html contain-size-baseline-001.html contain-size-borders.html contain-size-breaks-001.html contain-size-button-001.html contain-size-fieldset-001.html contain-size-fieldset-002.html contain-size-flexbox-001.html contain-size-flexbox-002.html contain-size-grid-001.html contain-size-grid-002.html contain-size-grid-003.html contain-size-grid-004.html contain-size-grid-005.html contain-size-grid-006.html contain-size-monolithic-001.html contain-size-monolithic-002.html contain-size-multicol-001.html contain-size-multicol-as-flex-item.html contain-size-replaced-001.html contain-size-replaced-002.html contain-size-replaced-003a.html contain-size-replaced-003b.html contain-size-replaced-003c.html contain-size-replaced-004.html contain-size-replaced-005.html contain-size-replaced-006.html contain-size-replaced-007.html contain-size-select-001.html contain-size-select-002.html contain-size-scrollbars-001.html contain-size-scrollbars-002.html contain-size-scrollbars-003.html contain-size-scrollbars-004.html contain-layout-size-003.html contain-paint-size-001.html contain-paint-size-002.html contain-paint-size-003.html contain-size-removed.html
layout
This value turns on layout containment for the element. This ensures that the [=layout containment box|containment box=] is totally opaque for layout purposes; nothing outside can affect its internal layout, and vice versa. contain-layout-001.html contain-layout-002.html contain-layout-003.html contain-layout-004.html contain-layout-005.html contain-layout-006.html contain-layout-007.html contain-layout-009.html contain-layout-010.html contain-layout-011.html contain-layout-012.html contain-layout-013.html contain-layout-014.html contain-layout-016.html contain-layout-017.html contain-layout-018.html contain-layout-019.html contain-layout-020.html contain-layout-021.html contain-layout-baseline-001.html contain-layout-baseline-002.html contain-layout-baseline-003.html contain-layout-baseline-004.html contain-layout-baseline-005.html contain-layout-breaks-001.html contain-layout-breaks-002.html contain-layout-button-001.html contain-layout-cell-001.html contain-layout-cell-002.html contain-layout-flexbox-001.html contain-layout-grid-001.html contain-layout-ifc-022.html contain-layout-independent-formatting-context-001.html contain-layout-independent-formatting-context-002.html contain-layout-independent-formatting-context-003.html contain-layout-ink-overflow-013.html contain-layout-ink-overflow-014.html contain-layout-ink-overflow-015.html contain-layout-ink-overflow-016.html contain-layout-ink-overflow-017.html contain-layout-ink-overflow-018.html contain-layout-ink-overflow-019.html contain-layout-ink-overflow-020.html contain-layout-size-003.html contain-subgrid-001.html
paint
This value turns on paint containment for the element. This ensures that the descendants of the [=paint containment box|containment 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. contain-paint-001.html contain-paint-002.html contain-paint-004.html contain-paint-005.html contain-paint-006.html contain-paint-007.html contain-paint-008.html contain-paint-009.html contain-paint-010.html contain-paint-011.html contain-paint-012.html contain-paint-014.html contain-paint-015.html contain-paint-016.html contain-paint-017.html contain-paint-018.html contain-paint-019.html contain-paint-020.html contain-paint-021.html contain-paint-022.html contain-paint-023.html contain-paint-024.html contain-paint-025.html contain-paint-047.html contain-paint-048.html contain-paint-baseline-001.html contain-paint-cell-001.html contain-paint-cell-002.html contain-paint-clip-011.html contain-paint-clip-012.html contain-paint-clip-013.html contain-paint-clip-014.html contain-paint-clip-015.html contain-paint-clip-016.html contain-paint-clip-017.html contain-paint-clip-018.html contain-paint-clip-019.html contain-paint-ifc-011.html contain-paint-independent-formatting-context-001.html contain-paint-independent-formatting-context-002.html contain-paint-independent-formatting-context-003.html contain-paint-size-001.html contain-paint-size-002.html contain-paint-size-003.html contain-paint-table-001.html contain-paint-table-002.html contain-subgrid-001.html contain-paint-change-opacity.html
This property generally applies to all elements (including [[css-pseudo-4#generated-content]]), although some types of containment have no effect on some elements, as detailed in [[#containment-types]]. In addition, in the case of [[SVG2]], the 'contain' property only applies to <{svg}> elements that have an associated CSS layout box.
'contain' is useful when used widely on a page, particularly when a page contains a lot of "widgets" which are all independent. For example, assume a micropost social network had markup something like this:

			<body>
				<aside>...</aside>
				<section>
					<h2>Messages</h2>
					<article>
						Lol, check out this dog: images.example.com/jsK3jkl
					</article>
					<article>
						I had a ham sandwich today. #goodtimes
					</article>
					<article>
						I have political opinions that you need to hear!
					</article>
					…
				</section>
			</body>
		
There are probably a lot 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 ''contain: content'' 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, ''contain: strict'' can be applied to communicate further restrictions.
Proposed Correction 3: The CSS Working Group had forgotten to consider the effects of containment on the HTML <{html}> and <{body}> elements, particularly in consideration of the fact that for legacy reasons, some properties can propagate outwards from the <{body}> element. This proposed text addresses this oversight.
Additionally, when the [=used value=] of the 'contain' property on either the HTML <{html}> or <{body}> elements is anything other than ''contain/none'', propagation of properties from the <{body}> element to the [=initial containing block=], the viewport, or the [=canvas background=], is disabled. Notably, this affects: * 'writing-mode', 'direction', and 'text-orientation' (see [[CSS-WRITING-MODES-3#principal-flow]]) * 'overflow' and its longhands (see [[CSS-OVERFLOW-3#overflow-propagation]]) * 'background' and its longhands (see [[CSS-BACKGROUNDS-3#body-background]]) contain-body-bg-001.html contain-body-bg-002.html contain-body-bg-003.html contain-body-bg-004.html contain-body-dir-001.html contain-body-dir-002.html contain-body-dir-003.html contain-body-dir-004.html contain-body-overflow-001.html contain-body-overflow-002.html contain-body-overflow-003.html contain-body-overflow-004.html contain-body-t-o-001.html contain-body-t-o-002.html contain-body-t-o-003.html contain-body-t-o-004.html contain-body-w-m-001.html contain-body-w-m-002.html contain-body-w-m-003.html contain-body-w-m-004.html contain-html-bg-001.html contain-html-bg-002.html contain-html-bg-003.html contain-html-bg-004.html contain-html-dir-001.html contain-html-dir-002.html contain-html-dir-003.html contain-html-dir-004.html contain-html-overflow-001.html contain-html-overflow-002.html contain-html-overflow-003.html contain-html-overflow-004.html contain-html-t-o-001.html contain-html-t-o-002.html contain-html-t-o-003.html contain-html-t-o-004.html contain-html-w-m-001.html contain-html-w-m-002.html contain-html-w-m-003.html contain-html-w-m-004.html Note: Propagation to the [=initial containing block=], the viewport, or the [=canvas background=], of properties set on the <{html}> element itself is unaffected.
This change has tests Tests to cover these new requirements have been added to WPT. The results of these tests can be seen at the Web-Platform-Tests dashboard:
  1. contain-body-bg-001.html
  2. contain-body-bg-002.html
  3. contain-body-bg-003.html
  4. contain-body-bg-004.html
  5. contain-body-dir-001.html
  6. contain-body-dir-002.html
  7. contain-body-dir-003.html
  8. contain-body-dir-004.html
  9. contain-body-overflow-001.html
  10. contain-body-overflow-002.html
  11. contain-body-overflow-003.html
  12. contain-body-overflow-004.html
  13. contain-body-t-o-001.html
  14. contain-body-t-o-002.html
  15. contain-body-t-o-003.html
  16. contain-body-t-o-004.html
  17. contain-body-w-m-001.html
  18. contain-body-w-m-002.html
  19. contain-body-w-m-003.html
  20. contain-body-w-m-004.html
  21. contain-html-bg-001.html
  22. contain-html-bg-002.html
  23. contain-html-bg-003.html
  24. contain-html-bg-004.html
  25. contain-html-dir-001.html
  26. contain-html-dir-002.html
  27. contain-html-dir-003.html
  28. contain-html-dir-004.html
  29. contain-html-overflow-001.html
  30. contain-html-overflow-002.html
  31. contain-html-overflow-003.html
  32. contain-html-overflow-004.html
  33. contain-html-t-o-001.html
  34. contain-html-t-o-002.html
  35. contain-html-t-o-003.html
  36. contain-html-t-o-004.html
  37. contain-html-w-m-001.html
  38. contain-html-w-m-002.html
  39. contain-html-w-m-003.html
  40. contain-html-w-m-004.html

Types of Containment

There are several varieties of containment that an element can be subject to, restricting the effects that its descendants can have on the rest of the page in various ways. Containment 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. 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.

Size Containment

Giving an element size containment makes its [=principal box=] a size containment box and has the following effects:
  1. When calculating the size of [=size containment box=], it must be treated as having no contents. contain-size-021.html contain-size-023.html contain-size-025.html contain-size-027.html contain-size-061.html contain-size-062.html contain-size-063.html contain-size-borders.html contain-size-fieldset-001.html contain-size-fieldset-002.html contain-size-select-001.html contain-size-select-002.html contain-size-scrollbars-001.html contain-size-scrollbars-002.html contain-size-scrollbars-003.html contain-size-scrollbars-004.html contain-size-button-001.html contain-size-flexbox-001.html contain-size-flexbox-002.html contain-size-grid-001.html contain-size-013.html contain-size-041.html contain-size-042.html contain-size-replaced-001.html contain-size-replaced-002.html contain-size-replaced-003a.html contain-size-replaced-003b.html contain-size-replaced-003c.html contain-size-replaced-004.html contain-size-replaced-005.html contain-size-replaced-006.html contain-size-block-001.html contain-size-block-002.html contain-size-block-003.html contain-size-block-004.html contain-size-button-002.html contain-size-fieldset-003.html replaced-element-023.html replaced-element-025.html replaced-element-027.html Note: Even when the element's [=sizing properties=] specify an intrinsic size, this does not necessarily make the element zero-sized: properties set on the element itself continue to be taken into account, which can cause it to be larger. contain-size-grid-002.html contain-size-grid-003.html contain-size-multicol-001.html contain-size-multicol-as-flex-item.html Then, its contents must then be laid out into the [=size containment box|containment box=]'s resolved size. Note: [=Size containment=] does not suppress baseline alignment. See [=layout containment=] for that. contain-size-baseline-001.html
    Proposed Correction 2: The way the two normative sentences above are written was somewhat ambiguous, causing implementers to have some doubts about the precise intended effects in certain cases. In order to clarify what is meant without changing the intended behavior, The CSSWG suggest replacing this first item in the list with the following two (the existing notes remain the same):
    1. The [=intrinsic sizes=] of the [=size containment box=] are determined as if the element had no content, following the same logic as when [=sizing as if empty=]. Note: This affects explicit invocations of the ''min-content'' or ''max-content'' keywords, as well as any calculation that depends on these measurement, such as sizing [=grid tracks=] into which a size contained item is placed, or if [=fit-content sizing=] the containment box's parent. contain-size-013.html contain-size-041.html contain-size-042.html contain-size-replaced-001.html contain-size-replaced-002.html contain-size-replaced-003a.html contain-size-replaced-003b.html contain-size-replaced-003c.html contain-size-replaced-004.html contain-size-replaced-005.html contain-size-replaced-006.html contain-size-block-001.html contain-size-block-002.html contain-size-block-003.html contain-size-block-004.html contain-size-button-002.html contain-size-fieldset-003.html contain-size-flex-001.html contain-size-grid-005.html contain-size-grid-006.html contain-size-inline-block-001.html contain-size-inline-block-002.html contain-size-inline-block-003.html contain-size-inline-block-004.html contain-size-inline-flex-001.html contain-size-multicol-002.html contain-size-multicol-003.html contain-size-select-elem-001.html contain-size-select-elem-002.html contain-size-select-elem-003.html contain-size-select-elem-004.html contain-size-select-elem-005.html
    2. Laying out a [=size containment box=] and its content is conceptually done in two phases:
      Sizing as if empty
      The [=used value|used=] 'width' and 'height' of the [=size containment box|containment box=] are determined as if performing a normal layout of the box, except that it is treated as having no content-- not even through pseudo elements such as ''::before'', ''::after'', or ''::marker''. contain-size-021.html contain-size-023.html contain-size-025.html contain-size-027.html contain-size-061.html contain-size-062.html contain-size-063.html contain-size-borders.html contain-size-fieldset-001.html contain-size-fieldset-002.html contain-size-select-001.html contain-size-select-002.html contain-size-scrollbars-001.html contain-size-scrollbars-002.html contain-size-scrollbars-003.html contain-size-scrollbars-004.html contain-size-button-001.html contain-size-flexbox-001.html contain-size-flexbox-002.html contain-size-grid-001.html Replaced elements must be treated as having a [=natural dimensions|natural=] width and height of 0 and no [=natural aspect ratio=]. Note: Size containment only suppresses the [=natural aspect ratio=], so properties like 'aspect-ratio' which affect that [=preferred aspect ratio=] directly are honored. contain-size-013.html contain-size-041.html contain-size-042.html contain-size-replaced-001.html contain-size-replaced-002.html contain-size-replaced-003a.html contain-size-replaced-003b.html contain-size-replaced-003c.html contain-size-replaced-004.html contain-size-replaced-005.html replaced-element-023.html replaced-element-025.html replaced-element-027.html All CSS properties of the [=size containment box=] are taken into account as they would be when performing layout normally. Other specifications may make specific exemptions. contain-size-replaced-006.html Note: Even when the element's [=sizing properties=] specify an intrinsic size, this does not necessarily make the element zero-sized: properties set on the element itself continue to be taken into account, which can cause it to be larger. contain-size-grid-002.html contain-size-grid-003.html contain-size-multicol-001.html contain-size-multicol-as-flex-item.html
      Laying out in-place
      The [=size containment box|containment box=]'s content (including any pseudo-elements) must then be laid out into the now fixed-size [=size containment box|containment box=] normally. contain-size-064.html
      Note: [=Size containment=] does not suppress baseline alignment. See [=layout containment=] for that. contain-size-baseline-001.html contain-size-fieldset-004.html contain-size-inline-block-001.html contain-size-inline-block-002.html contain-size-inline-block-003.html contain-size-inline-block-004.html contain-size-inline-flex-001.html
    This change has tests All statements in this more detailed write-up have tests in WPT. The results of these tests can be seen at the Web-Platform-Tests dashboard:
    1. contain-size-013.html
    2. contain-size-021.html
    3. contain-size-023.html
    4. contain-size-025.html
    5. contain-size-027.html
    6. contain-size-041.html
    7. contain-size-042.html
    8. contain-size-061.html
    9. contain-size-062.html
    10. contain-size-063.html
    11. contain-size-064.html
    12. contain-size-borders.html
    13. contain-size-button-001.html
    14. contain-size-fieldset-001.html
    15. contain-size-fieldset-002.html
    16. contain-size-flexbox-001.html
    17. contain-size-flexbox-002.html
    18. contain-size-grid-001.html
    19. contain-size-grid-002.html
    20. contain-size-grid-003.html
    21. contain-size-multicol-001.html
    22. contain-size-multicol-as-flex-item.html
    23. contain-size-replaced-001.html
    24. contain-size-replaced-002.html
    25. contain-size-replaced-003a.html
    26. contain-size-replaced-003b.html
    27. contain-size-replaced-003c.html
    28. contain-size-replaced-004.html
    29. contain-size-replaced-005.html
    30. contain-size-replaced-006.html
    31. contain-size-scrollbars-001.html
    32. contain-size-scrollbars-002.html
    33. contain-size-scrollbars-003.html
    34. contain-size-scrollbars-004.html
    35. contain-size-select-001.html
    36. contain-size-select-002.html
    37. replaced-element-023.html
    38. replaced-element-025.html
    39. replaced-element-027.html
    40. contain-size-block-001.html
    41. contain-size-block-002.html
    42. contain-size-block-003.html
    43. contain-size-block-004.html
    44. contain-size-button-002.html
    45. contain-size-fieldset-003.html
    46. contain-size-flex-001.html
    47. contain-size-grid-005.html
    48. contain-size-grid-006.html
    49. contain-size-inline-block-001.html
    50. contain-size-inline-block-002.html
    51. contain-size-inline-block-003.html
    52. contain-size-inline-block-004.html
    53. contain-size-inline-flex-001.html
    54. contain-size-multicol-002.html
    55. contain-size-multicol-003.html
    56. contain-size-select-elem-001.html
    57. contain-size-select-elem-002.html
    58. contain-size-select-elem-003.html
    59. contain-size-select-elem-004.html
    60. contain-size-select-elem-005.html
    61. contain-size-fieldset-004.html
    62. contain-size-inline-block-001.html
    63. contain-size-inline-block-002.html
    64. contain-size-inline-block-003.html
    65. contain-size-inline-block-004.html
    66. contain-size-inline-flex-001.html
    Also, note the insertion of a parenthetical at the very end of [[#containment-size-opt]], referencing part of this clarified text.
  2. [=Size containment boxes=] are monolithic (See [[CSS-BREAK-3#possible-breaks]]). contain-size-breaks-001.html contain-size-monolithic-001.html contain-size-monolithic-002.html contain-size-multicol-004.html
Given the following markup and style, the image would be sized to 100px by 100px, as the aspect ratio set by the 'aspect-ratio' property takes effect.

		img {
			width: 100px;
			aspect-ratio: 1/1;
			contain: size;
		}
		
		<img src="https://www.example.com/300x100.jpg">
		
If the 'aspect-ratio' property had not been declared, the image would have been 100px by 0px, as its [=natural aspect ratio=] is suppressed, and its [=natural height=] is treated as 0.
However, giving an element [=size containment=] has no effect if any of the following are true: * if the element does not generate a principal box (as is the case with ''display: contents'' or ''display: none'') * if its [=inner display type=] is ''display/table'' contain-size-012.html contain-size-012b.html * if its [=principal box=] is an internal table box contain-size-006.html contain-size-007.html contain-size-008.html contain-size-009.html contain-size-010.html contain-size-051.html contain-size-052.html * if its [=principal box=] is an internal ruby box or a non-atomic inline-level box contain-size-002.html contain-size-003.html contain-size-004.html contain-size-005.html contain-size-001.html Note: 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 laying out its content inside without changing the size is effectively an undefined operation. Manually setting the 'width' or 'height' properties to ''0'' 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. contain-size-011.html contain-size-056.html contain-size-table-caption-001.html

Possible Size-Containment Optimizations

This section is non-normative. By itself, size containment does not offer much optimization opportunity. Its primary benefit on its own is that tools which want to lay out the [=size containment box|containment box=]'s contents based on the [=size containment box|containment 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 [=size containment box|containment box=] causes the [=size containment box|containment box=]'s size to change as well, possibly triggering further changes in how the child sizes itself and possibly thus more changes to the [=size containment box|containment box=]'s size, ad infinitum. When paired with layout containment, though, possible optimizations that can be enabled include (but are not limited to): 1. When the style or contents of a descendant of the [=size containment box|containment box=] is changed, calculating what part of the DOM tree is "dirtied" and might need to be re-laid out can stop at the [=size containment box|containment box=]. 2. When laying out the page, if the [=size containment box|containment box=] is off-screen or obscured, the layout of its contents (i.e. "[=laying out in-place=]") can be delayed or done at a lower priority.

Layout Containment

Giving an element layout containment makes its [=principal box=] a layout containment box and has the following effects: 1. The [=layout containment box=] [=establishes an independent formatting context=]. contain-layout-ifc-022.html contain-layout-independent-formatting-context-001.html contain-layout-independent-formatting-context-002.html contain-subgrid-001.html contain-layout-formatting-context-float-001.html contain-layout-formatting-context-margin-001.html 2. If at least one [=fragmentation container=] of a [=fragmentation context=] has [=layout containment=], or if at least one [=fragmentation container=] of a [=fragmentation context=] is a descendant of [=layout containment box=] and at least one subsequent [=fragmentation container=] of the same [=fragmentation context=] is not a descendant of that same element with layout containment, then the first [=layout containment box=] which is either a [=fragmentation container=] itself or is an ancestor of a [=fragmentation container=] must “trap” the remainder of the [=fragmented flow=]: [=fragmentation=] must not continue past the [=layout containment=] boundary, and the last [=fragmentation container=] within the first [=layout containment=] boundary is treated as if it is the last [=fragmentation container=] in its [=fragmentation context=]. If subsequent [=fragmentation containers=] in the [=fragmentation context=] are only generated when more content remains in the [=fragmented flow=], then they are not generated. If they would exist regardless, they remain part of the [=fragmentation context=], but do not receive any content from the [=fragmented flow=]. Note: 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 [[CSS-PAGE-3]] nor of [[CSS-MULTICOL-1]]. This requirement is nonetheless included because several mechanisms that would make this a possibility have been considered (e.g.: [[CSS-REGIONS-1]], ''::nth-fragment()'', 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. [[CSS-REGIONS-1]] has details over how layout containment affects regions.

				<article>Lorem ipsum…</article>
				<div id=a></div>
				<aside>
				  <div id=b></div>
				  <div id=c></div>
				</aside>
				<aside>
				  <div id=d></div>
				  <div id=e></div>
				</aside>
				<div id=f></div>
			

				article {flow-into: foo;}
				#a, #b, #c, #d, #e, #f {flow-from: foo;}
				aside {contain: layout}
			
In this [[CSS-REGIONS-1]] example, content can flow from #a to #b, from #b to #c. However as #c is the last fragment container in the first [=layout containment box=] it traps all the remaining content, and nothing gets flowed into #d, #e, or #f.
3. If the computed value of the 'overflow' property is either ''overflow/visible'' or ''overflow/clip'' or a combination thereof, any overflow must be treated as [=ink overflow=]. contain-layout-ink-overflow-013.html contain-layout-ink-overflow-014.html contain-layout-ink-overflow-015.html contain-layout-ink-overflow-016.html contain-layout-ink-overflow-017.html contain-layout-ink-overflow-018.html contain-layout-ink-overflow-019.html contain-layout-ink-overflow-020.html contain-layout-overflow-001.html contain-layout-overflow-002.html 4. The [=layout containment box=] establishes an [=absolute positioning containing block=] and a [=fixed positioning containing block=]. contain-layout-006.html contain-layout-007.html contain-layout-cell-001.html contain-layout-cell-002.html contain-layout-021.html contain-layout-containing-block-absolute-001.html contain-layout-containing-block-fixed-001.html 5. The [=layout containment box=] creates a stacking context. contain-layout-016.html contain-layout-017.html contain-layout-018.html contain-layout-stacking-context-001.html 6. [=Forced breaks=] are allowed within [=layout containment boxes=] but do not propagate to the parent as otherwise described in [[CSS-BREAK-3#break-between]]. contain-layout-breaks-001.html contain-layout-breaks-002.html Note: This introduces the previously non-existent possibility that [=forced breaks=] may occur between a box and its container (See [[CSS-BREAK-3#possible-breaks]]). 7. For the purpose of the 'vertical-align' property, or any other property whose effects need to relate the position of the [=layout containment box=]'s baseline to something other than its descendants, the [=layout containment box|containment box=] is treated as having no baseline. contain-layout-baseline-001.html contain-layout-button-001.html contain-layout-flexbox-001.html contain-layout-grid-001.html contain-layout-baseline-002.html contain-layout-baseline-003.html contain-layout-baseline-004.html contain-layout-baseline-005.html contain-layout-suppress-baseline-001.html contain-layout-suppress-baseline-002.html However, giving an element [=layout containment=] has no effect if any of the following are true: * if the element does not generate a principal box (as is the case with ''display: contents'' or ''display: none'') contain-layout-ignored-cases-no-principal-box-001.html contain-layout-ignored-cases-no-principal-box-002.html contain-layout-ignored-cases-no-principal-box-003.html * if its [=principal box=] is an internal table box other than ''display/table-cell'' contain-layout-009.html contain-layout-010.html contain-layout-011.html contain-layout-012.html contain-layout-013.html contain-layout-014.html * if its [=principal box=] is an internal ruby box or a non-atomic inline-level box contain-layout-002.html contain-layout-003.html contain-layout-004.html contain-layout-005.html contain-layout-001.html contain-layout-independent-formatting-context-003.html contain-layout-ignored-cases-ib-split-001.html

Possible Layout-Containment Optimizations

This section is non-normative. Possible optimizations that can be enabled by layout containment include (but are not limited to): 1. When laying out the page, the contents of separate [=layout containment boxes|containment boxes=] can be laid out in parallel, as they're guaranteed not to affect each other. 2. When laying out the page, if the [=layout containment box|containment box=] is off-screen or obscured and the layout of the visible parts of the screen do not depend on the size of the [=layout containment box|containment box=] (for example, if the [=layout containment box|containment box=] is near the end of a block container, and you're viewing the beginning of the block container), the layout of the [=layout containment box|containment box=]' contents can be delayed or done at a lower priority. (When paired with size containment, this optimization can be applied more liberally.)

Paint Containment

Giving an element paint containment makes its [=principal box=] a paint containment box and has the following effects: 1. The contents of the element including any [=ink overflow|ink=] or [=scrollable overflow=] must be clipped to the padding edge of the [=paint containment box=], taking corner clipping into account. This does not include the creation of any mechanism to access or indicate the presence of the clipped content; nor does it inhibit the creation of any such mechanism through other properties, such as 'overflow', 'resize', or 'text-overflow'. contain-paint-050.html Note: The next level of this specification [[CSS-CONTAIN-2]] refines this effect to apply to the [=overflow clip edge=] rather than the [=padding edge=], in order to take the new 'overflow-clip-margin' property into account. For implementations that do not support 'overflow-clip-margin', the effect is identical. Note: The behavior is described in this paragraph is equivalent to changing ''overflow-x: visible'' into ''overflow-x: clip'' and ''overflow-y: visible'' into ''overflow-y: clip'' at used value time, while leaving other values of 'overflow-x' and 'overflow-y' unchanged. contain-paint-001.html contain-paint-004.html contain-paint-047.html contain-paint-048.html contain-paint-cell-001.html contain-paint-cell-002.html contain-paint-clip-011.html contain-paint-clip-012.html contain-paint-clip-013.html contain-paint-clip-014.html contain-paint-clip-015.html contain-paint-clip-016.html contain-paint-clip-017.html contain-paint-clip-018.html contain-paint-clip-019.html contain-paint-table-001.html contain-paint-table-002.html contain-paint-026.html contain-paint-049.html contain-paint-clip-001.html contain-paint-clip-002.html contain-paint-clip-003.html contain-paint-clip-004.html contain-paint-clip-005.html contain-paint-clip-006.html 2. The [=paint containment box=] establishes an [=absolute positioning containing block=] and a [=fixed positioning containing block=]. contain-paint-009.html contain-paint-010.html contain-paint-022.html contain-paint-023.html contain-paint-024.html contain-paint-containing-block-absolute-001.html contain-paint-containing-block-fixed-001.html 3. The [=paint containment box=] creates a stacking context. contain-paint-020.html contain-paint-021.html contain-paint-025.html contain-subgrid-001.html contain-paint-stacking-context-001a.html contain-paint-stacking-context-001b.html 4. The [=paint containment box=] [=establishes an independent formatting context=]. contain-paint-ifc-011.html contain-paint-independent-formatting-context-001.html contain-paint-independent-formatting-context-002.html contain-paint-formatting-context-float-001.html contain-paint-formatting-context-margin-001.html contain-paint-baseline-001.html However, giving an element [=paint containment=] has no effect if any of the following are true: * if the element does not generate a principal box (as is the case with ''display: contents'' or ''display: none'') contain-paint-ignored-cases-no-principal-box-001.html * if its [=principal box=] is an internal table box other than ''display/table-cell'' contain-paint-014.html contain-paint-015.html contain-paint-016.html contain-paint-017.html contain-paint-018.html contain-paint-019.html contain-paint-ignored-cases-internal-table-001a.html contain-paint-ignored-cases-internal-table-001b.html * if its [=principal box=] is an internal ruby box or a non-atomic inline-level box contain-paint-005.html contain-paint-006.html contain-paint-007.html contain-paint-008.html contain-paint-ignored-cases-ruby-containing-block-001.html contain-paint-ignored-cases-ruby-stacking-and-clipping-001.html contain-paint-002.html contain-paint-011.html contain-paint-012.html contain-paint-independent-formatting-context-003.html contain-paint-ignored-cases-ib-split-001.html

Possible Paint-Containment Optimizations

This section is non-normative. Possible optimizations that can be enabled by paint containment include (but are not limited to): 1. If the [=paint containment box|containment box=] is off-screen or obscured, the UA can usually skip trying to paint its contents, as they're guaranteed to be off-screen/obscured as well. Note: Some paint effects such as the ''blur()'' filter from [[FILTER-EFFECTS-1]] have non local effects. The user agent needs to keep track of these, as it may need to repaint parts of an element with such a filter when its descendents change, even if they have [=paint containment=] and could otherwise be skipped. 2. Unless the clipped content is made accessible via a separate mechanism such as the 'overflow', 'resize', or 'text-overflow' properties, the UA can reserve "canvas" space for the box exactly the box's size. (In similar, scrollable, situations, like ''overflow: hidden'', it's possible to scroll to the currently-clipped content, so UAs often predictively overpaint somewhat so there's something to see as soon as the scroll happens, rather than a frame later.) 3. Because they are guaranteed to be stacking contexts, scrolling elements can be painted into a single GPU layer.

Privacy Considerations

There are no known privacy impacts of the features in this specification.

Security Considerations

There are no known security impacts of the features in this specification. Like any other CSS specification, it affects the rendering of the document, but does not introduce any special ability to present content in a misleading way that was not previously available through other CSS modules and that isn't inherent to the act of formatting the document.

Appendix A. Changes

This appendix is informative.

Changes from the Recommendation of 22 December 2020

A full Disposition of Comments is available.

Changes from the Recommendation of 21 November 2019

A full Disposition of Comments is available.

Changes from the Candidate Recommendation of 30 April 2019

Full Dispositions of Comments since CR and since PR is available.

Changes from the Candidate Recommendation of 08 November 2018

A full Disposition of Comments is available. * Exclude style containment from ''contain: strict'' and ''contain: content'', and mark it at risk.

Changes from the Candidate Recommendation of 24 May 2018

A full Disposition of Comments is available. * Clarify that layout containment causes overflow to be treated as ink overflow only when visible (or clip) * Layout containment suppresses baseline alignment, but size containment does not * Layout containment causes the element to establish a new stacking context * Size containment does not apply to tables * Clarify that the columns and grid properties affect the size of size-contained elements * Change the animation type of the contain property from discrete to not animatable * Define the effect of containment on SVG elements * Editorial improvements * A comprehensive test suite for the full specification was developed, see http://test.csswg.org/harness/review/css-contain-1_dev

Changes from the Candidate Recommendation of 8 August 2017

A full Disposition of Comments is available.

Changes from the Working Draft of 19 April 2017

A Disposition of Comments covering this draft and the previous one together is available.

Changes from the First Public Working Draft of 21 February 2017

contain-inline-size-bfc-floats-001.html contain-inline-size-bfc-floats-002.html contain-inline-size-fieldset.html contain-inline-size-flex.html contain-inline-size-flexitem.html contain-inline-size-grid.html contain-inline-size-intrinsic.html contain-inline-size-legend.html contain-inline-size-multicol.html contain-inline-size-regular-container.html contain-inline-size-removed.html contain-inline-size-replaced.html contain-inline-size-table.html contain-inline-size-vertical-rl-.html container-queries/animation-container-size.html container-queries/animation-container-type-dynamic.html container-queries/animation-nested-animation.html container-queries/animation-nested-transition.html container-queries/aspect-ratio-feature-evaluation.html container-queries/at-container-parsing.html container-queries/at-container-serialization.html container-queries/at-container-style-serialization.html container-queries/auto-scrollbars.html container-queries/backdrop-invalidation.html container-queries/calc-evaluation.html container-queries/canvas-as-container-001.html container-queries/canvas-as-container-002.html container-queries/canvas-as-container-003.html container-queries/canvas-as-container-004.html container-queries/canvas-as-container-005.html container-queries/canvas-as-container-006.html container-queries/change-display-in-container.html container-queries/chrome-legacy-skip-recalc.html container-queries/column-spanner-in-container.html container-queries/conditional-container-status.html container-queries/container-computed.html container-queries/container-for-cue.html container-queries/container-for-shadow-dom.html container-queries/container-inheritance.html container-queries/container-inner-at-rules.html container-queries/container-inside-multicol-with-table.html container-queries/container-longhand-animation-type.html container-queries/container-name-computed.html container-queries/container-name-invalidation.html container-queries/container-name-parsing.html container-queries/container-name-tree-scoped.html container-queries/container-nested.html container-queries/container-parsing.html container-queries/container-selection.html container-queries/container-size-invalidation-after-load.html container-queries/container-size-invalidation.html container-queries/container-size-nested-invalidation.html container-queries/container-size-shadow-invalidation.html container-queries/container-type-computed.html container-queries/container-type-containment.html container-queries/container-type-invalidation.html container-queries/container-type-layout-invalidation.html container-queries/container-type-parsing.html container-queries/container-units-animation.html container-queries/container-units-basic.html container-queries/container-units-computational-independence.html container-queries/container-units-gradient-invalidation.html container-queries/container-units-gradient.html container-queries/container-units-in-at-container-dynamic.html container-queries/container-units-in-at-container-fallback.html container-queries/container-units-in-at-container.html container-queries/container-units-ineligible-container.html container-queries/container-units-invalidation.html container-queries/container-units-media-queries.html container-queries/container-units-selection.html container-queries/container-units-shadow.html container-queries/container-units-small-viewport-fallback.html container-queries/container-units-svglength.html container-queries/container-units-typed-om.html container-queries/counters-flex-circular.html container-queries/counters-in-container-dynamic.html container-queries/counters-in-container.html container-queries/crashtests/br-crash.html container-queries/crashtests/canvas-as-container-crash.html container-queries/crashtests/chrome-bug-1289718-000-crash.html container-queries/crashtests/chrome-bug-1289718-001-crash.html container-queries/crashtests/chrome-bug-1346969-crash.html container-queries/crashtests/chrome-bug-1362391-crash.html container-queries/crashtests/chrome-layout-root-crash.html container-queries/crashtests/chrome-quotes-crash.html container-queries/crashtests/chrome-remove-insert-evaluator-crash.html container-queries/crashtests/columns-in-table-001-crash.html container-queries/crashtests/columns-in-table-002-crash.html container-queries/crashtests/container-in-canvas-crash.html container-queries/crashtests/container-type-change-chrome-legacy-crash.html container-queries/crashtests/dirty-rowgroup-crash.html container-queries/crashtests/flex-in-columns-000-crash.html container-queries/crashtests/flex-in-columns-001-crash.html container-queries/crashtests/flex-in-columns-002-crash.html container-queries/crashtests/flex-in-columns-003-crash.html container-queries/crashtests/focus-inside-content-visibility-crash.html container-queries/crashtests/force-sibling-style-crash.html container-queries/crashtests/grid-in-columns-000-crash.html container-queries/crashtests/grid-in-columns-001-crash.html container-queries/crashtests/grid-in-columns-002-crash.html container-queries/crashtests/grid-in-columns-003-crash.html container-queries/crashtests/iframe-init-crash.html container-queries/crashtests/inline-multicol-inside-container-crash.html container-queries/crashtests/inline-with-columns-000-crash.html container-queries/crashtests/inline-with-columns-001-crash.html container-queries/crashtests/input-column-group-container-crash.html container-queries/crashtests/input-placeholder-inline-size-crash.html container-queries/crashtests/marker-gcs-after-disconnect-crash.html container-queries/crashtests/math-block-container-child-crash.html container-queries/crashtests/orthogonal-replaced-crash.html container-queries/crashtests/pseudo-container-crash.html container-queries/crashtests/reversed-ol-crash.html container-queries/crashtests/svg-layout-root-crash.html container-queries/crashtests/svg-text-crash.html container-queries/crashtests/table-in-columns-000-crash.html container-queries/crashtests/table-in-columns-001-crash.html container-queries/crashtests/table-in-columns-002-crash.html container-queries/crashtests/table-in-columns-003-crash.html container-queries/crashtests/table-in-columns-004-crash.html container-queries/crashtests/table-in-columns-005-crash.html container-queries/custom-layout-container-001.https.html container-queries/custom-property-style-queries.html container-queries/custom-property-style-query-change.html container-queries/deep-nested-inline-size-containers.html container-queries/display-contents.html container-queries/display-in-container.html container-queries/display-none.html container-queries/fieldset-legend-change.html container-queries/font-relative-calc-dynamic.html container-queries/font-relative-units-dynamic.html container-queries/font-relative-units.html container-queries/fragmented-container-001.html container-queries/get-animations.html container-queries/grid-container.html container-queries/grid-item-container.html container-queries/idlharness.html container-queries/iframe-in-container-invalidation.html container-queries/iframe-invalidation.html container-queries/ineligible-containment.html container-queries/inline-size-and-min-width.html container-queries/inline-size-bfc-floats.html container-queries/inline-size-containment-vertical-rl.html container-queries/inline-size-containment.html container-queries/inner-first-line-non-matching.html container-queries/layout-dependent-focus.html container-queries/multicol-container-001.html container-queries/multicol-inside-container.html container-queries/nested-query-containers.html container-queries/never-match-container.html container-queries/orthogonal-wm-container-query.html container-queries/percentage-padding-orthogonal.html container-queries/pseudo-elements-001.html container-queries/pseudo-elements-002.html container-queries/pseudo-elements-003.html container-queries/pseudo-elements-004.html container-queries/pseudo-elements-005.html container-queries/pseudo-elements-006.html container-queries/pseudo-elements-007.html container-queries/pseudo-elements-008.html container-queries/query-content-box.html container-queries/query-evaluation.html container-queries/reattach-container-with-dirty-child.html container-queries/resize-while-content-visibility-hidden.html container-queries/sibling-layout-dependency.html container-queries/size-container-no-principal-box.html container-queries/size-feature-evaluation.html container-queries/style-change-in-container.html container-queries/style-not-sharing-float.html container-queries/svg-foreignobject-child-container.html container-queries/svg-foreignobject-no-size-container.html container-queries/svg-g-no-size-container.html container-queries/svg-root-size-container.html container-queries/table-inside-container-changing-display.html container-queries/top-layer-dialog-backdrop.html container-queries/top-layer-dialog-container.html container-queries/top-layer-dialog.html container-queries/top-layer-nested-dialog.html container-queries/transition-scrollbars.html container-queries/transition-style-change-event-002.html container-queries/transition-style-change-event.html container-queries/unsupported-axis.html container-queries/viewport-units-dynamic.html container-queries/viewport-units.html container-queries/whitespace-update-after-removal.html content-visibility/animation-display-lock.html content-visibility/content-visibility-001.html content-visibility/content-visibility-002.html content-visibility/content-visibility-003.html content-visibility/content-visibility-004.html content-visibility/content-visibility-005.html content-visibility/content-visibility-006.html content-visibility/content-visibility-007.html content-visibility/content-visibility-008.html content-visibility/content-visibility-009.html content-visibility/content-visibility-010.html content-visibility/content-visibility-011.html content-visibility/content-visibility-012.html content-visibility/content-visibility-013.html content-visibility/content-visibility-014.html content-visibility/content-visibility-015.html content-visibility/content-visibility-016.html content-visibility/content-visibility-017.html content-visibility/content-visibility-018.html content-visibility/content-visibility-019.sub.https.html content-visibility/content-visibility-020.html content-visibility/content-visibility-021.html content-visibility/content-visibility-022.html content-visibility/content-visibility-023.html content-visibility/content-visibility-024.html content-visibility/content-visibility-025.html content-visibility/content-visibility-026.html content-visibility/content-visibility-027.html content-visibility/content-visibility-028.html content-visibility/content-visibility-029.html content-visibility/content-visibility-030.html content-visibility/content-visibility-031.html content-visibility/content-visibility-032.html content-visibility/content-visibility-033.sub.https.html content-visibility/content-visibility-034.html content-visibility/content-visibility-035.html content-visibility/content-visibility-036.html content-visibility/content-visibility-037.html content-visibility/content-visibility-038.html content-visibility/content-visibility-039.html content-visibility/content-visibility-040.html content-visibility/content-visibility-041.html content-visibility/content-visibility-042.html content-visibility/content-visibility-043.html content-visibility/content-visibility-044.html content-visibility/content-visibility-045.html content-visibility/content-visibility-046.html content-visibility/content-visibility-047.html content-visibility/content-visibility-048.html content-visibility/content-visibility-049.html content-visibility/content-visibility-050.html content-visibility/content-visibility-051.html content-visibility/content-visibility-052.html content-visibility/content-visibility-053.html content-visibility/content-visibility-054.html content-visibility/content-visibility-055.html content-visibility/content-visibility-056.html content-visibility/content-visibility-057.html content-visibility/content-visibility-058.html content-visibility/content-visibility-060.html content-visibility/content-visibility-061.html content-visibility/content-visibility-062.html content-visibility/content-visibility-063.html content-visibility/content-visibility-064.html content-visibility/content-visibility-065.html content-visibility/content-visibility-066.html content-visibility/content-visibility-067.html content-visibility/content-visibility-068.html content-visibility/content-visibility-069.html content-visibility/content-visibility-070.html content-visibility/content-visibility-071.html content-visibility/content-visibility-072.html content-visibility/content-visibility-073.html content-visibility/content-visibility-074.html content-visibility/content-visibility-075.html content-visibility/content-visibility-076.html content-visibility/content-visibility-077.html content-visibility/content-visibility-078.html content-visibility/content-visibility-079.html content-visibility/content-visibility-080.html content-visibility/content-visibility-081.html content-visibility/content-visibility-082.html content-visibility/content-visibility-083.html content-visibility/content-visibility-084.html content-visibility/content-visibility-auto-in-iframe.html content-visibility/content-visibility-auto-intrinsic-width.html content-visibility/content-visibility-auto-selection-crash.html content-visibility/content-visibility-auto-state-changed-first-observation.html content-visibility/content-visibility-auto-state-changed-removed.html content-visibility/content-visibility-auto-state-changed.html content-visibility/content-visibility-canvas.html content-visibility/content-visibility-continuations-crash.html content-visibility/content-visibility-fieldset-size.html content-visibility/content-visibility-forced-layout-client-rects.html content-visibility/content-visibility-form-controls-crash.html content-visibility/content-visibility-hit-test-contents-crash.html content-visibility/content-visibility-img.html content-visibility/content-visibility-in-svg-000-crash.html content-visibility/content-visibility-input-image.html content-visibility/content-visibility-output-crash.html content-visibility/content-visibility-resize-observer-no-error.html content-visibility/content-visibility-svg.html content-visibility/content-visibility-video.html content-visibility/content-visibility-with-top-layer-000.html content-visibility/content-visibility-with-top-layer-001.html content-visibility/content-visibility-with-top-layer-002.html content-visibility/content-visibility-with-top-layer-003.html content-visibility/content-visibility-with-top-layer-004.html content-visibility/content-visibility-with-top-layer-005.html content-visibility/content-visibility-with-top-layer-006.html content-visibility/content-visibility-with-top-layer-hide-after-addition.html content-visibility/contentvisibility-nestedslot-crash.html content-visibility/crashtests/first-line-and-inline-block.html content-visibility/detach-locked-slot-children-crash.html content-visibility/document-element-computed-style.html content-visibility/dynamic-change-paint-fully-obscuring-child-001.html content-visibility/element-reassigned-to-skipped-slot.html content-visibility/element-reassigned-to-slot-in-skipped-subtree.html content-visibility/hidden-execcommand-crash.html content-visibility/hidden-pseudo-element-removed-crash.html content-visibility/inheritance.html content-visibility/meter-selection-crash.html content-visibility/parsing/content-visibility-computed.html content-visibility/parsing/content-visibility-invalid.html content-visibility/parsing/content-visibility-valid.html content-visibility/scrollIntoView-target-with-contents-hidden.html content-visibility/scrollIntoView-with-focus-target-with-contents-hidden.html content-visibility/slot-content-visibility-1-crash.html content-visibility/slot-content-visibility-10-crash.html content-visibility/slot-content-visibility-11-crash.html content-visibility/slot-content-visibility-12-crash.html content-visibility/slot-content-visibility-13-crash.html content-visibility/slot-content-visibility-14-crash.html content-visibility/slot-content-visibility-15-crash.html content-visibility/slot-content-visibility-16-crash.html content-visibility/slot-content-visibility-17-crash.html content-visibility/slot-content-visibility-18-crash.html content-visibility/slot-content-visibility-19-crash.html content-visibility/slot-content-visibility-2-crash.html content-visibility/slot-content-visibility-20-crash.html content-visibility/slot-content-visibility-21-crash.html content-visibility/slot-content-visibility-22-crash.html content-visibility/slot-content-visibility-3-crash.html content-visibility/slot-content-visibility-4-crash.html content-visibility/slot-content-visibility-5-crash.html content-visibility/slot-content-visibility-6-crash.html content-visibility/slot-content-visibility-7-crash.html content-visibility/slot-content-visibility-8-crash.html content-visibility/slot-content-visibility-9-crash.html quote-scoping-empty-style-boundaries.html