Skip to content

[css-sizing] Intrinsic min/max block sizes with aspect ratio? #12333

Open
@Loirooriol

Description

@Loirooriol
<!DOCTYPE html>
<style>
canvas, div { display: block; border: solid cyan; height: 0; width: max-content; min-width: 0; aspect-ratio: 1; }
div::before { content: ""; display: block; width: 50px; height: 50px }
</style>
<canvas width="50" height="50" style="height: 0px; min-height: max-content"></canvas>
<canvas width="50" height="50" style="height: 100px; max-height: max-content"></canvas>
<div style="height: 0px; min-height: max-content"></div>
<div style="height: 100px; max-height: max-content"></div>
<script>
document.write([...document.querySelectorAll("canvas, div")].map(el => el.clientWidth + " x " + el.clientHeight).join("<br>"))
</script>
Blink WebKit

Is the behavior supposed to be different for a replaced element than for a non-replaced one?

What should the behavior be if I use aspect-ratio: 2 instead?

Blink WebKit

Back to aspect-ratio: 1, what should happen if I use min-width: auto?

Blink WebKit

CC @bfgeek

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