-
Notifications
You must be signed in to change notification settings - Fork 709
[css-grid-2] Inconsistent min/max-content contribution for images that failed to load #11806
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
Comments
Not related to grid at all. In fact this seems rather under the scope of https://html.spec.whatwg.org/multipage/rendering.html#images-3 rather than CSS. <!DOCTYPE html>
<img src="about:invalid" style="min-width: 150px; width: 300px; border: solid">
Since the element has no Therefore, Blink is wrong to ignore Gecko and WebKit apply a natural aspect ratio of 1. HTML should probably clarify whether "treat the element as a replaced element" uses any natural sizes or ratio. |
Why? The spec already defines how to handle replaced inline elements with
But why does Chrome set the height of Row 2 to 200px instead of 400px? |
Don't ask me, I'm just describing what I see. Again, CSS can handle replaced elements with and without a natural ratio. It's just a matter of what HTML wants to do.
As I said, it seems a clear bug: it ignores |
Could you clarify what you mean by that? From what I understand, 10.6.2 clearly explains how to size the image in row 1, so I’d expect Firefox to follow that and set the height to 150px based on a 2:1 ratio. But it sounds like you’re saying HTML is the reason a 1:1 ratio is used. Why is that? Why don’t you think this is a Firefox bug? |
I never said that Firefox is right. HTML just says to treat as a replaced element. Replaced elements can have natural sizes and/or natural aspect ratio. HTML doesn't say whether the replaced element has them or not. Can we then infer that there is no natural aspect ratio? Not completely clear. Also, you keep saying that the natural ratio defaults to 2/1. That's not true, you can have SVGs which have no natural ratio. |
Since we already have So, why worry about what HTML says about an element’s natural sizes or aspect ratio when we’ve already got all the details: a) it's a replaced element, b) it has a preferred width, and c) there's a default behavior for height when the aspect ratio is missing (since there's no actual image)? the spec states:
|
We do NOT have the details about "none of the conditions above are met". There is no 2/1 ratio here: <!DOCTYPE html>
<svg style="width: 100px; height: auto; border: solid"></svg>
<svg style="width: 200px; height: auto; border: solid"></svg>
<svg style="width: 300px; height: auto; border: solid"></svg>
<svg style="width: 400px; height: auto; border: solid"></svg> |
I'm not disputing the results; I just don't understand why you say:
As far as I can tell, browsers don’t follow the spec in this case for SVG either." |
Had there been any default aspect ratio for SVG, we would surely get different heights. In that case, the 'none of the conditions above are met' scenario would indeed not apply—but that's not what we're seeing here. |
There is an inconsistency in how browsers handle
min-content
/max-content
contribution of images that fail to load within a CSS Grid.Test Case:
Firefox
Expected behavior based on CSS 2 Spec 10.6.2 and 10.3.2:
min-content
row including failed image) / Image HeightChrome
min-content
row including failed image)max-content
row including failed image)The text was updated successfully, but these errors were encountered: