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

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Tue May 15 15:57:48 PDT 2012


On Wed, May 16, 2012 at 8:37 AM, Odin Hørthe Omdal <odinho at opera.com> wrote:
> Andy Davies <dajdavies at gmail.com> wrote:
>>
>> Looking at the srcset proposal it appears to be recreating aspects of
>> media-queries in a terse less obvious form...
>>
>> We've already got media queries so surelt we should be using them to
>> determine which image should be used and if media-queries don't have
>> features we need then we should be extending them...
>
>
> Ah! What a truly great question, so simple.
>
> The answer is: no, it is not media-queries although they look like it. A
> big problem is that it's so easy to explain it by saying "it's just like
> media-query max-width", rather than finding the words to illustrate that
> they are totally different.
>
> The *limited effect* also feels similar which doesn't help the case at
> all.
>
> So, even though I have a rather bad track record of explaining any
> thing, I'll try again:
>
> 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?

Silvia.


More information about the whatwg mailing list