W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2012

[whatwg] Deferring image load

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 13 Feb 2012 09:59:09 -0500
Message-ID: <4F39253D.4070006@mit.edu>
On 2/13/12 9:29 AM, Bjartur Thorlacius wrote:
> On Mon, 13 Feb 2012 14:17:28 -0000, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>> This is a difficult optimization to make. You can only do it for
>> images that have a height and width specified in the markup, and worse
>> yet it leads to pretty bad flicker as the user scrolls (because
>> network roundtrip times are measured in hundreds of milliseconds to
>> seconds). So doing this by default is not likely to happen. Having a
>> page opt into it is a different story, though.
>>
> Well, UAs would fetch the images to be displayed first first, and then
> prefetch images until they have more than a screenful of undisplayed
> content loaded.

What does "screenful of undisplayed content" mean for some slide-deck 
site that just moves images in and out of view via script?

> But yes, fast scrolling would break this. Not even
> knowing the rough size of images before fetching them makes them hard to
> lay out until they have been downloaded.

Not knowing the size makes it _impossible_ to do layout correctly. 
Again, UAs would only be able to skip getting images that have explicit 
height and width attributes.

And even then, things could be troublesome if the pseudo-clases for 
detecting loading state are added, since those could affect layout...

-Boris
Received on Monday, 13 February 2012 06:59:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:11 UTC