This week’s reading list is devoted to Device Detection vs Responsive Web Design.
With all the cool kids getting into RWD these days, it’s time to have a look at the Device Detection companies again. Device Detection is the practice of matching a device’s UA string against a table of such strings and looking up certain characteristics of that device and then serving different websites accordingly.
Of course, the utility of such services is dependant on the quality of the look-up table: how many devices does it know about (all the ones in the world, ever?), how frequently it’s updated (have they added the Umbongo J2O TrouserPhone S+ that was released on Tuesday, yet?) and how accurate is that data (does the TrouserPhone S+ really have 178680979 X 7 pixel smellovision display?).They are, however, an order of magnitude more reliable than terrible CMS plugins or JavaScripts that were written years ago and which register IE11 as IE1, or don’t know Chrome exists. UA strings are comically unreliable, being the frontline in an unceasing battle between browser-sniffers who want to deny entry to certain browsers, and browser vendors who want their users to get a first-class experience.
Examples of Device Detection companies include scientamobile (WURFL), DeviceAtlas and 51Degrees. The databases owned by such companies do include device characteristics unavailable through client-side detection. For example, you can’t find out from JavaScript whether a device is actually a touchscreen device; the physical dimensions of a screen or the retail price of a device (which advertisers want to know, apparently – you only want to advertise yachts to gold iPhone or Umbongo J2O TrouserPhone S+ owners).
Those who oppose Device Detection do so for philosophical reasons – it’s one web and we shouldn’t serve different content to different devices or browsers, or they are certain browser vendors: Internet Explorer, Firefox OS and Opera all have reasons to dislike browser sniffing or device detection (“this website is only available to iPad users”). Google uses device detection all the time on its properties, as do many other large companies.
The device detection companies have begun to issue reports comparing their products with responsive, client-side techniques. Here are three that I’ve seen this week:
They’re worth reading. Of course, case studies only go so far; every business, territory and site is different. One thing everyone agrees on is that performance matters – slow sites lead to fewer conversions. mobiForge has an article M-commerce insights: Give users what they want, and make it fast that claims
RWD sites were the slowest, on average, to load on mobile 8.4 seconds while dedicated mobile sites loaded fastest in 2.9 seconds. Non-responsive desktop sites took 6.57 seconds to load.
I’d like to see proper A/B testing: a well-made responsive version of a site versus its “m-dot” equivalent, redirected from its canonical URL and assembled after a device look-up, across a variety of devices and network conditions. If we’re going to argue, it might as well be about data.
Update 1 Dec 2014: Here’s some initial research on the top 1,000 mobile websites: M dot or RWD. Which is faster? that concludes that “m dot” sites are 50% slower for time to first byte, and
RWD sites are VERY competitive on Visually Complete and SpeedIndex scores. The median values are within 5% for both metrics. Even though it appears that RWD is faster, there is enough fluctuation in the data that we should probably call it a dead heat.
Web Sensor API: Raw and Uncut – Boris Smus writes “Sensors found in smartphones define the mobile experience … I’ve had to step away from the web as a development platform, in part because of the poor state of sensor APIs. In this post, I will describe some of the problems, take a look at sensor APIs on iOS and Android, and suggest a solution in the spirit of the extensible web manifesto.”
HTML5’s “Dirty Little Secret”: It’s Already Everywhere, Even In Mobile – “The dirty little secret of native [app] development is that huge swaths of the UIs we interact with every day are powered by Web technologies under the hood” says Tom Dale, who got a new camera for his birthday and is pretty damn pleased with it.
Google makes image recognition advance – “Scientists at Google have created artificial intelligence software that can describe the contents of photographs far more accurately than ever before.” Doesn’t mean you can get out of writing alt text, though!
After posting my old song Speed Of Light which contains the delicate phrase “fucking in the summer rain”, I remembered this poem that I wrote about the same incident, with slightly more genteel vocabulary.
It’s part of the same series of poems as It is a hot evening in July that I wrote to try to capture a precise moment in time or emotion.
Moments 3 (10.7.87)
The lethargy of evening
insects in the long grass
the langour and the language
I will not find a meaning
I will not bind my feeling
soft rain silvers cobwebs
on the stone for Stan and Ellen
that we lie upon all grassy
when the world gives up its whirling
for an instant small as insects
in the calmness after climax
in the stillness of the twilight
we are here
The Responsive Images Community Group: What Comes Next – by Matttt Marquis. TL;DR: Element Queries – “a method of handling layouts within specific elements based on the dimensions of the elements themselves rather than the viewport size alone”.
The App Bubble Burst: The Coming App Economy Correction – “The bubble bursting does not mean an end of the sector, but instead a realignment similar to that caused by the dot com bubble burst. The shake out will leave a more sustainable market.” by MIDiA consulting
Internet Architecture Board Statement on Internet Confidentiality – “The IAB urges protocol designers to design for confidential operation by default. We strongly encourage developers to include encryption in their implementations, and to make them encrypted by default. We similarly encourage network and service operators to deploy encryption where it isnot yet deployed, and we urge firewall policy administrators to permit encrypted traffic.”
Web standards for the future cute non-techy 2 minute video from W3C about why standards are important. I like it to show my kids and NGMs what I do, which is basically helping to build Skynet through the medium of mailing lists.
Talking of which, Thanks to Microsoft, Opera just got 100M potential new mobile browser users – Microsoft feature phone users are being transitioned from Nokia Xpress browser to Opera Mini. The top three countries for the Xpress Browser are India, Indonesia and Brazil. (Note: 100m potential new users; not everyone will “transition”, of course.)
HTML5 Accessibility – “information about which new HTML5 user interface features are accessibility supported in browsers”. TL;DR: “Firefox and Chrome are beating the pants off IE!”
Tenon “is a one of a kind accessibility testing tool… which can be seamlessly integrated into your existing toolset…This ability to test early and often allows you to catch and fix accessibility issues before they happen, not after, and allows you to release accessible code from the beginning.” < in free public beta. Disclosure: made by Karl Groves, a friend of mine
Confused corner:Why you should worry about HTML5 mobile apps – “New research demonstrates that, unlike native apps, those written in HTML5 are susceptible to code injection attacks” because of “middleware” like WebView or PhoneGap “that is susceptible to malicious code injection”. Unlike those totally secure native apps.
Internet Xmas Party by Luke and Charlotte – for London-based freelancers, homeworkers & other just-pants-all-day folk
Understanding MillennialsHow do Potatoes Fit into Their Lives? – thrilling press release from The United States Potato Board. Take a moment to read it; people spent some of their short time on this planet to write this. Bonus points for the stock photographs, too. I know these people; they’re Norwegian.
When I was clearing my dad’s house I found the VHS tape on which there was the only video of my band doing a gig. I don’t know who took the video, but here are five songs recorded in a tent at a festival in the West Midlands in 1991. The band are me (rhythm guitar, vocals), Tony Sherrard (bass), Andrew Cope (drums) and Nick Sherrard (lead guitar). We were called “The Lucies”. Here we are as a three-piece before Nick joined, with some hanger-on called John Peel.
Silka walks in those evenings When you feel like you’re still a virgin.
You don’t trust your feelings, Silka’s certain she’s hurting.
She is dressed in lace when she says, “Yes, yes, I will; of course I will, yes –
But if you feel the need to believe her,
remember Silka’s in fancy dress.
Silka in black satin, like the Mona Lisa if she were in mourning.
You try to please her, then with no warning
There’s a pause for the sinful applause and your unsatisfying taste of success
and the knowledge of the flaws that you hate, then through the door
comes Silka in fancy dress.
Bejewelled in a shattered promise, she’s wearing fading fraying denim.
You’re pierced by inverted commas
that have appeared round the tales she’s been telling you for so long.
She’ll decree: “Everybody loves me, but it’s too late for you’ve already guessed
Underneath there’s nothing that’s real to see; Silka’s only fancy dress.
Really, she’s merely fancy dress.
She’s very nearly Silka, wearing fancy dress.
Keep your mind and your eyes closed;
Silka’s wearing borrowed clothes
and all her cheap and gaudy trinkets.
Silka said she’s gonna crash; listen. Sing it.
This last one is a ballad called “Sweet Sadie Sings”. It’s one of my favourite songs I wrote for The Lucies because (1) it has a nifty G add9 chord, (2) it has a shouldn’t-work-but-does F#m to F change and (3) because I remember who the real “Sadie” is. But what’s in a name if the name’s been changed?
Sadie sings sweetly
about all of the things she’s done
and says, “They can’t be classified neatly
into those I’ve lost and those I’ve won.
For experience gained
My innocence has been shamed.
until only empty words remain.
Sweet Sadie sings.
Sadie sings softly
of the last twenty-seven times she’s been in love
and says “If you would only get off me
I could transcend this wrecked room and rise above
My stupid hopes and my facile fears
My futile dreams and my fatuous fears.
I never claimed that I was proud of these last three years.
Sweet Sadie sings.
Sadie is grieving
for the dreams she’s nurtured and then denied.
She said, “One November evening
I took them out and I laid them bare and there they died.
I know that I am far too small
to contemplate ever achieving them all,
so on the way some of them fall.
Sweet Sadie sings.
Sadie sings sadly
conscious of her words’ ambiguities.
She says “Who’s to say I’ve done so badly
when all I’ve ever really done is try to please?
For experience gained
My sense of wonder has waned.
What’s in a name when the name’s been changed?
Sweet Sadie sings
Named WebSockets – Dynamic binding, peer management and local network discovery for WebSockets. Spec and proof-of-concept implementation by Rich Tibbett
Responsive Images in Practice – masterful article by @etportis showing the kind of data savings using responsive images gives your visitors. And data savings = speed = conversions.
Blink: Srcset resource selection use a geometric mean to determine resource. Previously, Blink chose the srcset image that was bigger than the allowed space; now it chooses the one closest to that number of pixels and – if it’s smaller – upscales it slightly, reducing download size.
A while ago, there was discussion in CSS Working Group about an alt property to be added to CSS. Its purpose is to let assistive technology know the meaning of unicode characters inserted into a visual rendering of a document with CSS generated content. The problem is described by James Craig, Apple’s nice accessibility chappie.
It’s been shipping as -webkit-alt for a year now, and has just been added to the draft CSS Pseudo-Elements Module Level 4 spec. Let’s say you’re using a star glyph to show something is “new”, by generating CSS content using a class of .new as your selector:
The alt gives information to assistive technology.
The alt string can be blank. Assume you’re generating “►” to show that a widget is expandable. Because you’re a lovely human being and a responsible developer, you’re using aria-expanded="false" in the HTML. Therefore, you’d use empty alt in the CSS that generates the glyph to prevent assistive technology “helpfully” reading out “Black right-pointing pointer” after the AT has relayed the ARIA information to the user:
.expandable::before {
content: "\25BA"; /* a.k.a. ► */
alt: "";
/* aria-expanded="false" already in DOM,
so this pseudo-element is decorative */
}
Update 17:05 GMT fantasai of the CSS WG has mailed the CSS Working Group protesting against the syntax above. I don’t have any horse in the syntax race; my aim with this post is to show that we need some mechanism to give alternate content to assistive technology given that we allow non-textual content to be generated via CSS.
When I tweeted about this earlier, a few people objected to the concept because it adds content to CSS. But that ship has long sailed, with the content property that people have been using for ages. If you say “adding non-decorative content to a page is a misuse of CSS that merits the author 100,000 years in purgatory with Tim Berners-Mephistopholee pouring hot Ovaltine over their dingle-dangles whenever they try to sleep”, I will vehemently nod my agreement.
But sometimes, for organisational reasons, or because you inherited code, or you’re refactoring code from before you saw the light, you’re working with CSS that generates icons. This new property at least allows an author to make that content more accessible.
Years ago, I joined a web team a week after their brand new website had been delivered, months late and squillions over budget, by Big London Agency PLC. The site was a vile splodge of nested layout table cells and spacer GIFs with “click here” links pointing to PDFs. Of course, I could have instantly resigned my job and let the bank repossess my house.
Instead, I gently pointed out to any who would listen the inadequacies of the site and made plans about how it could be refactored. But while biding my time, I was also making small tweaks here and there to make it better and incrementally more accessible; removing duplicate link text from title attributes, changing “click here”s, putting blank alt text on spacer GIFs in the small parts of the template I controlled.
This was before the days of ARIA but I would have jumped at the chance of adding role="button" to the horrible mess of nested <div>s that the CMS spat out. Yes, it’s much better to spend a fortune getting the external CMS provider in to change the templates, the retest every single form on every single browser – but that simply wasn’t possible.
Two years later, when the senior manager who commissioned the terrible site left and we could jettison it, we did. And then we did it right. But for those who needed the content and were unable to wait nearly three years (that is, everyone), I’m glad I applied sticking plasters and polished turds.
It’s often said that if a job’s worth doing, it’s worth doing well. But it’s also wise to remember: sometimes, if a job’s worth doing, it’s worth doing badly than not at all. If you must have meaningful content generated by CSS, at least now you can make it accessible.
It announced “Warning Be careful in VO/Chrome combo. All other browsers I tried on Mac ignored the whole line, so no pseudo content added. Andy Ronksley wrote
The alt text is added to the content property now (after the forward slash). Last time I used this a few years back, Safari only supported the older syntax. Sounds like Ian has confirmed it still doesn’t support the new syntax.
I found this lurking as sol.wav on a hard drive while doing a computer backup on Friday.
One weekend in summer ’91 or ’92, a group of us were at my flat tripping on LSD from Friday night until Sunday lunchtime. (Mum, kids: it was an accident; a naughty Dutch man in the park told us they were cough sweets.)
At some point during the fun, I got a tune in my head and decided to write a song about tripping, while tripping. I tried subsequently to record it with real drums in a studio, but it didn’t work, so it languished as a cassette of me woozily singing it with acoustic guitar until 2004 when my friend Shez showed me how to use some sequencing software on his computer and helped me program this.
I note in passing that none of us coughed during that weekend. And, if you think about it, the whole world really *is* circles and lines.
Boys and girls come out to play,
The moon doth shine as bright as day
And it would be so good
If you only say you would
I’m travelling at the speed of light
Everything’s all right
In the cold white wintertime
The whole world is just circles and lines
And your eyes burn
When we feel the seasons turn
I’m travelling at the speed of light
Everything’s all right
Dewy dawn in early May Emily comes out to play
she is gathering flowers
by the ruined prison towers
I’m travelling at the speed of light
Everything’s all right
midnight when the moon is full
we can’t resist that mad lunar pull
we wax and wane
fucking in the summer rain
I’m travelling at the speed of light
Everything’s all right
In the Autumn if you just call
You can make the cold stars fall
into the warm wet sea
Like dead leaves beneath bare trees
I’m travelling at the speed of light
Everything’s all right
Boys and girls come out to play
The moon doth shine as bright as day
And it would be so good
If you only say you would
I’m travelling at the speed of light
Everything’s all right
Quite a few people have difficulty understanding the CSS Flexible Box Model, especially the flex-shrink property. Even brainboxes like Remington Sharp find it tricky:
As a quick tip, I find a helpful way of coming to grips with it is by likening Flexbox to String Theory. Thus, flex-basis is analogous to a CalabiYau manifold or similar higher-dimensional analogues of K3 surfaces, and think of flex-shrink as behaving like the 7 compactified dimensions propagating from one point to another by summing probability amplitudes.