Reading List

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.

Standards

Industry

Misc

Responsive images – interim report

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).

We have the srcset attribute, with its wildly unintutive syntax, “ready for first implementation”, so supported nowhere yet. It’s disliked by oiks who actually make web sites and fails to satisfy the art direction use case that 27% of those oiks currently polyfill to address.

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.

Firstly, have <img> with a dummy source, then replace the src with JavaScript once you know the dimensions and resolution of your device. This makes images dependent on JavaScript.

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.

So that’s the interim report. Inaccessible and/ or single-engine, or JavaScript-dependant, or relying on server-side shenanigans which don’t address the important art-direction use-case.

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.

Fingers crossed.

Reading List

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).

Standards’n'shit

Misc

Reading list

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).

Web Standards

Industry

Misc

Poetry corner: Emily Dickinson

Emily Elizabeth Dickinson (December 10, 1830 – May 15, 1886) was a prolific American private poet; fewer than a dozen of her nearly eighteen hundred poems were published during her lifetime.

Most interestingly, however, is the fact that many of her poems can be sung to the haunting melody of “The Yellow Rose of Texas”.

I investigate further.

Eating well, cheaply

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.

The sum total of the ingredients was £9.67.

Running a gas cooker costs £7.24 a month to cook for a family of 4, so let’s divide that by 30 days and estimate that it cost 25p in fuel to cook this meal.

To go with the meal, we had a £3.59 bottle of Toro Loco Tempranillo 2011 (which won a silver medal at the International Wine and Spirit Competition).

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).

Reading List

If you fancy coming to Future Insights Live in Las Vegas 29 April – 2 May 2013, use the discount code “Bruce” to get 10% off the ticket price.

Web Standards

Blink

Industry

misc

A cake for Thatcher’s legacy

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.

cake commerorating Mrs Thatcher

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.

There was no economic miracle: British GDP has grown in line with Germany and France, neither of which had the twin blessings of North Sea oil or Thatcher.

Statistical analysis in 2012 shows Britain has some of the lowest social mobility in the developed world; only Portugal is more unequal with less social mobility:

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.

Farewell, hgroup

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.

So how do you now mark up taglines and subheaders? Simply: as you always have. The spec now discusses this in the Common idioms without dedicated elements section.

Three methods are suggested. The simplest is simply with punctuation:

<h1>The Lord of the Rings: The Two Towers</h1>

The second is by using a <span> inside a heading element that allows you to style the secondary part, for example with h1 span {display:block; font-style:italic;}:

<h1>The Mothers 
   <span>Fillmore East - June 1971</span> 
</h1>

The third (and the one I use, because a tagline doesn’t feel like a heading to me, but does belong with one in the <header>):

<header>
<h1>The Mothers</h1>
<p>Fillmore East - June 1971</p>
</header>

Expect HTML5 Editor Steve Faulkner to blog about this for HTML5 Doctor when the jet-setting roister-doister returns back to Blighty next week.

Reading List

Web Standards

Industry

Misc