Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-sizing] Is aspect-ratio affected by box-sizing? #4665

Closed
emilio opened this issue Jan 13, 2020 · 3 comments
Closed

[css-sizing] Is aspect-ratio affected by box-sizing? #4665

emilio opened this issue Jan 13, 2020 · 3 comments

Comments

@emilio
Copy link
Collaborator

emilio commented Jan 13, 2020

For regular replaced elements it makes sense that the content box is what preserves the ratio:

data:text/html,<img src="http://w3c-test.org/images/blue96x96.png" style="border-width: 10px 40px; border-style: solid; width: 80px; display: block;">

It's less clear to me that's the desired behavior for aspect-ratio. Is it?

@fantasai
Copy link
Collaborator

Seems pretty clear in the spec:

auto
Replaced elements with an intrinsic aspect ratio use that aspect ratio; otherwise the box has no preferred aspect ratio. Size calculations involving intrinsic aspect ratio work with the content box dimensions always.
<ratio>
The box’s preferred aspect ratio is the specified ratio of width / height. Size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing.

I guess the exciting thing is what happens with <img width=x height=y>: we want HTML to map into CSS syntax, but the current HTML spec defines the aspect ratio as an "intrinsic aspect ratio"...

@fantasai
Copy link
Collaborator

Filed #4951 on the HTML mapping issue. Closing out since afaict the spec is clear. :)

@Loirooriol
Copy link
Contributor

BTW, this was discussed in #4007 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants