w3c / w3c/csswg-drafts

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

Open
#5,563 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Commenter Response Pending css-sizing-4
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked CSS Sizing Level 4 aspect-ratio section and compare its preferred-aspect-ratio rule with the SVG and img examples in the report. Determine whether the intrinsic-size transfer behavior is intended, and make the specification's resolution or rationale explicit in that section.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.