Re: [csswg-drafts] [css-conditional] [css-contain] `srcset` and `sizes` interaction with container queries (#5889)

The CSS Working Group just discussed ``[css-conditional] [css-contain] `srcset` and `sizes` interaction with container queries``.

<details><summary>The full IRC log of that discussion</summary>
&lt;astearns> topic: [css-conditional] [css-contain] `srcset` and `sizes` interaction with container queries<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/5889<br>
&lt;dlibby> una: next issue is related - how to deal with responsive images in container queries<br>
&lt;dlibby> una: would like to explore the solution space, since it seems like it'll be pretty common<br>
&lt;dlibby> una: adding a ??? to srcset, setting images on each compute, since they come from server<br>
&lt;bkardell_> q+<br>
&lt;dlibby> una: how should container queries interact, and background images are also a consideration<br>
&lt;bkardell_> how would this work with preloading? https://web.dev/preload-responsive-images/<br>
&lt;dlibby> s/???/new syntax/<br>
&lt;dlibby> una: do something simliar to media queries but seems important to consider for container queries<br>
&lt;astearns> ack bkardell_<br>
&lt;dlibby> bkardell: preloading - see linked article. you can't know what to load until later<br>
&lt;dlibby> una: yes, tricky because working at compute time, not sure how this works for viewport size<br>
&lt;dlibby> emilio: you can estimate what your viewport is<br>
&lt;dlibby> emilio: you can make a decent guess in iframes<br>
&lt;dlibby> emilio: you can't really do this in containers<br>
&lt;dlibby> iank: relatively sure that gecko and chromium reference image via background: url(foo), but can have multiple decls<br>
&lt;dlibby> iank: UA load images after computed value time so you don't load lots of things in the background<br>
&lt;dlibby> iank: it's a performance tradeoff<br>
&lt;dlibby> emilio: &lt;img> tags are a little more important as user wants to immediatly see it<br>
&lt;dlibby> florian: worried that this could make slow connections slower<br>
&lt;dlibby> florian: you normally don't get all resources at the first request, progressive modification, which happens more on slow networks. as this happens container can change, possible to congest/thrash network<br>
&lt;dlibby> florian: that sounds unfortunate side effect<br>
&lt;dlibby> una: if youre using container queries and there's a hero, or in a card, or sidebar, those are different<br>
&lt;dlibby> una: if container queries allow for composable styles in components, I can't imagine that we can't have different image sizes based on the size<br>
&lt;bkardell_> not just image sizes maybe different art direction too?<br>
&lt;dlibby> una: not sure if it is slower to load a bunch of images first, or layout first then download other images<br>
&lt;bkardell_> I suggest we send this to RICG :)<br>
&lt;dlibby> florian: use case makes sense - should and can are different questions<br>
&lt;dlibby> florian: if you have multiple small parts, many changes could be happening, and as the stylesheet comes in over network, you might end up loading all the images<br>
&lt;dlibby> florian: ending up there sounds bad, but perhaps there's another approach<br>
&lt;dlibby> myles: problem appears endemic to container queries<br>
&lt;dlibby> florian: most thrashing doesn't hit the network for each change<br>
&lt;dlibby> una: perhaps we can scope to initial load to avoid this problem - maybe solves the majority use cases<br>
&lt;dlibby> emilio: not sure - if you resize the window, you'd bet stuck in possible suboptimal state<br>
&lt;fantasai> I was about to say the same thing also<br>
&lt;dlibby> myles: I don't think visual layout should be permanently affected based on network speed<br>
&lt;dlibby> myles: CSS shouldn't be sensitive to timing of bytes on the wire<br>
&lt;dlibby> una: might be misunderstanding. when we figure out the layout size keep that image<br>
&lt;dlibby> una: refresh page would get different images<br>
&lt;dlibby> emilio: layout while stylesheets are outstanding is common. stylesheet in body can affect the page layout, this should be taken into account<br>
&lt;dlibby> iank: the place where this functionality may make sense is html layout. some components are already stateful, but this should be carefully considered<br>
&lt;dlibby> e.g. a oneshot load - how does this affect the html layout, something to consider<br>
&lt;nicole> a balance btw not requesting unnecessary images and not waiting to load images until css is done parsing<br>
&lt;dlibby> myles: maybe specify behavior, UAs can use different heuristics<br>
&lt;dlibby> myles: CSSWG doesn't have to specify when loads are triggered<br>
&lt;dlibby> iank: option for this would be adding to Image specificiation (perhaps additional data on &lt;img>) once this has been laid out and it reaches 'stable' state, then UA can fire off request<br>
&lt;dlibby> ???: problem with containment in general?<br>
&lt;fantasai> s/????/nicole/<br>
&lt;fantasai> s/???/nicole/<br>
&lt;dlibby> emilio: perhaps one approach is to define what the behavior should be (lazy or something). just a gneeral problem with containment.<br>
&lt;dlibby> s/containment/container queries/<br>
&lt;dlibby> iank: reasonably easy to polyfill, prototype, iterate to discover 'good behavior'<br>
&lt;dlibby> iank: don't have to nail down spec text right now, we can try to find optimal via prototyping<br>
&lt;dlibby> bkardell: might be good to ask folks on ??? CG<br>
&lt;jensimmo_> yes, do ask Mat.<br>
&lt;dlibby> bkardell: to the point of wanting different size, you might want different art directives(?)<br>
&lt;dlibby> astearns: is it possible to load different images?<br>
&lt;dlibby> iank: yes this is possible to get different urls<br>
&lt;dlibby> astearns: that is for separate declarations, but this is for a single declaration<br>
&lt;dlibby> iank: i was referring to img tag attribute, there's nothing in CSS currently that allows for this<br>
&lt;dlibby> nicole: having it in CSS should be the same problem as having this specified in the html itself. likely has same characteristics<br>
&lt;dlibby> una: i recognize that this is probably for specification in HTML<br>
&lt;dlibby> una: glad bkardell brought up different images - third party service could provide different crops<br>
&lt;dlibby> bkardell: precisely, that's what I wanted to be recognized<br>
&lt;dlibby> astearns: what else would you like to get from the group?<br>
&lt;dlibby> una: this conversation basically<br>
&lt;dlibby> astearns: perhaps prototyping per iank is the way forward, thanks for bringing it up<br>
</details>


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 12 February 2021 00:47:38 UTC