Re: Load event and <video>

On Thu, Mar 19, 2009 at 8:10 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Robert O'Callahan wrote:
>>
>> Gecko doesn't download images at all for display:none but does (and delays
>> the load event) for visibility:hidden and zero-size images.
>
> Actually, we've downloaded for display:none since at least Gecko 1.8
> (Firefox 1.5).

We download the image as soon as the DOM element is created. On the
desktop this is required for expected behavior. Many sites do stuff
like:

<script>
imgA = new Image();
imgA.src = "a.jpg";
imgB = new Image();
imgB.src = "b.jpg";
imgC = new Image();
imgC.src = "c.jpg";
imgD = new Image();
imgD.src = "d.jpg";
</script>
<img src="a.jpg" onmouseover="this.src='b.jpg'" onmouseout="this.src='a.jpg'">
<img src="d.jpg" onmouseover="this.src='d.jpg'" onmouseout="this.src='c.jpg'">

In fact, even tools like dreamweaver outputs code like this.

I could see the argument for 'cheating' on mobile, but it most likely
needs to be a SHOULD lever requirement that resources are pulled down
and cached, and that the load event is blocked until that has
happened.

/ Jonas

Received on Friday, 20 March 2009 19:08:10 UTC