The picture element can be verbose.
https://gist.github.com/2509534
Using compressive images can simplify the verbosity of the picture element markup, though this is an idea on how to make it even cleaner.
Note, non of this actually works in any browser, but is an idea of how it could work in the future
- simplifies authoring picture elements and maintaining them.
- based on idea of using compressive images, no need for seperate hi-resolution images
- Replaces content with URI templates
{filename} and {ext} based on URI Templates
- {filename} would use the file name of the src attribute of the selector, in this case it would be "photo"
- {ext} would use the file extension of the src attribute of the selector, in this case it would be "jpg"
The biggest issue
- would require the browser to parse the CSS file before loading the src attribute of the source tag in the picture element to prevent duplicate downloads.
- this might be worked around with a preparse attribute
There’s no reason the same solution couldn’t be used with a standard image tag if browsers supported it and we could get around the duplicate downloads. Of course, if we could get around the duplicate downloads by having the preparser handle things differently, a whole bunch of options open up to us.