Skip to content

[css-contain] Does inline-size containment remove the natural aspect ratio? #7583

Description

@Loirooriol

From https://drafts.csswg.org/css-contain-2/#containment-size, with full size containment,

Replaced elements must be treated as having an natural width and height of 0 and no natural aspect ratio.

From https://drafts.csswg.org/css-contain-3/#containment-inline-size,

Giving an element inline-size containment applies size containment to the inline-axis sizing of its principal box. This means the inline-axis intrinsic sizes of the principal box are determined as if the element had no content. However, content continues to impact the box’s block-axis intrinsic sizes as usual, and the box is allowed to fragment normally in the block axis.

I guess this means that only the natural inline-size is treated as 0, the natural block-size is preserved.

But what about the aspect ratio? Blink keeps it, Firefox removes it like in full size containment.

<img src="image" style="contain: inline-size; border: solid; height: 100px">

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions