This week’s reading list comes to you with a renewed vigour, and a zesty swagger in its stride, as several people sought me out at Google I/O to tell me how useful it is. Thanks for the feedback.
This is simply a list of stuff I’ve read this week, and posted links to over Twitter. However, I know that lots of real people don’t read Twitter all day, or it’s blocked at work, so this is an amalgamated list. Note that these links interested me, but I neither endorse them nor vouch for their accuracy.
At Google I/O last week, I was hoping to hear Google’s thoughts on responsive images. Every developer I speak to wonders how to send the right image size to browsers, Google is obsessed with performance, Peter Beverloo and Paul Kinlan were explicit in their talk Mobile HTML: The Future of Your Sites that web sites should request the correctly-sized images. But how?
The <picture> element seems to be at an impasse; no-one from Google showed any enthusiasm (nor does any other browser vendor, seemingly). That’s OK; when I dreamed it up 18 months ago it was a strawman to get the conversation going in standards groups (I’d previously been told that there was no need for any standard, as everyone would have huge devices on reliable, fast wifi in the future).
Google has proposed a Client Hints header with device resolution, viewport size, touch-enabled flag etc. The idea is that the server generates lots of different sizes of foo.png, and when a request comes for foo.png, the server looks at the Client Hints and sends the most appropriate size. Opera (and soon, Chrome) announces that it accepts webP images, so the server could intercept requests for foo.png and send foo.webp in its place for conforming browsers, thereby reducing bandwidth.
This server-side negotiation will be great for legacy pages as it means source code doesn’t need to be touched. I’ve heard it also touted as being much simpler to author, but I wonder about that; HTML isn’t hard to write, while implementing server-side image resizing and transcoding, intercepting headers, doing the negotiation and setting cache control is much harder for an HTML wrangler than writing HTML is. It also assumes everyone has full access to the server. Don’t forget that some uses of HTML (for example, ebooks) have no server.
But those are all for the future. What can you do now? Clever, but ultimately unsatisfying workarounds.
Alternatively, make your images into single-frame <video>s, and take advantage of media queries on the child <source> element to send differently sized images. Ian Devlin dreamed this up, and it’s evil genius – except that file sizes increase and <video> doesn’t have an alt attribute, so the “images” are therefore inaccessible.
A similarly inaccessible technique for webkit browsers is simply to use a <div> element instead of <img> and set an image-set background-image in CSS. Don’t do this; it’s inaccessible, and is single-engine.
The current best way is brilliant albeit somewhat hacky: Estelle Weyl‘s clown car technique. This uses a data-encoded SVG file, embedded using an <object> element. Unfortunately, there’s nowhere to hang alt text, and right-clicking to “save as” doesn’t behave as expected.
Images are central to the web; we need a declarative HTML method to achieve them in our multi-device world.
I’ve done my part in suggesting a strawman, and although cleverer minds than mine tell me it’s a bad solution, in a year and a half no-one has told me what a good one looks like.
Here’s your reading list for the next 2 weeks – I’m off to Google i/o where I’ll be speaking at the “Web Platform Fireside Chat” 3pm (to 3.40pm) on the Friday, Room 5. Come and say hi if you’re going to San Francisco (be sure to wear some flowers in your hair).
Some very meaty stuff this week, so it’ll last you 2 weeks (next week I’m in Las Vegas for Future Insights Live conference – use the discount code “Bruce” to get 10% off the ticket price).
HTML5 VIDEO bytes on iOS Mobile devices by Steve Souders: “Mobile devices ignore all values of PRELOAD in order to avoid high data plan costs, and instead only download the video when the user initiates playback … However, my testing shows that iOS downloads up to 298K of video data, resulting in unexpected costs to users.”
ptb/flexgrid: a flexbox-based CSS grid in 3.6k – “The flexbox layout is supported on Chrome, all versions of iOS, Safari 3+, IE 10+, Opera 12.10+, and Firefox 22+. Other browsers get the fluid Bootstrap 3 layout, except Internet Explorer 6 and 7 which use a fixed layout.”
When the horsemeat scandal was all over the papers showing that lots of readymade and fast food is really nasty, I said to some friends that I was glad that my family always buys real meat, and fresh vegetables and prepare them ourselves (we don’t do it to save money, we just hate junk food). Some of my friends told me that’s because I’m comparatively well-off and that many poorer people can’t afford to do that.
I decided to cost up a favourite meal of ours: free-range roast chicken with all the trimmings: roast potatos, roast pumpkin, carrots, parsnips and frozen peas (life’s too short to shell peas). We also had Yorkshire pudding, even though this shocks traditionalists who clam they exclusively accompany beef.
This easily serves five (including two ravenous teenagers) so that generally we don’t need an evening meal if we eat this at lunchtime.
This makes the ingredients, fuel and wine cost £13.51, or £2.70 a head. I can’t find the pre-recall price of Findus “beef” lasagne ready meals, but a search on Tesco website for “ready meal” suggests that the cheapest are about £1 for about 300g of food, which wouldn’t satisfy me let alone growing kids. My meal was at least double that size – each person had 200g of roast spuds as well as all the other stuff – and included a large glass of wine each for the three adults (and a good glug into the gravy).
Therefore, I’m going to stick my neck out and say that it certainly isn’t more expensive to eat properly, and is much better for you (although it took me about an hour of prep time rather than 5 minutes to microwave).
jQuery 2.0 Released – “leaves behind the older Internet Explorer 6, 7, and 8 browsers”. I wonder if this, and Windows XP in its last year of Microsoft support, will give devs/ biz “permission” to stop supporting older browsers?
I Stand With Trolls – “I’m calling out our culture of blaming the employer for the mouthiness of their employees in a personal capacity … We’ll end up with a Twitter full of teen-agers talking about their bowel movements and a million carefully curated corporate accounts.
My daughter’s Easter holiday homework was to design and make a commemoration cake. Like most of her class, she had planned to make an Easter cake, until the day when Margaret Thatcher died.
She researched her life and found a graph of unemployment figures during the Thatcher premiership which resembled the letter “M”. Add a swift “T” for the initials of The Great Helmswoman, the dates of her life in icing over a home-made Victorian values sponge and we have an edible commemoration of a true “Let them eat cake” politician.
My daughter felt it important that the cake be entirely factual. There were other graphs and statistics we considered, many of which contradict the hagiographies that are being circulated by the right wing at the moment.
For example, her Right To Buy scheme turned the UK into a nation of homeowners, we’re told. Actually, a third of ex-council homes are now owned by rich landlords rather than their occupants. Because councils were forbidden from building new housing with the cash they received from selling their old houses, we now have a huge housing problem, with many young people unable to leave home at all.
It’s a similar story with the utility privatisations which were to make us a nation of shareholders and participatory capitalists. “Small British shareholders have no influence over the overwhelmingly non-British owners of the firms that generate and distribute power in Britain.” writes the London Review of Books:
when local electrical engineers dig up the roads in London, they’re working for East Asia’s richest man, the Hong Kong-based Li Ka-shing … In north-east England, they work for Warren Buffett; in Birmingham, Cardiff and Plymouth, the Pennsylvania Power and Light Company; in Edinburgh, Glasgow and Liverpool, Iberdrola; in Manchester, a consortium of the Commonwealth Bank of Australia and a J.P. Morgan investment fund.
Like the American neo-cons she was so friendly with, her fiscal policies were laissez-faire but she believed in government small enough to fit into the bedroom. She was deeply socially conservative and enacted the shameful Section 28 legislating that a local authority “shall not intentionally promote homosexuality or publish material with the intention of promoting homosexuality” or “promote the teaching in any maintained school of the acceptability of homosexuality as a pretended family relationship”.
You might believe the way she treated striking miners was justified, but her contempt for the working class is demonstrated by the Hillsborough cover-up.
Social mobility hasn’t changed since the 1970s – and in some ways has got worse. For every one person born in the 1970s in the poorest fifth of society and going to university, there would be four undergrads from the top fifth of society. But if you were born in the 1980s, there would be five.
Yes, yes, Thatcher stopped the unions “bringing the country to its knees”. Then she delivered it to the bankers’ exemplary stewardship. Her Big Bang city deregulation paved the way for casino banks with decreased reserves, so the financial crash could happen.
If only her legacy were as easily swallowed and as quick to demolish as my daughter’s delicious cake.
The <hgroup> elements is removed from HTML 5.1. It was defined as “typically used to group a set of one or more h1-h6 elements — to group, for example, a section title and an accompanying subtitle.”
I shan’t be sad to see it go; in November 2010, I argued that it was too hard to grasp; if you want to indicate that something is a subtitle or tagline, you want to indicate that on the tagline itself, rather than on an element that groups a tagline and non-taglines.
More recently, Alex Russell and I had a conversation in which he argued that elements without a UI are likely to fail (more of that from him, later). I think he’s right in this case; <hgroup> is used solely to preserve the outlining algorithm which itself is esoteric.