W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Re: lazy loading for images via css

From: Sebastian Zartner <sebastianzartner@gmail.com>
Date: Sat, 29 Jun 2013 09:23:22 +0200
Message-ID: <CAERejNa=0rZ9zjeH4OFuo_-HZ2K4iV5RQr7-MRRmgBLT48ZAiA@mail.gmail.com>
To: Felipe Nascimento de Moura <felipenmoura@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, www-style <www-style@w3.org>, brice@websailors.fr
>
>  > Also, it would be really interesting to use as another background
>> > characteristic, as proposed by Sebastian Zartner.
>> > Like
>> > background-image: url(mygreatestphoto.jpg) postponed;
>> > or
>> > background-load-method: postponed;
>> >
>> > With that, we would even be able to say that:
>> >
>> > body.mobile div{
>> >      background-load-method: postponed;
>> > }
>> >
>> > this way, a server side application could write the body tag with or
>> without
>> > the "mobile" class, therefore, all the div elements with background
>> images
>> > would be postponed to load their background.
>>
>> Yeah, I'm potentially interested in pursuing something to indicate a
>> lazy-loaded image in CSS as well.  We can bake it into image(), which
>> is designed to have its set of annotations expanded over time.
>> "background-image: image(defer "foo.jpg");" or the like.
>>
>> ~TJ
>>
>
> interesting...that could also be an option!
> although I still think it would be easier, or simpler to use something like
>
>  body.mobile div{
>      background-load-method: postponed;
> }
>
> For situations like that, we are not specifying the image itself, just
> saying(in a more "cascade" mode) how backgrounds for those selectors should
> behave!
>
> Supporting background-image: image(postponed "foo.jpg"); would, indeed, be
> other great option to specify the same property.
>
> Therefore, I think it would be highly adopted by developers if browsers
> could support all
> background-load-method: postponed;
> background-image: url(mygreatestphoto.jpg) postponed;
> background-image: image(postponed "foo.png");
>

You want the lazy loading for the image, not for other backgrounds (like
gradients), so Tab's idea sounds more logical to me to bind it directly to
the image.

Sebastian
Received on Saturday, 29 June 2013 07:24:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC