-
Notifications
You must be signed in to change notification settings - Fork 31
srcset
/sizes
attributes for selectively preloading images
#120
Comments
This seems to be tricky.
|
@irori thanks I didn't realize that. This might give an additional motivation to go with option 2. (while naming is hard). What could be a candidate name for this option-- say, We could still go with something like (Would anyone have any thoughts? We plan to experiment this in chromium) |
It might be nice to align the names, so that they're e.g. |
Using |
cc: @developit |
In issue #127 it seems it was concluded that to avoid complexity on developers when matching the hash of a preload against an element with the Would that approach be applicable for matching preloads against images with |
Do you have particular proposal for not duplicating some values? |
Are we comfortable moving forward with |
Probably "imagesizes" and "imagesrcset" to match the as=image, as Malte pointed out. |
|
FYI I've posted whatwg/html#4048 as a start to the HTML-side of changes that'll like need made for this. The changes in this spec should be pretty trivial. |
A pretty good point has been brought up in that thread (summarized here) about how in the current setup, this can lead to a lot of unused image preloads, since |
Sample code: |
Discussed at TPAC 2018. Here is a rough summary from my recollection. Please refer to minutes on Web Perf WG mailing thread for more accurate summary.
|
Ryosuke's statement was about picture... I misquoted him here... but his comment also applies to whether we should specifiy and implement this. :-) |
I think the summary (from the minutes) was like:
|
Thanks for the summaries! A few questions/points: (quoted from #131 (comment))
Any idea what simpler modifications to preload anyone had in mind? Curious. Also as per @kinu's points, just to be clear, my take is that we're continuing with |
This is indeed accurate.
|
@yoavweiss Would it make sense to create a http-header version of the viewport meta tag? |
Potentially. As @domfarolino pointed out elsewhere, the need to hold the preloads until the viewport is known is not unlike how preload works today when the media attribute is defined. A header based viewport definition may make sense, but seems orthogonal. |
Thanks @gi11es for revisiting this. For the record, this was previously discussed at #31. Wikipedia's current preload approach involves an inelegant media query. The details of which are documented at #31 (comment). |
https://discourse.wicg.io/t/proposal-viewport-http-header/3233 |
HTML spec change merged! |
It seems useful if sites can specify
srcset
andsizes
attributes for preloading images, like what we have for img tag, so that responsive images can still appreciate the power of preloading.One immediate concern we could imagine is that link element already has the
sizes
attribute forrel=icon
cases. There will be at least two options to address this:sizes
attribute have different meanings depending on therel=
attribute.The text was updated successfully, but these errors were encountered: