W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

Re: [csswg-drafts] [css-grid] Replaced elements canvas, img, etc should behave as expected when styled with relative sizes in grid, transferred size should not affect them unless specifically asked to (#6278)

From: Ian Kilpatrick via GitHub <sysbot+gh@w3.org>
Date: Sun, 25 Jul 2021 22:50:39 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-886268968-1627253438-sysbot+gh@w3.org>
> @bfgeek That's roughly what we're saying, except we'd apply it to all compressible elements, and zero out the percentage in the preferred size cap rather than conditioning it on being a percentage, so that things like width: calc(10px + 1%) work continuously.

> The percentage resolves against 0 according to https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution

I think there needs to be a slightly larger discussion about how percentages resolve here, as this currently isn't how these expressions resolve in implementations (Safari, Firefox, and Chrome behave the same here). E.g. https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=9512

I'd be slightly concerned changing implementations here as this would be a pretty significant change from a web-compat point of view.
This discussion hinges on how this works, and implementations differ from the spec pretty significantly here. 

> So my hypothesis is that if Chromium implemented #3973 in order to be able to size grid items under a min-content constraint in the block axis, this min-content case would work like in Firefox. And then, the auto case would work thanks to the inequality

I believe that would be correct from a pure spec point of view, but this ties into the point above that there is a pretty large difference between the implementations and spec.

I still think the safest thing for this case would be if added another exception to https://drafts.csswg.org/css-grid-1/#min-size-auto
This would match FF's behaviour (exactly I believe FF isn't resolving this size against zero, rather just using the min-size - can test this be using a calc(), and a min-height in http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9434 and ignoring the other issues around transferred sizes).

-- 
GitHub Notification of comment by bfgeek
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6278#issuecomment-886268968 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 25 July 2021 22:50:41 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:39 UTC