W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

Re: [csswg-drafts] [css-sizing] Decide how to handle `min-width/min-height: auto` for non-grid/flex items

From: Daniel Holbert via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Feb 2018 03:00:08 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-363640709-1517972405-sysbot+gh@w3.org>
> @dholbert, since you filed this issue, what do you think it'd take to determine whether this has been implemented or not, somewhere down the line? If 

Here are the key things that'd be worth asserting, which are related to this issue (and please interpret "minWidth" as "both minWidth and minHeight, independently" below):
 - `getComputedStyle(someDiv, "").minWidth == 0` for a child of a `display:block` or `display:table` element. (a child of any non-{flex,grid} container, really)
 - `getComputedStyle(someDiv, "").minWidth == 'auto'` for a child of a `display:flex` or `display:grid` element.

And then here's the subtle part...
 - `getComputedStyle(someDiv, "").minWidth == 'auto'` for a child of a `display:flex` or `display:grid` element, **and** with explicit `min-width: inherit` on that child.

That last point is the part that is new here as of 7272dc5.  Previously, the spec required the parent container's default `min-width` to  *compute to 0*, and since computed values are what's inherited, then the explicit `min-width:inherit` on the child would've made it inherit 0, rather than `auto`.  But after 7272dc5, since the "auto-->0" resolution will happen at resolved-value time, the child would inherit `auto`, and return `auto` from getComputedStyle (since it's flex item).

I suspect/expect that browsers already have the behavior that I'm proposing here, since it's strictly simpler (requiring less logic / special-casing at computation time). But I'm not sure.

GitHub Notification of comment by dholbert
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2248#issuecomment-363640709 using your GitHub account
Received on Wednesday, 7 February 2018 03:00:12 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC