Re: [css-images] Extending image-set() to be equal-power with current srcset/<picture>

On Sat, Oct 25, 2014 at 1:49 AM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> On Fri, Oct 24, 2014 at 4:47 PM, Greg Whitworth <gwhit@microsoft.com>
> wrote:
> >> The image-set() function was originally designed to emulate the
> functionality of the srcset attribute on <img>, back when it was first
> proposed by Apple.
> >> Today, though, the srcset syntax and functionality has been expanded,
> and the <picture> element offers further elaboration on the concept.
> >> It would be nice if CSS matched the functionality of HTML in this
> regard.
> >
> >> 1. Allow, instead of a <resolution> value, an <image-size> value, which
> is a dimension with a "w" or "h" unit, expressing how large the image is in
> image pixels.  (The HTML image selection algorithm does not yet use "h"
> data, but it will in the future, and it explicitly ignores "h" descriptors
> without dropping the whole candidate, so that in the future it can pay
> attention to them.)  It's resolved into an effective <resolution> based on
> running the Object Sizing Algorithm with no intrinsic dimensions, to find
> the rendered size of the image.
> >
> >> 2.  Allow a format() function, same as @font-face/src, in each
> candidate, taking a string argument specifying either a mime type or a
> short name for an image type (defined in a table in the spec). If the
> browser doesn't support or doesn't understand the given type, it ignores
> the candidate.
> >
> >> Thoughts?
> >
> > As long as we don't bring the redundant sizes (which I don't expect, but
> want to voice it now) into it then I'm all for it. I like the fact that you
> took into account format support as well. Overall it seems like a balanced
> approach. Let me know if you need any help spec'ing this ;)
>
> Yeah, no need for the equivalent of the sizes='' attribute; that
> exists for the preloader, and CSS is already past the preloader almost
> by definition.  We can just use the actual laid-out size (as
> specified, the result of doing Object Sizing Algorithm with no
> intrinsic dimensions), which sizes='' is an approximation of.




> On a separate thread [1], we were discussing adding opt-in preload hints
to CSS. I also claim that it's fairly possible we don't need them to be
opt-in [2].
If we want such preloading to be applicable to CSS images (opt-in or
otherwise), we would need "sizes" like functionality in CSS as well.

[1] http://lists.w3.org/Archives/Public/www-style/2014Oct/0525.html
[2] http://lists.w3.org/Archives/Public/www-style/2014Nov/0170.html

Received on Wednesday, 12 November 2014 07:42:36 UTC