[css-sizing] Intrinsic size of replaced elements incorrect #794

Closed
fantasai opened this Issue Dec 7, 2016 · 6 comments

Comments

Projects
None yet
5 participants
Contributor

fantasai commented Dec 7, 2016

Currently Sizing 3 defines intrinsic sizes of replaced elements explicitly.
This definition isn't correct, and it should be deleted in favor of falling through to the CSS2.1 reference used for non-replaced elements.

fantasai added a commit that referenced this issue Dec 19, 2016

[css-sizing] Defer sizing of replaced elements to CSS2.1 algorithms, …
…since the one here isn't quite correct. Addresses #794.

@fantasai fantasai added the Agenda+ label Dec 19, 2016

Contributor

fantasai commented Dec 19, 2016

Agenda+ to point out that the implication here is that, when an aspect ratio is present, min-content and max-content are dependent on sizing constraints in the opposite axis. (This might be surprising/disturbing to implementers but is probably as expected for authors.)

Member

dbaron commented Dec 20, 2016

I really don't want min-content and max-content to be anything other than intrinsic sizes. And, in particular, I want them never to depend on the element's own specified sizes, precisely so that they can be used as keywords for the element's specified sizes.

Doing so could cause problems down the road if we ever add the ability for calc() expressions to reference concepts like "this element's min-content size in the other dimension" or "the grandparent element's size". (The latter is harder than the former, but we might be able to come up with a set of ways where it does make sense or a way of resolving the constraints, and having things like "intrinsic" sizes that are almost but not quite always intrinsic would make that harder.)

Contributor

fantasai commented Jan 4, 2017

The problem with that is then we don't have a keyword for "shrinkwrap this thing as if it was a float with (infinite/minimal space)", which is what you generally want in e.g. grid track sizing.

@fantasai fantasai added Agenda+ F2F and removed Agenda+ labels Jan 4, 2017

@astearns astearns removed the Agenda+ F2F label Jan 11, 2017

Member

dbaron commented Feb 17, 2017

I just discussed this a bit with @fantasai.

To clarify what I want instead: I'd like the width and the height to both be considered when computing an element's min-content contribution to its parent. Right now (assuming we're talking about English layout, i.e., min-content as a width), it's clear that for width, an element's min-content width doesn't consider its width property (this allows things like width: min-content). What we're disagreeing about is whether this is the same for how height is considered, on elements that have an intrinsic ratio. I'd like the height to be considered at the same stage as width, whereas @fantasai wants it to be considered earlier, so that it's incorporated into what the min-content value means.

I don't think the grid track sizing thing is an issue, since that should be depending on the min-content contribution, which is affected by the aspect ratio with either proposal.

@fantasai's approach has the advantage (for the spec authors, and maybe implementors) that defining what width: auto means is much simpler. With my approach, the meaning of width: auto is more complicated since it has special rules for replaced elements.

There isn't a distinct author feature in @fantasai's proposal, I don't think; auto will still work the way she wants min-content and max-content to behave. So with what I'm proposing there are more behaviors exposed to authors, although they seem unlikely to be useful (although I believe they are underlying primitives).

I still think my proposal is more future-proof for features like the ones I described above in #794 (comment)

@astearns astearns removed the Agenda+ F2F label Aug 1, 2017

Contributor

fantasai commented Aug 3, 2017

Propose to close as fixed, after f2f discussions with dbaron in SF.

@fantasai fantasai closed this Aug 3, 2017

@fantasai fantasai reopened this Aug 3, 2017

@fantasai fantasai added the Agenda+ label Aug 9, 2017

The CSS Working Group just discussed Intrinsic size of replaced elements incorrect, and agreed to the following resolutions:

  • RESOLVED: Close the issue
The full IRC log of that discussion <dael> Topic: Intrinsic size of replaced elements incorrect
<dael> github topic https://github.com/w3c/csswg-drafts/issues/794
<dael> github: https://github.com/w3c/csswg-drafts/issues/794
<dael> fantasai: There's a definition in the sizing spec about what the min and max content size of images are. We defined to account for sizing constriant in opposite axis. We're defining by reference to css 2.1
<dael> fantasai: dbaron wanted these keywords to represent actual intrinisic size. I spoke with him and he said givent he way impl behave in grid he's unhappy about defining it that way be is okay. As far as the definition dbaron wants we can add another set of keywords if authors want to express that.
<dael> fantasai: Seems unlikely as an author want, but might be useful for Houdini things.
<dael> dbaron: I think that's a reasonable summary.
<dael> fantasai: If everyone is happy with the state we can close as we've defined the sizing.
<dael> Chris: Objections?
<dael> Chris: Anyone need time to think?
<dael> RESOLVED: Close the issue

@tabatkins tabatkins closed this Oct 27, 2017

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