Skip to content

[css-sizing-4] Aspect ratio supplying the missing intrinsic size axis is weird #5563

@cbiesinger

Description

@cbiesinger

https://drafts.csswg.org/css-sizing-4/#aspect-ratio

If a replaced element’s only intrinsic dimension is an intrinsic width or an intrinsic height, giving it a preferred aspect ratio also gives it an intrinsic height or width, whichever was missing, by transferring the existing size through the preferred aspect ratio.

This is different from how an intrinsic aspect ratio behaves. For example, <svg viewBox="0 0 1 1" width="100" /> will not have an intrinsic height, but <img src='data:image/svg,<svg viewBox="0 0 1 1" width="100" />' style='aspect-ratio: 1/1'> will have an intrinsic height per the spec. This seems weird?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions