Archive for June, 2011

Creative Commons Share Alike, my bum

As part of tarting up Introducing HTML5 for its second edition, I’m discussing the very useful -moz-ui-invalid pseudo-class. The documentation at Mozila Developer Centre is a paragon of clarity and succinctness, so much so that my instinct is to quote the 4 lines “The result is that .. unchanged valid value” with attribution, rather than rephrase it and reduce its clarity.

However, the license for that page is CC Share Alike:

Share Alike If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Now, I don’t know whether quoting within a chapter is “building upon” or not. I can’t release the book under a similar license as neither Remy nor I own the intellectual property (we tried to persuade the publishers to release it but they were… somewhat antipathetic (ahem) to that idea).

Twitter chums advised that quoting 4 lines was OK as “fair use”. But I’m in the UK and as far as I can tell, we don’t have that concept here. Wikipedia says of UK “fair dealing”:

Under the Copyright, Designs and Patents Act 1988 (CDPA), fair dealing is limited to the following purposes: research and private study (both must be non-commercial), criticism, review, and news reporting (sections 29, 30, 178). Although not actually defined as a fair dealing, incidental inclusion of a copyrighted work in an artistic work, sound recording, film, broadcast or cable programme doesn’t infringe copyright.

But our book is a commercial project. It’s not criticism, review or news.

So I’ve emailed the MDC to ask them to waive their rights. I’m writing this book as a private individual, and the derisory royalties that technical books produce don’t make me willing to accept personal legal risks: no way am I risking my house, which is the only thing of value I own. (Hiring a lawyer would use up all my royalties.)

This emphatically is not a criticism of Mozilla – they’ve always had an excellent track record of openness and I’m certain they’d be delighted to be quoted in a chapter that praises them.

It’s a criticism of UK copyright law and the Share Alike license which doesn’t define “build upon” or “non-commercial” in any useful way.

Installable web apps and interoperability

One (of many) super outcomes of the HTML5 evolution is that browser vendors are striving towards interoperability – even Microsoft is talking of “same markup”.

However, the dedication to interoperability hasn’t spilled over into the world of installable browser applications. Installable apps (in W3C parlance, Widgets – which is a terrible name) allow authors to write apps using HTML(5), CSS, JavaScript, SVG etc, and package them up into a glorified Zip file with some configuration details which can then be installed on a computer. They then use the browser’s rendering engine, but don’t show browser chrome. To all intents and purposes, they’re indistinguishable from native apps.

The W3C defines them as

full-fledged client-side applications that are authored using technologies such as HTML and then packaged for distribution. Examples range from simple clocks, stock tickers, news casters, games and weather forecasters, to complex applications that pull data from multiple sources to be “mashed-up” and presented to a user in some interesting and useful way.

Opera (disclosure: my employer) uses the W3C standard for its packaging format – so the assets are bagged up in a zip file, which is renamed .wgt The configuration information is an XML file that specifies things like required features (eg, camera access), default size of the Widget (full-screen, minimised etc) and its network access permissions. (Learn more or download some widgets and have a play).

W3C Widgets work in Opera browsers (and we re-use the format for Opera Extensions), Apache Wookie, Nokia Series 40 phones [PDF], some Vodafone phones, Windows Mobile 6.5 (although in Win Phone 7 you have to use Silverlight, yay Same markup!) and other places, such as forthcoming interactive classroom whiteboards and TVs.

Chrome has a widget format called .crx that is so similar to W3C Widgets that Scott Wilson wrote a Chrome apps to W3C Widget converter, saying

I was intrigued to find out what sort of formats the Chrome Web Store was using for its “installed web applications, and discovered somewhat to my surprise it uses yet another packaging and manifest format! This is in addition to the two manifest formats Google already uses (for Gadgets/OpenSocial/Wave and Google App Market).

The format uses the file extension “.crx and consists of a 7-Zip archive and a manifest file in JSON. The actual contents however are almost identical to W3C Widgets, and so I created a proof-of-concept set of conversion code.

My question to chums in Chrome and Mozilla (which has its own Mozilla Install Manifest format): what’s missing from the standard W3C Widgets specification that you need? Wouldn’t it be better for us all to collaborate on one interoperable specification, as we’re doing so successfully with HTML5?

My chum Marcos Caceres is the editor of the Widgets spec and would doubtless leuurve your feedback.

Update 24 July 2012. I never got an answer from Chrome, but they have announced their own non-standards-based proprietary Packaged Apps format. Hurray for interoperability.

(Last Updated on 24 July 2012)

Disabled people working for less than minimum wage

One of the New! Improved! caring-sharing-Tories™, Philip Davies, the MP for Shipley, has called for the minimum wage to be relaxed so that people with disabilities can work for less than the minimum wage.

Naturally, because he’s caring-and-sharing, he only has those people’s best interests at heart:

My concern about it is it prevents those people from being given the opportunity to get the first rung on the employment ladder.

But he’s not just caring-and-sharing. He’s also a True Blue Tory who lives in The Real World of laisez-faire economics:

The point is that if an employer is considering two candidates, one who has disabilities and one who does not, and if they have to pay them both the same rate, which is the employer more likely to take on? Whether that is right or wrong and whether my hon. Friend would or would not do that, that is to me the real world in which we operate.

(Full speech in Hansard)

Rather stupidly, I had assumed that the role of Members of Parliament was to enact legislation that protected the vulnerable by promoting equality, redistributing wealth from the very rich to the disadvantaged and ensure that people aren’t exploited in the workplace.

I realise now that, because inequality and exploitation exists in the real world, we should accept it and encourage it by exempting groups of people from laws designed to protect them.

So let’s have an army of ultra-low paid people doing menial tasks without legal protection of any sort. In the capitalist real world, there is no need to price those people out of the market with statutory maximum working hours, or the requirement for safety equipment as they go down mines or up chimneys.

The disabed are analagous to former prisoners, says Mr Davis:

The only way the former prisoner would be given a chance by the employer is if the employer was able to say, “I’ll give you a smaller amount for a certain period of time and we’ll see how it goes. If you prove yourself, I’ll move you up.

From his voting record, I see that Mr Davis voted against equal gay rights, presumably so we can have minimum wage-exempt homosexuals staffing up hairdressing salons or kd lang tribute acts. I’m surprised that he voted for a stricter asylum system, given the opportunity it gives us to import squadrons of highly-trained professionals from war-torn areas of the world who could work as doctors for £3 an hour in the cash-strapped NHS.

Mr Davis believes criticism of his remarks is “leftwing hysteria”.

I’m not hysterical at all. In fact, if Mr Davis would care to attend my kickboxing class next Saturday, I will kick his arse for 60 minutes and not invoice him5.93 for that hour at all. As someone with a disability (multiple sclerosis), I’ll happily do it for free. To prove myself.

Modal dialogues in HTML5

A major cause of accessibility problems in Web Apps is authors faking modal dialogue boxes and not providing keyboard access to close or respond to those. Thanks largely to the agitation of The Mighty Steve Faulkner, Ian Hickson will be looking at at how to build this into the language.

This is particularly welcome, because when I interviewed Ian for the Web Standards Project two years ago, I asked him what his favourite feature that will get bumped from HTML5 to HTMLnext, and he replied

In-window modal dialogs or dialog box—the kind of prompt you get when the computer asks you a question and won’t let you do anything else until you answer the question. For instance, the window that comes up when you say "Save As…" is usually a modal dialog.

Right now people fake it with divs and complicated styles and script. It would be neat to just be able to say "make this section a modal dialog". Like showModalDialog(), but within the page instead of opening a new window with a new page.

I’d add it to HTML 5, but there are so many new features already that we need to wait for the browsers to catch up.

Steve’s mail to the working group gives lots of examples of faked modal dialogues in the wild. They’re also collecting use-cases over at the WHATWG wiki – don’t be bashful to add any that you can think of.

It would be super if there were a declarative method, for example (off the top of my head) a modal attribute that could go on a div/ article/ form that would do the trick.

What do you think?

Jack Henderson draws DRM

Bruce in front of giant screen with letters 'DRM' illustrated with scary faces, spiders and flames

I asked 6 year old Jack Henderson to illustrate my slide on Digital Rights Management for my talk on HTML5 multimedia at Web Directions @media, May 2011 in London. Even a 6 year old knows DRM is ugly and scary, so don’t do it kids!

Jack’s drawing pictures of anything in return for donations. He says “I am doing this because my little brother Noah goes to Hospital lots and the name of it is Sick Kids Hospital in Edinburgh”. His target was £100—he’s raised £20,000 so far.

Please consider donating or buying his book.

Apparently, Jack’s pretty pleased with his giganticest picture yet. We also made the Edinburgh Evening News.

On the HTML5 “revolution”

I’ve often heard HTML5 – or “HTML5″/ NEWT – being described as a revolution. It’s not.

I can see why people make the mistake. Some of the demos that are going around are so amazing that they feel like a break with the past (and some of those demos are good old DHTML: nothing new at all). Also, revolutions are fun, they have goodies and baddies. There are heroes and comrades, and there’s an element of year-zeroism: “burn the museums”, said the Futurists.

But HTML5 is not revolutionary. It’s deliberately and passionately evolutionary. While XHTML2 broke backwards compatibility with its own year-zeroism, HTML5 evolves the Web. As Ian Hickson said seven years ago yesterday:

My favorite topic is backwards compatibility…we want a backwards-compatible solution that we can deploy with current or soon-to-be-released browser. Web applications already exist, and for example. Documents are becoming interactive as well. But if you view SVG or XForms in today’s browsers, you get just text, and nothing works. What we mean by backwards compatible is stuff that works in today’s browsers.…Another reason to be backwards compatible is that authors already know HTML and JavaScript. In conclusion, a solution based on HTML is better than one that isn’t.
W3C Workshop on Web Applications and Compound Documents (Day 1) Jun 1, 2004

The purpose of HTML5 is to evolve the Web using and extending familiar technologies while preserving backwards compatibility. We see this with the design of <video> that allows fallback content with older browsers; the fact that all new input types degrade to type=text so users of older browsers can still enter data—and look at the cunning way <datalist> is designed to be be able to swap into a select in older browsers. See how feature-detection is built into the spec.

The WHATG Charter describes it:

All specifications produced by this working group must take into account backwards compatibility, and clearly specify reasonable transition strategies for authors. They must also specify error handling behaviour to ensure interoperability even in the face of documents that do not comply with the letter of the specification.

“Reasonable transition strategies”. I’ll bet Trotsky never said anything like that.

Heroes of the Evolution

Evolutions aren’t as sexy as Revolutions, but they still throw up heroes. These people don’t necessarily get the attention they deserve: people like John Foliot, using a decade’s experience to ensure that HTML5 is accessible. Or Steve Faulkner, doing the unglamorous research that’s enabling us to map HTML5 and WAI-ARIA.

There’s my co-author, Remy Sharp, coder of the original HTML5 Shiv and inventor of the term Polyfilling to describe a method of coding to the boring old evolutionary Standards and letting JavaScript fill the holes in older browsers. Paul Irish and Faruk Ateş made Modernizr which takes the feature-detection and makes it user-friendly.

Silvia Pfeiffer does loads of work with her colleagues on the HTML Media Working Group to bring about easy-to-author, robust, open video and audio to the web that has accessibility built-in. And there are many, many more Heroes of the Evolution explaining and educating, like my fellow HTML5 Doctors who give their time and expertise voluntarily (I get paid to do it).

Vive l’evolution!

(Last Updated on 21 December 2011)