Re: [csswg-drafts] Proposal: content-size CSS property (#4229)

The CSS Working Group just discussed `Contain Size`, and agreed to the following:

* `RESOLVED: Add proxy-width/height/inline-size/block-size with values legacy | auto | <length>`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Contain Size<br>
&lt;astearns> explainer: https://github.com/WICG/display-locking/blob/master/explainer-content-size.md<br>
&lt;fantasai> chrishtr: Posted a new explainer<br>
&lt;dbaron> s/Contain Size/content-size/<br>
&lt;fantasai> chrishtr: content-size is a new CSS property<br>
&lt;fantasai> chrishtr: If 'contain: size' is specified, content-size is treated as intrinsic size of contents<br>
&lt;fantasai> chrishtr: proposing that be able to set intrinsic width/height passed to intrinsic sizing algorithms<br>
&lt;fantasai> chrishtr: Reason we believe it's useful is that you can use it when a subtree is not yet ready or you don't want it to have its own layout<br>
&lt;fantasai> chrishtr: can express a placeholder sizing for it<br>
&lt;fantasai> chrishtr: Allows communicating that placeholder sizing, so that flex/grid/table/etc can take that into account<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/4229<br>
&lt;fantasai> chrishtr: If we've skipped rendering as an optimization, dev can use to communicate placeholder sizing<br>
&lt;fantasai> SimonSapin: Would this property apply without 'contain'?<br>
&lt;Rossen_> a?<br>
&lt;fantasai> chrishtr: When you don't have 'contain: size', no<br>
&lt;Rossen_> q?<br>
&lt;AmeliaBR> q+<br>
&lt;fantasai> chrishtr: Only applies when 'contain: size'. Reason is that 'contain: size' causes no competing intrinsic size<br>
&lt;fantasai> chrishtr: 2nd reason is that it fits neatly with render subtree attribute proposal<br>
&lt;fantasai> florian: Can you expand on the second point? I'm not faimilar with that<br>
&lt;fantasai> florian: In isolation proposition makes sense, but not sure why it's not coupled with a more generic intrinsic size feature<br>
&lt;fantasai> TabAtkins: One reason was that, as chrishtr said, that means you have competing information. We don't think that's useful to have two sources of truth there<br>
&lt;fantasai> TabAtkins: Seems like only time you need to provide a better intrinsic size is when you're contain sizing already<br>
&lt;fantasai> dbaron: I'm skeptical of that<br>
&lt;fantasai> dbaron: I think there are a bunch of cases, where intrinsic sizing doesn't provide good results and devs might wnat to provide it<br>
&lt;fantasai> dbaron: Talked about some o those cases in the past<br>
&lt;fantasai> dbaron: Some cases devs want to override only in one dimension<br>
&lt;fantasai> TabAtkins: Bad behavior of intrins scorllers maybe?<br>
&lt;fantasai> TabAtkins: flexboxes blowing up<br>
&lt;fantasai> dbaron: Didn't have that in my head, but sure<br>
&lt;fantasai> TabAtkins: That's intriguing<br>
&lt;fantasai> AmeliaBR: Also cases we've had where certain modes cause things to collapse down to zero, and might be better not to<br>
&lt;fantasai> AmeliaBR: Lots of cases there might be a demand for it<br>
&lt;fantasai> AmeliaBR: Wrt naming, 'content-size' might be interepreted as size of content-box<br>
&lt;fantasai> AmeliaBR: If there is a limitation, tho, should be good reasons for it<br>
&lt;fantasai> TabAtkins: Yes, happy to come up with better name<br>
&lt;Rossen_> q?<br>
&lt;chris> rrsagent, here<br>
&lt;RRSAgent> See https://www.w3.org/2019/09/15-css-irc#T00-39-05<br>
&lt;fantasai> TabAtkins: Cases that fantasai and I identified where boxes get too big in intrinsic sizing, and currently don't have a way to opt into better behavior<br>
&lt;AmeliaBR> ack me<br>
&lt;fantasai> TabAtkins: In some cases can inflate itnrinsic size, others might be able to shrink<br>
&lt;fantasai> TabAtkins: good idea<br>
&lt;Rossen_> ack fantasai<br>
&lt;florian> fantasai: Support florian and dbaron , this should probably be a generic mechanism<br>
&lt;florian> fantasai: the value space would be legacy | auto | &lt;size><br>
&lt;florian> ???: what is the diff between legacy and auto<br>
&lt;TabAtkins> s/???/cbiesinger/<br>
&lt;florian> fantasai: scrollers collapsing to 0 or not<br>
&lt;florian> fantasai: if inside a flex item, there is an overflow:scroll pre element with a very long line, the min-content size is the size of the very long line, that makes the flex item be very large, even though we could just have made it into a scroller<br>
&lt;fantasai> TabAtkins: Semantics are still a bit funky, if you provide a size wouldn't do anything unless you're contain: size<br>
&lt;fantasai> fantasai: Well, I think it would<br>
&lt;xfq_> ack dbaron<br>
&lt;fantasai> dbaron: I would also note that there are cases where intrinsic sizing provids sizes that are too small, e.g. in cases with percents<br>
&lt;florian> fantasai: if you specify an explicit size, that takes over and you ignore the content<br>
&lt;fantasai> TabAtkins: Could do that... was wondering if you wanted to max them<br>
&lt;fantasai> AmeliaBR: Doing a max or min doesn't work if we want to accept both use cases of dealing with cases where intrinsic size is too big or too small<br>
&lt;fantasai> AmeliaBR: Just say if you specify a value, you wanted to override<br>
&lt;fantasai> chrishtr: All these examples that were alluded to but not explicit, please write into issue<br>
&lt;fantasai> fantasai: Based on discussion, this doesn't go into contain, goes into Sizing level 4<br>
&lt;florian> fantasai: based on this discussion, this goes into sizing-4, not contain-2<br>
&lt;fantasai> Rossen_: Anything else on this topic<br>
&lt;fantasai> TabAtkins: Discussion was good<br>
&lt;fantasai> chrishtr: Point Florian raised about, what are you talking about wrt render subtree<br>
&lt;fantasai> chrishtr: maybe wait until we talk about that<br>
&lt;fantasai> chrishtr: but 5min background on render subtree, though it's on the HTML spec<br>
&lt;fantasai> chrishtr: package, how they fit together matters, so just want to mention<br>
&lt;fantasai> Rossen_: we can put that topic next<br>
&lt;fantasai> chrishtr: Just want to give an overview of what it is, what use csaes are, how it functions<br>
&lt;fantasai> chrishtr: so can get some feedback<br>
&lt;fantasai> Rossen_: So content-size, or whatever we're going to call it, will go to size level 4<br>
&lt;fantasai> Rossen_: Any objections to add it?<br>
&lt;chrishtr> Explainer that contains rendersubtree: https://github.com/WICG/display-locking/blob/master/README.md<br>
&lt;fantasai> TabAtkins: maybe call it intrinsic-size<br>
&lt;fantasai> fantasai: Nobody wants to spell that<br>
&lt;fantasai> TabAtkins: true<br>
&lt;fantasai> fantasai: There was a suggestion that this be split into width/height not one property for both dimensions<br>
&lt;fantasai> fantasai: Seems to be the proposal is foo-width/height/inline-size/block-size<br>
&lt;fantasai> iank_: legacy as initial value?<br>
&lt;fantasai> PROPOSAL: Add proxy-width/height/inline-size/block-size with values legacy | auto | &lt;length><br>
&lt;fantasai> RESOLVED: Add proxy-width/height/inline-size/block-size with values legacy | auto | &lt;length><br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4229#issuecomment-531615054 using your GitHub account

Received on Monday, 16 September 2019 00:49:16 UTC