[whatwg] So if media-queries aren't for determining the media to be used what are they for?

Odin Hørthe Omdal odinho at opera.com
Tue May 15 16:20:32 PDT 2012


Silvia Pfeiffer <silviapfeiffer1 at gmail.com> skreiv Wed, 16 May 2012  
00:57:48 +0200

>> Media queries come from the client side. They allow the author of a web
>> page to tell exactly how she want to lay out her design based on the
>> different queries. The browser *HAS* to follow these queries. And also,
>> I don't think (please correct me if wrong) the media query can be subset
>> to only the stuff that's really meaningful to do at prefetch-time.
>>
>> The srcset proposal, on the other hand, are purely HINTS to the browser
>> engine about the resources. They are only declarative hints that can be
>> leveraged in a secret sauce way (like Bruce said in another mail) to
>> always optimize image fetching and other features. If you make a new
>> kind of browser (like e.g. Opera mini) it can have its own heuristics
>> that make sense *for that single browser* without asking _anyone_.
>> Without relying on web authors doing the correct thing, or changing
>> anything or even announce to anyone what they are doing. It's opening up
>> for innovation, good algorithms and smart uses in the future.
>>
>> That's the basic difference, totally different.
>
> If that's the case, would it make sense to get rid of the @media
> attribute on <source> elements in <video> and replace it with @srcset?

Video is at least a bit different in that you don't expect it to be fully  
loaded and prefetch at such an early stage as img. But I've been thinking  
about that since I read something like "we already have media queries in  
source for video, but it's not really implemented and used yet".

I'm not sure. What do you think? As far as I've seen, you're highly  
knowledgeable about <video>. Why do we have mediaqueries on video element?  
Do we have a use case page? Doing the same as whatever <img> ends up doing  
might be a good fit if the use cases are similar enough. Would be nice to  
be consistent if that makes sense.

-- 
Odin Hørthe Omdal · odinho / Velmont · Opera Software


More information about the whatwg mailing list