we are implementing Picturefill (version 2.2.0) at the moment in our site. The picture element look like this:
<picture>
<source media="{query_size1}" srcset="/images/size1.jpg"></source>
<source media="{query_size2}" srcset="/images/size2.jpg"></source>
<source media="{query_size3}" srcset="/images/size3.jpg"></source>
<source media="{query_size4}" srcset="/images/size4.jpg"></source>
<source media="{query_size5}" srcset="/images/size5.jpg"></source>
</picture>
As you can see, we have 5 sources for a single picture with complex media-queries as we consider normal media queries and pixel-ratio. Such a query could look like the following:
(max-width: Xpx) and (-webkit-max-device-pixel-ratio: 1.0),
(max-width: Xpx) and (-o-max-device-pixel-ratio: 1/1),
(max-width: Xpx) and (max-resolution: 100dpi),
(max-width: Xpx) and (-webkit-max-device-pixel-ratio: 1.5),
(max-width: Xpx) and (-o-max-device-pixel-ratio: 15/10),
(max-width: Xpx) and (max-resolution: 150dpi),
(max-width: Xpx) and (-webkit-max-device-pixel-ratio: 2),
(max-width: Xpx) and (-o-max-device-pixel-ratio: 2/1),
(max-width: Xpx) and (max-resolution: 200dpi),
(max-width: Xpx) and (-webkit-max-device-pixel-ratio: 2.4),
(max-width: Xpx) and (-o-max-device-pixel-ratio: 24/10),
(max-width: Xpx) and (max-resolution: 240dpi)
Now I am wondering if this enormous queries, that have to be analysed by regular expression (correct me if I am wrong) in the browser, could slow down the browser, because if we have 10 pictures on a site, there would be 10 X 5 = 50 such complex RegEx calculations.
Would be great to hear what you think... ;)
Best regards...