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 14:12:09 -0500
Message-ID: <4F396089.9020101@mit.edu>
On 2/13/12 1:52 PM, Bjartur Thorlacius wrote:
>> 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.
>>
> On the contrary, if you've laid out two screenfuls you can guess that
> anything after that will not be in the aforeoutlaid* screenfuls.

I wasn't talking about guessing at visibility.  I was talking stuff like 
this:

   <!doctype html>
   <div style="height: 100vh"></div>
   <img src="something">
   <div style="position: relative; top: -50vh"></div>

Where should that second div be placed?  Should the user be able to see 
it?  You don't know until you know the image size.

And it gets even worse when tables are involved, because an image 
arbitrarily far down the table can affect the table column widths and 
the width of the whole table and the site probably depends on particular 
widths.

Similar for various other layouts that involve shrink-wrapping (floats 
and abs pos containers are the chief reasons for that).

>> And even then, things could be troublesome if the pseudo-clases for
>> detecting loading state are added, since those could affect layout...
>>
> As I say, there are numerous compatibility problems.

Indeed.

> If image dimensions late in the document affect the layout of a previous part of the
> document, as you seem to hint at, then hell is loose if we don't know
> them. Guessing would be most unfortunate and surprising to layout
> designers.

Yep.  :(

-Boris
Received on Monday, 13 February 2012 11:12:09 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:39 UTC