Re: [ResourcePriorities] Only specify lazyload on img

On Wed, 26 Jun 2013 00:50:50 +0200, Jonas Sicking <jonas@sicking.cc> wrote:

> These also have the additional complication that <audio> is commonly
> never visible in the sense that an image is, so the question is when
> to start loading it.

Right. It's visible if it has a controls attribute though.

> But both <audio> and <video> is however always
> visible in the sense that if they play audio that's something the user
> notices whatever the scroll position is.

Yes. They don't even have to be in the document to play audio.

> But in general lazyload for audio and video sounds like it could be very  
> useful.

I'll note that the spec is very liberal on what it allows in terms of  
fetching of media resources. It allows acting like preload="none" on all  
media elements, or fully downloading all media elements, and anything in  
between. So browsers can load media lazily without the lazyload attribute.  
And authors have several hints to choose from to specify intent already  
(omit preload, preload=none, preload=metadata and preload=auto).

> One solution might be to automatically start loading if autoplay is
> set, or if play() is called.

That's already the case.

> If all lazyload does for script is to make it not the script not block
> the "load" event, then it doesn't seem like 'lazyload' is the right
> attribute. I.e. it seems like a bad for 'lazyload' to mean different
> things on different elements.

Agreed.

>> Maybe not that specifically, but there are a bunch of things in SVG that
>> could use it. I think they have their own <script> tag for instance.
>
> Indeed, but we should look at those separately. Many of the above
> caveats apply to the various svg features too.

Yes.

-- 
Simon Pieters
Opera Software

Received on Tuesday, 25 June 2013 23:33:14 UTC