Is algorithm for selecting based on media query defined?

What's the algorithm for selecting which image is picked based on media  
queries?

e.g. which one will be picked in this case:

<source media="all and (orientation:portrait)">
<source media="all">
<source media="all and (max-width:300px)">
<source>
<img>

when screen is 200px wide in portrait mode?

and which one when screen is 200px wide in landscape mode?


Same question for this case:

<source>
<source media="all">
<source media="all and (orientation:portrait)">
<source media="all and (max-width:300px)">


-- 
regards, Kornel Lesiński

Received on Thursday, 17 May 2012 14:18:59 UTC