Apologies for the irregularity of the Reading List at the moment; September and October are autumn conference season and my schedule is bonkers.
A meeting at Mozilla Paris on how to solve Responsive Images, organised and summarised by Marcos Caceres concluded
- Browser vendors agree that srcset + DPR-switching is the right initial step forward (i.e., the 2x, 3x, etc. syntax).
- Agreement to then consider srcset + viewport size after some implementation experience (possibly drop height syntax from srcset spec). If not implemented, Width/Height syntax to possibly be marked at risk in srcset spec.
- Browser makers acknowledge the art-direction use case, but still think <picture> is not the right solution.
- Adding new HTTP headers to the platform, as Client-Hints proposes to do, has had negative impact in the past – so Client Hints might need to be reworked at bit before it becomes more acceptable to browser verndors.
So initially, we’ll use something like
Browsers that have “retina” displays will choose retina.png as they have 2 CSS pixels to one physical pixel. Browsers that aren’t retina, or don’t understand the new syntax, fall back to the good old
WebKit and Blink have implemented (but not yet shipped)
srcset, Mozilla is planning implemention now.
Meanwhile, an alternative “srcN” proposal has been put forward by Tab Atkins and John Mellor (excitingly, “John Mellor” was the real name of The Clash’s Joe Strummer). It claims to solve Resolution-based discrimination, Art-direction discrimination and Viewport-based discrimination usecases. Discussion here.
UK Government Web
The Cabinet Office’s Open Standards Board is recommending open standards technology. The first two to be approved are HTTP/1.1 and Unicode UTF-8. Francis Maude, the Minister, allegedly said “open standards will give us interoperable software, information and data in government and will reduce costs by encouraging competition, avoiding lock-in to suppliers or products and providing more efficient services”.
This may not be revelatory to those of us in the web world, but it’s a Good Thing for the nation.
I had the pleasure of hearing Paul Arnett (now of Twitter, previously of gov.uk) talking about the gov.uk initiative at From The Front conference a few days ago, and thought it was a sign of schizophrenia that the same government that can allow subject experts make a world-leading governmental portal is the same government that disregards experts and its own consultation in wanting to censor the web.
I realise now that it’s the old Tory DNA: the belief in encouraging competition by economic liberalism, reducing bureaucracy, while remaining socially authoritarian and reeling from one moral panic to the other. So no change there.
WebKit has (partially) implemented a new attribute to our ancient chum <img> called
srcset that allows authors to send a high-res image only to browsers that have high-resolution displays. It looks like this:
<img alt=… src="normal-image.jpg" srcset="better-image.jpg 2x">
That “2x” thing after the file name means that if a browser has 2 or more physical pixels per CSS pixel (eg, high resolution), it is sent better-image.jpg. If it’s not high-res, or if it’s a browser that doesn’t support
You can extend it further if you want to:
<img alt=… src=… srcset="better-image.jpg 2x, super-image.jpg 3x">
This implementation doesn’t have the horrible “pretend Media Queries” syntax that sources close to Tim Berners-Lee* called “like, a total barfmare, man”, but this is potentially a great leap forward; it saves bandwidth for the servers, stops people downloading gigantic images that they don’t need, is easy to understand and has graceful fallback.
Let’s hope it turns up in Blink, Trident and Gecko soon.
* “sources close to” is UK newspaper code for “we just made it up”.
Graceful degradation of SVG images in unsupporting browsers
Very very clever: SVG and <image> tag tricks. (Yes, <image> which the HTML5 parser aliases to <img>.)
Microdata / RDFa / “semweb” shizzle/ SEO
In The Downward Spiral of Microdata, nice Mr Manu Sporny predicts the death of “HTML5″ Microdata and the triumph of RDFa Lite now that both WebKit and Blink have dropped support for the Microdata API (which allowed JS access to Microdata).
Co-incidentally, Mr Sporny is an inventor of RDFa Lite. Personally, I don’t care which triumphs – now only Opera Presto supports the Microdata API, there is no technical reason to prefer one to the other (in fact, as Facebook supports RDFa and not microdata, so you could argue it has greater utility).
If you’re in the UK and are interested in the Web, the Speak The Web conference will be in Nottingham, Liverpool, Leeds, Sheffield and Manchester this month, for a very small sum of money. What’s really surprising, of course, is that there is anyone outside Brighton who does any Web work.
Standards ‘n’ shizz