Re:How a new HTML element will make the Web faster
by Siecje on Tuesday September 02, 2014 @10:59AM
(#8257928)
How does the browser know to grab the 1x version or the 2x version?
Re:How a new HTML element will make the Web faster
by kaoD on Tuesday September 02, 2014 @12:39PM
(#8258613)
I assumed 2x was for Retina-like screens. The browser already knows it and it's exposed via devicePixelRatio.
If I understood your question correctly.
Re:How a new HTML element will make the Web faster
by garethadams on Tuesday September 02, 2014 @12:36PM
(#8258598)
The browser knows about the device it's running on, and specifically its display density.
To authors it wasn't clear whether "w" declared width of the image, or min-width or max-width media query.
It's a media query, but doesn't look like one. Values look like CSS units, but aren't.
On top of that interaction between "w", "h" and "x" was arbitrary with many gotchas, and everybody assumed it works differently.
With <picture> we have full power of media queries using proper media query syntax.
srcset is still there in a simplified form with just 1x/2x, and that's great, because it is orthogonal to media queries ("art direction" case) and processed differently (UA must obey MQ to avoid breaking layouts, but can override srcset to save bandwidth).