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] Nobody floors min-content percentages in replaced elements by the transferred minimum size #10225

Open
Loirooriol opened this issue Apr 17, 2024 · 1 comment
Labels
css-sizing-3 Current Work

Comments

@Loirooriol
Copy link
Contributor

https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution

If the box is replaced, a cyclic percentage in the value of any max size property or preferred size property (width/max-width/height/max-height), is resolved against zero when calculating the min-content contribution in the corresponding axis. (See § 5.2.2 Compressible Replaced Elements for a list of which elements in HTML this applies to.) If the box also has a preferred aspect ratio, then this min-content contribution is floored by any minimum size from the opposite axis—​resolving any such percentage against zero—​transferred through the preferred aspect ratio.

I'm trying to implement this paragraph in Servo, but none of Gecko, Blink and WebKit seems to implement the last part.

<!DOCTYPE html>
<div style="width: 0; border: 10px solid">
  <div style="display: inline-block; border: 10px solid cyan">
    <canvas width="200" height="200" style="width: 200%; min-height: 200px; border: 10px solid orange"></canvas>
  </div>
</div>

Note the canvas has an aspect ratio of 1, but the min-height: 200px is not transferred to the inline axis: its inner min-content contribution is still zero.

@Loirooriol Loirooriol added the css-sizing-3 Current Work label Apr 17, 2024
@bfgeek
Copy link

bfgeek commented Apr 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-sizing-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants