W3C home > Mailing lists > Public > www-style@w3.org > November 2014

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

From: Yoav Weiss <yoav@yoav.ws>
Date: Wed, 12 Nov 2014 08:42:08 +0100
Message-ID: <CACj=BEjmYZXJMjDrL+Fk8w7eL1iSg8vnLwEyk=o3Xu_2FB=8mQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Greg Whitworth <gwhit@microsoft.com>, www-style list <www-style@w3.org>, Ilya Grigorik <igrigorik@gmail.com>
On Sat, Oct 25, 2014 at 1:49 AM, Tab Atkins Jr. <jackalmage@gmail.com>

> 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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:48 UTC