-
Notifications
You must be signed in to change notification settings - Fork 669
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-flexbox] Should definite cross size be used to compute flex item's transferred size suggestion? #5663
Comments
I think Chrome matches the spec here[1] but firefox's behavior is better[2], so we should change the wording of transferred size suggestion from
to something like
Which matches the wording in 9.8 and makes clear that items with definite sizes imposed by the 9.8 rule qualify for the transferred size suggestion. [1] The computed cross size property in the example above is not definite, which means there is no transferred size suggestion. [2] Because Chrome's behavior in https://jsfiddle.net/dgrogan/jd76er1y/ is gross. One image has its aspect ratio respected but the other confusingly doesn't. In Firefox both images have their aspect ratio respected. |
Okay, 0c1a35d fixes up the terminology to hopefully make this clearer; at the time we wrote the min-auto section of the spec, we didn't have terminology like "preferred size" defined, so we had to refer directly to the properties; I recall us finding that awkward but not having a better option at the time. Is it clear that if one of the preferred sizes for a box is definite, the rest are too, so long as they're calculated by fixed values? Like if the outer size is definite, and margin/border/padding are all definite values, that the inner size will be definite as well? |
(We aligned Grid with this same terminology as well, and took some time to make sure the two texts were as parallel as possible; some tiny discrepancies had come in accidentally.) |
(Posting on behalf of @fantasai, whose internet just broke)
|
Thanks, this all looks good, I'd call it resolved.
Yep, that makes sense. |
The edited spec looks good to me. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-flexbox] Should definite cross size be used to compute flex item's transferred size suggestion?<dael> github: https://github.com//issues/5663 <dael> TabAtkins: There's a question about terms we're using in 2 parts of spec. In 9.8 where we define etra ways for lengths to get def we talk about outer cross size. In earlier sections for min size one of the conditions was stated as relying on cross size being defininte. Unclear if one being definite was meant to apply to other term. <dael> TabAtkins: Edited spec for more consistent. Didn't have right terms and said "property" waht we want is preferred size. dgrogan confirmed it looked good. Unless other thoughts I think we can close with this fix <dael> astearns: Original commentor just replied saying good <dael> fantasai: I say we close as editorial <dael> astearns: Prop is close this issue and an editorial change <dael> astearns: Obj? <dael> RESOLVED: close this issue as an editorial change <dael> astearns: Thanks for the updates |
The wpt test landed for this in http://wpt.live/css/css-flexbox/flex-aspect-ratio-img-row-013.html. Tomorrow's chrome canary will pass it. |
As @davidsgrogan noticed in this comment, for transferred size, the spec says:
In 9.8, the definite rule says:
Should the stretched definite cross size be used in computing transferred size? Or in other words, should the transferred size defined as If the item has a preferred aspect ratio and a definite cross size, then ...? (similar to the flex algo 3B where a definite cross size is used to compute flex base size)
Consider the following example:
It's obvious that the image has no specified size suggestion and the content size suggestion is 300px. Currently Firefox Nightly gives the image 150px width as it does use definite cross size and aspect-ratio to compute to transferred size. Chrome and Safari gives the image 300px width. (I guess both implementations think the image has no transferred size.)
cc @tabatkins @dholbert
The text was updated successfully, but these errors were encountered: