Re: Is algorithm for selecting based on media query defined?

I may be misunderstanding your point, but I think the fallback img is there to support browsers that do not natively support/understand picture. 

It's like <canvas> fallback content, ignored if the picture element itself is supported.

There should be a natural fallback for the element without having to resort to a JavaScript polyfill. While I agree that <source media=all> is equivalent to the fallback in a picture-supporting browser, it means nothing to an existing browser today. 




On May 17, 2012, at 10:09 PM, Kornel Lesiński wrote:

> On Thu, 17 May 2012 17:11:18 +0100, Scott Jehl <scott@scottjehl.com> wrote:
> 
>> Well, there are more points of departure here from video than just that. For example, video and audio sources are not reassessed on resize/orientationchange, or at least, as far as I know (I can check).
>> 
>> If the first source is kept, that'd mean ordering images largest to smallest. That seems unnatural/unexpected to me, but I'm not sure if others agree. Maybe it's my mobile-first mentality seeping in :)
> 
> Even if <video><source media> was dropped, selection based on <source type> is 'first to match' as well.
> Moreover I'd like to suggest evaluating fallback <img> as <source media="all"> (to reduce verbosity), and that makes sense when <img> is last (fallback, not fallfront ;)
> 
> 
> The CSS cascade has much more going on, i.e. there's concept of specificity in there as well. I'm wondering whether authors won't think of MQs as selectors and expect specificity to apply as well, which could lead to mistakes:
> 
> <source media="all">
> <source media="screen (min-width:300px)">
> <source media="all">
> 
> No matter what the order of matching, the min-width one won't ever match, but one could assume that it should if it was analogous to:
> 
> * {}
> #min-width {}
> * {}
> 
> 
> -- 
> regards, Kornel Lesiński

Received on Saturday, 19 May 2012 05:41:25 UTC