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

On Fri, Oct 24, 2014 at 4:47 PM, Greg Whitworth <> 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.


Received on Friday, 24 October 2014 23:50:24 UTC