Skip to content

[css-contain] Add contain-paint-margin CSS property #4934

@chrishtr

Description

@chrishtr

As mentioned in WICG/display-locking#147, the addition of contain:paint to subtree-visibility:auto elements constrains use of ink overflow to the border box of the element. This is good for avoiding flicker and limiting raster costs, but makes it difficult or awkward for developers to support content that has legitimate ink overflow.

This can be fixed by a new contain-paint-margin CSS property that allows the contain:paint clip to be expanded by a fixed amount. Syntax:

contain-paint-margin: none | <width height>

Here width and height are positive, physical lengths. none has the same effect as 0px 0px.

Even in cases where a developer is not using subtree-visibility but wishes to apply contain:paint, this property will still be useful as a way to allow a fixed amount of ink overflow.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions