<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML5 Doctor &#187; Bruce Lawson</title>
	<atom:link href="http://html5doctor.com/author/brucel/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Wed, 16 May 2012 11:31:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>HTML5 adaptive images: end of round one</title>
		<link>http://html5doctor.com/html5-adaptive-images-end-of-round-one/</link>
		<comments>http://html5doctor.com/html5-adaptive-images-end-of-round-one/#comments</comments>
		<pubDate>Wed, 16 May 2012 10:36:45 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Specification Changes]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=4645</guid>
		<description><![CDATA[<p>After The Great Vendor Prefix Hullaballoo of April 2012 comes The Great Responsive Images Brouhaha of May 2012. We look at the main competing formats for adding adaptive images to HTML - the <code>&#60;picture&#62;</code> element, and the <code>&#60;img srcset=""&#62;</code> attribute.</p>]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://dev.opera.com/articles/view/opera-mobile-emulator-experimental-webkit-prefix-support/">The Great Vendor Prefix Hullaballoo of April 2012</a> comes The Great Responsive Images Brouhaha of May 2012. </p>
<p>Adaptive images are the next unsolved mystery of Responsive Web Design. Do you send large high-res images suitable for retina dispays, which are scaled down on smaller, lower res devices and which therefore waste bandwidth? Or do you send low-res images, whch look grotty when scaled up to large screens or high-res displays? Authors have had to rely on <a href="http://css-tricks.com/which-responsive-images-solution-should-you-use/">elaborate hacks</a> to send different content images (that is <code>&lt;img&gt;</code> in HTML rather than CSS background images) to different types of devices.</p>
<p>By November 2011, I was so frustrated that no specification body was considering the problem that <a href="http://www.brucelawson.co.uk/2011/notes-on-adaptive-images-yet-again/">I proposed a strawman &lt;picture&gt; element</a> that re-used the mechanism of HTML5 &lt;video&gt; with its media queries to swap in different source files:</p>
<pre><code>
&lt;picture alt=&quot;angry pirate&quot;&gt;
   &lt;source src=hires.png media=&quot;min-width:800px&quot;&gt;
   &lt;source src=midres.png media=&quot;min-width:480px&quot;&gt;
   &lt;source src=lores.png&gt;
      &lt;!-- fallback for browsers without support --&gt;
      &lt;img src=midres.png alt=&quot;angry pirate&quot;&gt;
&lt;/picture&gt;</code>
</pre>
<p>Around the same time, others <a href="http://www.w3.org/community/respimg/2012/02/23/picture-for-existing-browsers/">independently came to the same idea</a> and were advised to set up a <a href="http://www.w3.org/community/respimg/">W3C community group</a> to discuss it which they did. However, in January, the HTML5 editor, <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-January/034490.html">Ian Hickson, had said</a></p>
<blockquote>What&#8217;s the use case for doing it for images in &lt;img&gt; elements? Typically &lt;img&gt; elements are for content images, where you don&#8217;t usually want to adapt anything.</blockquote>
<p>Those web authors in the W3C Resposive Images Community Group  soldiered on in frustration that they were they being ignored  because the problem itself wasn&#8217;t seen as a problem. Then this week, Edward O&#8217;Connor of Apple suggested another method, using a <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-May/035746.html">new <code>srcset</code> attribute</a> on the &lt;img&gt; element. This complemented a similar suggestion of his from February for <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/1103.html">img-set in CSS</a> that is already being added to WebKit:</p>
<pre><code>&lt;img src="foo-lores.jpg"
     srcset="foo-hires.jpg 2x, foo-superduperhires.jpg 6.5x"
     alt="decent alt text for foo."&gt;</code></pre>
     <p>The numbers &#8220;2&#8243; and &#8220;6.5x&#8221; tell the browser the relative resolutions; foo-hires.jpg is 2x the resolution of foo-lores.jpg.</p>
<p>Only a few days later, a variant of Apple&#8217;s suggestion was <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-May/035855.html">added to the spec</a>.</p>
<p>There are two major differences between &lt;picture&gt; and srcset. The most obvious is that srcset uses the &lt;img&gt; element, which is great because that&#8217;s the natural place for images, adaptive or not. (You can&#8217;t re-use the &lt;video&gt; + &lt;source&gt; pattern with &lt;img&gt; because it is an empty element so can&#8217;t have child elements. O&#8217;Connor&#8217;s solution uses attributes, which are fine.)</p>
<p>The other major difference is that it doesn&#8217;t use Media Queries. With Media Queries, the author is reponsible for thinking up every permuations of viewport size, orientation, dpi, colour depth, aspect ratio and the like, deciding how to cater for them (if at all), identifing the breakpoints and coding them up. This requires a lot of consideration by the author, and makes for verbose code; a page with 20 pictures, each with 5 Media Queries on 5 &lt;source&gt; elements quickly becomes a lot of code.</p><p>O&#8217;Connor wrote</p>
<blockquote>
<p>Why provide a scale factor and not a media query? Well, media queries are claims about UA state, whereas here we&#8217;re asserting something about the relationship between the image assets. Also, User Agents should be free to use whichever asset they deem best suited to their current situation, taking into account not just &#8220;media-queriable things&#8221; like device resolution but also any scaling applied to the &lt;img&gt; with CSS, its width=&#8221;" and height=&#8221;" attributes, or even things like the current page zoom level.</p>

</blockquote>
<p>I have a lot of sympathy with allowing the browser to make decisions about what it knows of the environment (network speed, latency, pixel density, orientation) to choose the best image for the job. The idea is that the author shouldn&#8217;t be expected to anticipate and cater for all those variables. What she can do is describe the things she knows about -the images, their size and pixel density- and the browser will make its choice.</p><p>That way, when we&#8217;re all living in space and looking a 3D holograms, the proximity to a black hole can be detected by the iDroid3000 device (black holes notoriously cause Web hologram negative timespace inversions) and the right image chosen; we don&#8217;t need to invent new media queries for event horizon proximity and retrospectively add it to our websites.</p>
<p>There are two problems with the srcset suggestion. The first is highly subjective, but many feel the same: as it exists in the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-srcset">current, first draft of the spec</a>, the syntax is revolting:</p>
<pre><code>&lt;img src="face-600-200-at-1.jpeg" alt=""
srcset="face-600-200-at-1.jpeg 600w 200h 1x,
face-600-200-at-2.jpeg 600w 200h 2x,
face-icon.png 200w 200h"&gt;</code></pre>
<p>Of course, this can be improved, and must be. This isn&#8217;t just about aesthetics. If the syntax is too weird, it will be used wrongly. As <a href="https://twitter.com/#!/rem/status/202306584880234496">Dr Remy wrote</a>, &#8220;Good to see authors have <em>another</em> microsyntax to learn. It&#8217;s not like they had any trouble with vendor-prefixes.&#8221;</p>
	
<p>The second problem is that authors don&#8217;t want to relinquish control. There are questions of art direction (see the section headed <a href="http://css-tricks.com/which-responsive-images-solution-should-you-use/">Do I care about art direction?</a>), and many remain unconvinced that the Apple suggestion addresses that; proponents of srcset are convinced that <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-May/035907.html">it does address those use cases</a>. </p> 
<p>Debate continues, with a <a href="http://www.cartoonstock.com/directory/e/exchange_of_views.asp">full and frank exchange of views</a>. There are understandably <a href="http://timkadlec.com/2012/05/wtfwg/">hurt feelings</a>, too, because some of those who laboured in the Community Group feel that <a href="http://www.alistapart.com/articles/responsive-images-and-web-standards-at-the-turning-point/">their wishes and work have been ignored</a>.</p> 
<p>As one of those who proposed &lt;picture&gt;, I have a degree of attachment to it. That&#8217;s ego. (In fact, I&#8217;d be delighted if it were called the &lt;yayBruce&gt; element, but I&#8217;m resigned to the unfairness of life.) But I don&#8217;t really care which syntax makes the spec, as long as it addresses the majority of use cases and it is usable by authors. I&#8217;m just glad we&#8217;re discussing the adaptive image problem at all.</p>
<p>So, get involved. Read the discussions and say your piece. And once the dust has settled and the specification is looking stable, we Doctors will write up our diagnosis.</p> <div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/html5-briefing-notes-journalists-analysts/" rel="bookmark" class="crp_title">HTML5: briefing notes for journalists and analysts</a></li><li><a href="http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/" rel="bookmark" class="crp_title">HTML5 Simplequiz 6: Zeldman&#8217;s fat footer</a></li><li><a href="http://html5doctor.com/getusermedia/" rel="bookmark" class="crp_title">It&#8217;s Curtains for Marital Strife Thanks to getUserMedia</a></li><li><a href="http://html5doctor.com/why-designers-should-care-about-html5/" rel="bookmark" class="crp_title">Why designers should care about HTML5</a></li><li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li></ul></div><p><a href="http://html5doctor.com/html5-adaptive-images-end-of-round-one/" rel="bookmark">HTML5 adaptive images: end of round one</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 16, 2012.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-adaptive-images-end-of-round-one/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Curtains for Marital Strife Thanks to getUserMedia</title>
		<link>http://html5doctor.com/getusermedia/</link>
		<comments>http://html5doctor.com/getusermedia/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 14:56:03 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[JavaScript APIs]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[getusermedia]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webrtc]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=4335</guid>
		<description><![CDATA[<p>HTML5 (or now, the WebRTC spec) gives us getUserMedia, a way for JavaScript to access streams from a device's camera and microphone. Find out how to use it and normalise the syntax differences between Opera and Chrome with the gUMshield.</p>]]></description>
			<content:encoded><![CDATA[<p>True story: I was tasked by the lovely Mrs Lawson to buy some curtains that match our carpet during the January sales. I dutifully did so — and had to return to the shop straight away because they didn&#8217;t match at all. Mrs Lawson accompanied me, and with a withering glance at her incompetent mate, immediately found some correctly hued fabric, and all was well.</p>

<p>But what&#8217;s a middle-aged colour-blind bloke to do? I had early in the curtain procurement process decided against cutting a hole in the carpet in order that I may take a sample with me. (All other mistakes aside, this was a correct decision.)</p>

<p>So, in order to ensure that I would never again repeat the mistake, I set out to make an app that would allow me to capture the colour of an image straight from my camera. Of course, it had to be a web app rather than a native app, because we&#8217;re web angels, not proprietary devils.</p>

<section id="intro">
  <h2><code>getUserMedia</code> <a href="#intro" class="permalink">#</a></h2>

  <p><a href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html"><code>getUserMedia</code></a> is an API that gives a web page access to a user&#8217;s camera and microphone via JavaScript. It&#8217;s supported in Opera Labs (<a href="http://dev.opera.com/articles/view/labs-more-fun-using-the-web-with-getusermedia-and-native-pages/">latest Android build</a>, <a href="http://dev.opera.com/articles/view/getusermedia-access-camera-privacy-ui/">latest desktop builds</a>) and WebKit in <a href="http://tools.google.com/dlpage/chromesxs?platform=win">Chrome Canary</a> builds (<a href="https://sites.google.com/site/webrtc/running-the-demos">instructions</a>).</p>

  <p>Like many other APIs, it&#8217;s not part of the &#8220;real&#8221; HTML5 spec. It started life as the HTML5 <code>&lt;device&gt;</code> element, then got moved into the W3C as part of the <a href="http://www.w3.org/TR/webrtc/">webRTC</a> specifications. But let&#8217;s not taxonomise when we could be having fun.</p>

  <p>The first thing we need to do when using super-cool new UIs is detect whether it&#8217;s supported:</p>

  <figure>
    <pre><code> if (navigator.getUserMedia) {
  // do something cool
} else {
  // fallback code
}</code></pre>
    <figcaption>Basic usage of <code>getUserMedia</code></figcaption>
  </figure>

  <p>For this article, our &#8220;do something cool&#8221; will be to grab the dominant colour of the current input stream from the camera. As a fallback, we have several options.</p>

  <p>One option, if we&#8217;re using the default Android browser, is to show a form that automatically starts the camera when focussed:</p>

  <figure>
    <pre><code>&lt;form enctype="multipart/form-data" method="post"&gt;
  &lt;input type="file" accept="video/*;capture=camera" /&gt;
&lt;/form&gt;</code></pre>
    <figcaption>Fallback code for Android</figcaption>
  </figure>

  <p>There&#8217;s also the <a href="http://www.w3.org/TR/2011/WD-html-media-capture-20110414/#captureparam"><code>capture</code> attribute</a>, a proposed extension from the <a href="http://www.w3.org/TR/html-media-capture/">W3C Device API Media Capture API</a> that tells a user agent where to get the input data. Android extends the <a href="http://dev.w3.org/html5/spec/states-of-the-type-attribute.html#attr-input-accept"><code>accept</code> attribute</a>. See more in <a href="http://davidbcalhoun.com/2011/android-3-0-honeycomb-is-first-to-implement-the-device-api">David Calhoun&#8217;s Device API article</a>. Alternative capture arguments are <code>camcorder</code> (for video), <code>microphone</code>, and <code>filesystem</code>.</p>

  <p>Browsers that don&#8217;t understand the still-draft Media Capture API will simply ignore the <code>capture</code> attrbute and prompt the user to browse to a file on their file system for uploading.</p>

  <p>Users on iOS are out of luck, as their devices don&#8217;t allow access to the file system.</p>

  <section id="differences-from-media-capture">
    <h3>Differences Between the Media Capture API and <code>getUserMedia</code> <a href="#differences-from-media-capture" class="permalink">#</a></h3>

    <p>Robin Berjon, co-chair of the Device API (DAP) Working Group explains: The markup-only Media Capture API is a simpler, low-hanging-fruit version that can work easily for a lot of use cases. It also has a very simple security model (just a file upload).</p>

    <p>In fact, it works exactly like <code>&lt;input type=file&gt;</code>, except that it knows to allow the user to grab a pic from the camera by default instead of hitting the filesystem. But just like with <code>&lt;input type=file&gt;</code>, once a picture has been taken (i.e., a file selected), you can access it and read from it using the File API, which means you can stuff it in an <code>&lt;img&gt;</code> or a <code>&lt;canvas&gt;</code> and do nasty things to it without annoying any faraway server.</p>

    <p>But of course, if it&#8217;s part of a form and you submit it, it gets submitted just like a regular file upload.</p>

    <p>The thing is, though, it&#8217;s always a snapshot. Even if you use it to take a video (which you can), the page only gets it after you&#8217;ve finished shooting. With <code>getUserMedia</code> (<b>gUM</b>), you get the live stream, which you can modify, record, or stream elsewhere. The gUM approach is more powerful but more complex, and it has more severe security issues.</p>
  </section>
</section>

<section id="api">
  <h2><code>getUserMedia</code> API <a href="#api" class="permalink">#</a></h2>

  <p>Let&#8217;s assume (because we&#8217;re optimists) that your user has a <code>getUserMedia</code>-enabled device. The API is nice and simple, as all Web APIs should be.</p>

  <p><code>navigator.getUserMedia</code> accepts two required arguments and an optional third.</p>

  <p>The first argument tells the device <b>which media you require access to</b>, and it&#8217;s passed as a JavaScript object. So, if you only require access to the microphone, the first argument would be <code>{audio: true}</code>; for video-chatting, you would use <code>{audio: true, video: true}</code>.</p>

  <p>The device decides which camera to use: <q>User agents are encouraged to default to using the user&#8217;s primary or system default camera and/or microphone (as appropriate) to generate the media stream.</q></p>

  <p>A previous version of the specification allowed hints to user agents about which camera to use. The API could specify &#8220;user&#8221; (the front camera on a phone) or &#8220;environment&#8221; (the rear camera on a phone). Debate continues about whether to reinstate this (<a href="http://lists.w3.org/Archives/Public/public-media-capture/2012Jan/0014.html">read the ongoing conversation</a>). One argument against is that letting sites know what cameras a device has could help Dr Malice of Evil Corp. fingerprint users after luring them to his site (which I find to be overly-cautious). <a href="http://lists.w3.org/Archives/Public/public-media-capture/2012Jan/0018.html">Harald Alvestrand poses a conundrum</a>: <q>conferencing units may have a room camera, a document camera and a lectern camera, neither of which is attached to the physical box; which one of these is <q>front</q>?</q></p>

  <p>But let&#8217;s not worry at the moment. Devices with more than one camera generally have a mechanism that allow the user to choose which one is used, so this gives the user control. Note also that the spec says <q>User agents may allow users to use any media source, including pre-recorded media files.</q></p>

  <p>The second argument is the <b>success callback</b>, the function to be executed on success, assuming that the user allows access and the device supports your request.</p>

  <p>There is an optional third argument. This is the <b>failure callback</b>, the function to be executed if something went wrong. It&#8217;s optional, but only optional in the sense that washing your hands before you eat is optional: if you don&#8217;t do it, you leave yourself open to all sorts of bugs and your mum will shout at you.</p>

  <p>Of course, it&#8217;s important to do feature detection before making an API call to ensure that the browser and device are capable, but even if feature detection succeeds, there is still much that can cause failure. For example, the user could deny permission or turn off the camera via a hardware switch, or the device itself could disable the camera.</p>

  <p>So here&#8217;s how we recommend you use the API:</p>

  <figure>
    <pre><code>navigator.getUserMedia({audio: true, video: true}, success, error);

function success(stream) { 
  // ... use 'stream' ... 
} 

function error(){ 
  // display fallback content 
}</code></pre>
    <figcaption>Using the gUM API</figcaption>
  </figure>

  <p>To check whether it&#8217;s working correctly, we can attach the output of the camera&#8217;s stream to the input of an HTML5 video on the page, like this:</p>

  <figure>
    <pre><code>&lt;video autoplay&gt;&lt;/video&gt;
&lt;script&gt;
if (navigator.getUserMedia) {
  navigator.getUserMedia({audio: true, video: true}, success, error);
  function success(stream)
  { 
    // ... use 'stream' ...
    var video = document.getElementsByTagName('video')[0];
    video.src = stream; 
  }
  // ...
&lt;/script&gt;</code></pre>
    <figcaption>Streaming captured video to an HTML5 <code>&lt;video&gt;</code> element</figcaption>
  </figure>

  <section id="differences-between-webkit-and-opera">
    <h3>Differences Between Webkit and Opera <a href="#differences-between-webkit-and-opera" class="permalink">#</a></h3>

    <p>The two rendering engines that implement getUserMedia do so in two different ways. Hopefully, they&#8217;ll harmonise when the features reach the released browsers.</p>

    <p>The differences:</p>

    <ul>
      <li>WebKit uses a prefix — <code>navigator.webkitGetUserMedia</code> — while Opera doesn&#8217;t.</li>
      <li>
        WebKit implements the options according to an old version of the spec, in which audio and video were passed as strings:
        <pre><code>navigator.webkitGetUserMedia("video, audio", /* ... */)</code></pre>
        whereas Opera implements the most recent version of the specification which uses JavaScript objects:
        <pre><code>navigator.getUserMedia({video: true, audio: true}, /* ... */)</code></pre>
      </li>
      <li>
        WebKit attaches the resulting stream like this:
        <pre><code>video.src = window.webkitURL.createObjectURL(stream);</code></pre>
        which is according to the current version of the spec. Opera uses:
        <pre><code>video.src = stream;</code></pre>
        and has proposed simplifying the spec (but discussion continues).
      </li>
    </ul>

    <p>But this fragmentation, even though it&#8217;s only in experimental browser releases is, like, a total drag, man.</p>
  </section>

  <section id="gUM-shield">
    <h3>Introducing The gUM Shield <a href="#gUM-shield" class="permalink">#</a></h3>

    <p>Fortunately, we&#8217;ve got your back. Two of the finest minds I know — actually, two of the finest <em>Mikes</em>, Doctor <a href="http://twitter.com/akamike">Mike Robinson</a> and Opera&#8217;s <a href="http://twitter.com/miketaylr">Mike Taylor</a> — have created a snippet of script that you can copy to shield you from these annoying differences. We&#8217;ve named this <code>getUserMedia</code> syntax normalisation script snippet <a href="https://gist.github.com/f2ac64ed7fc467ccdfe3">The gUM Shield</a>.

    <p>It assumes that there&#8217;s a variable called <var>video</var> to which you&#8217;ve assigned a reference to the <code>&lt;video&gt;</code> element you&#8217;ll stream to. Do this with some mechanism like:</p>

    <pre><code>video = document.getElementById('video');</code></pre>

    <p>Simply <a href="https://gist.github.com/f2ac64ed7fc467ccdfe3">hit the &#8216;Hub</a>, download it, plug it into your script, and <a href="http://jsbin.com/avaxaq/edit#preview">check it out</a>!</p>

    <p>Note that it&#8217;s <em>experimental</em>. Who knows what&#8217;ll happen when Mozilla, Microsoft, and Apple implement it, but please, have a play. Fork it and improve it!</p>
  </section>
</section>

<sectino id="exciting">
  <h2>Doing Exciting Things with the Video Stream <a href="#exciting" class="permalink">#</a></h2>

  <p>So far, we&#8217;re only echoing the video stream. But, as you&#8217;ll know from Tab Atkins&#8217; guest article <a href="http://html5doctor.com/video-canvas-magic/">video + canvas = magic</a>, if we copy the video into a canvas, we can manipulate it:</p>

  <figure>
    <pre><code>var video = document.querySelector('video');
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext('2d');

ctx.drawImage(video, 0, 0, video.width, video.height,
  0, 0, canvas.width, canvas.height);</code></pre>
    <figcaption>Canvas and video magic</figcaption>
  </figure>

  <p>A common mistake is assuming that this somehow establishes a &#8220;live connection&#8221; between the video stream and the canvas. It doesn&#8217;t. It only grabs the current frame. So you need to grab the current frame repeatedly in order to replicate a video. The magical number is 15 times a second (or every 67 milliseconds), but a slower frame rate would probably be okay for this demo:</p>

  <figure>
    <pre><code>setInterval(function () { 
  ctx.drawImage(video, 0, 0, video.width, video.height,
  0, 0, canvas.width, canvas.height);
}, 1000 / 67);</code></pre>
    <figcaption>Live updating of <code>&lt;canvas&gt;</code> from a <code>&lt;video&gt;</code></figcaption>
  </figure>

  <p>See the <a href="http://jsbin.com/ahozok/edit#html,live">working demo</a>.</p>

  <p>What I want to do now is to grab the dominant colour from the canvas. I&#8217;m stealing <a href="http://experimenting.in/exp/real-life-color-picker/">a demo by Shwetank Dixit</a> (who borrowed from <a href="http://www.lokeshdhakar.com/">Lokesh Dhakar</a>&#8216;s <a href="http://www.lokeshdhakar.com/2011/11/03/color-thief/">Color Thief demo</a>). We won&#8217;t look at how it determines the dominant colour (because that&#8217;s nothing to do with getUserMedia).</p>

  <p><a href="http://html5doctor.com/demos/getusermedia/dominantcolor/">Try this in Opera Labs and Chrome Canary</a>!</p>

  <p>Unfortunately, this works splendidly in Opera but it occasionally fails in Chrome, and we&#8217;re not sure why. (We&#8217;ve emailed the Chrome team to ask them.) Apart from the rather anti-climactic end to an article, you shouldn&#8217;t be dismayed by this. <code>getUserMedia</code> is only available in experimental builds that have plenty of work to be done before they hit production.</p>

  <p>Back to our demo. Once you&#8217;ve got the dominant colour, you could prompt the user for a name for that colour (&#8220;carpet&#8221;, for example) and store that in local storage using its name as a key. Then, when you find a pair of curtains in the shop, you can find their dominant colour and easily compare it with that stored against &#8220;carpet&#8221; from earlier.</p>

  <p>And you can return home, confident of delighting the love of your life with your chromatically appropriate choice of soft furnishings. That&#8217;s HTML5: enriching marriages since 2004.</p>

  <img src="http://html5doctor.com/wp-content/uploads/2012/01/getUserMedia1.jpg" alt="woman says &#039;hey daddy-o, the curtains really razz my berries, ya dig?&#039;. Man replies &#039;Baby, I totally dig. Early night?&#039;. A thought bubble shows him thinking &#039;Thank you, getUserMedia&#039;" width="570" height="390" class="aligncenter size-full wp-image-4336" />
</section>

<section id="harshing-your-mellow">
  <h2>Harshing Your Mellow <a href="#harshing-your-mellow" class="permalink">#</a></h2>

  <p>Things need refining before web apps with <code>getUserMedia</code> are on a par with native applications. At the moment, there is no way of controlling which camera is to be used (and no agreement that a developer should be able to). The camera&#8217;s <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-July/032471.html">flash mechanism isn&#8217;t programmatically controllable</a>, which could harm the user experience. Most importantly are the privacy implications of web pages being able to access your camera. Opera has an <a href="http://dev.opera.com/articles/view/getusermedia-access-camera-privacy-ui/">experimental privacy UI</a>, but Chrome has no UI yet.</p>
</section>

<section id="demos">
  <h2>More Demos <a href="#demos" class="permalink">#</a></h2>

  <p>See Paul Neave&#8217;s <a href="http://neave.com/webcam/html5/">HTML5 Webcam Toy</a> and the links at the foot of my <a href="http://dev.opera.com/articles/view/getusermedia-access-camera-privacy-ui/">Opera Labs article</a>.</p>
</section>

<section id="thanks">
  <h2>Thanks <a href="#thanks" class="permalink">#</a></h2>

  <p>Thank for help and code are due to <a href="http://twitter.com/robinberjon">Robin Berjon</a>, <a href="http://twitter.com/shwetank">Shwetank Dixit</a>, <a href="http://twitter.com/ourmaninjapan">Daniel Davis</a>, <a href="http://www.lokeshdhakar.com/">Lokesh Dhakar</a>, <a href="http://twitter.com/miketaylr">Mike Taylor</a>, <a href="http://twitter.com/akamike">Mike Robinson</a>, and <a href="http://twitter.com/richtibbett">Rich Tibbett</a>.</p>
</section>
<section>
<h2>Addy Osmani&#8217;s Polyfill</h2>
<p>Added 13 March 2012: Addy Osmani has published a <a href="https://github.com/addyosmani/getUserMedia.js">getUserMedia polyfill</a> called getUserMedia.js, which uses Flash if gUM isn&#8217;t available. It&#8217;s not ready for production yet, as IE is still being tested. Forkers may hit the &#8216;hub.
</section><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/how-to-get-all-the-browsers-playing-ball/" rel="bookmark" class="crp_title">How to get all the browsers playing ball</a></li><li><a href="http://html5doctor.com/using-modernizr-to-detect-html5-features-and-provide-fallbacks/" rel="bookmark" class="crp_title">Using Modernizr to detect HTML5 features and provide fallbacks</a></li><li><a href="http://html5doctor.com/introducing-web-sql-databases/" rel="bookmark" class="crp_title">Introducing Web SQL Databases</a></li><li><a href="http://html5doctor.com/html5-briefing-notes-journalists-analysts/" rel="bookmark" class="crp_title">HTML5: briefing notes for journalists and analysts</a></li><li><a href="http://html5doctor.com/video-canvas-magic/" rel="bookmark" class="crp_title">video + canvas = magic</a></li></ul></div><p><a href="http://html5doctor.com/getusermedia/" rel="bookmark">It&#8217;s Curtains for Marital Strife Thanks to getUserMedia</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on February 7, 2012.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/getusermedia/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML5: briefing notes for journalists and analysts</title>
		<link>http://html5doctor.com/html5-briefing-notes-journalists-analysts/</link>
		<comments>http://html5doctor.com/html5-briefing-notes-journalists-analysts/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 06:54:13 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3547</guid>
		<description><![CDATA[<p>Your friendly neighbourhood doctors are often contacted by  journalists and analysts who have questions about HTML5, usually from a consumer of business perspective. This is great, as we spend many more hours every week mutely shaking our heads while reading the ill-informed columns from journalists or analysts who haven't contacted us.</p>
]]></description>
			<content:encoded><![CDATA[<p>Your friendly neighbourhood doctors are often contacted by  journalists and analysts who have questions about HTML5, usually from a consumer or business perspective. This is great, as we spend many more hours every week mutely shaking our heads while reading the <a href="http://www.brucelawson.co.uk/2011/html5-notes-for-analysts-and-journalists/">ill-informed columns</a> from journalists or analysts who haven&#8217;t contacted us.</p>
<p>Here are the most common questions we&#8217;re asked, with non-technical answers. Journos &#8211; you&#8217;re welcome to use these answers (a citation would be nice but isn&#8217;t required).</p>
<p>We&#8217;ll add new questions and answers as they are asked.</p>
<h2>What is HTML5?</h2>
<p>Depends what you mean. There are 3 different uses of the phrase &quot;HTML5&quot;:</p>
<h3>The HTML5 specification</h3>
<p>The most accurate meaning of HTML5 is the specification that is developed by two groups, the <a href="http://en.wikipedia.org/wiki/World_Wide_Web_Consortium">W3C</a> and <a href="http://en.wikipedia.org/wiki/Whatwg">WHATWG</a>, together. There are <a href="http://html5doctor.com/html5-for-web-developers/">different versions</a> of the core HTML5 specification.
<p>It is a much-needed evolution of the language that web pages are written in, and is designed for writing Web <strong>applications</strong> (dynamic interactive web pages that do something). Its predecessor, HTML4, dating from the late 1990s, was written for  Web <strong>Pages</strong> (static, hyperlinked documents of text, images, forms).
<p>Key facts:
<ul>
  <li>It&#8217;s designed to make web pages interoperable across browsers. These days, people use multiple browsers (For example, IE at work, Safari/ Opera on their phone, Opera/ Firefox at home) and it&#8217;s stupid and annoying if a website doesn&#8217;t work everywhere.</li>
  <li>All the browser manufacturers &#8211; Opera, Mozilla (Firefox), Apple (Safari), Microsoft (Internet Explorer), Google (Chrome) &#8211; are working together, along with loads of other individuals and organisations: Netflix, Adobe, IBM, HP, BBC etc.</li>
  <li>It&#8217;s designed to extend the capabilities of the current web, without breaking existing web pages </li>
  <li>It competes with plugins like Microsoft Silverlight and Adobe Flash (which themselves were developed to plug the holes in fossilized HTML4 standard)</li>
</ul>

<h3>HTML5 and close friends</h3>
<p>In addition to the core HTML5 specification, the WHATWG developed other specifications such as


<a href="http://en.wikipedia.org/wiki/Web_Workers">Web Workers</a>, <a href="http://dev.w3.org/html5/websockets/">Web Sockets</a>, <a href="http://www.w3.org/TR/webdatabase/">Web Database</a>. These add more features useful in applications, games and the like.
<p>(Many of these have been part of the core spec at some point, but moved out for procedural/ organisational reasons. They are all grouped together in a specification called <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/">Web Applications 1.0)</a>.
<h3>New, Exciting Web Technologies</h3>
<p>When most non-developers (and many less-informed developers) say &#8220;HTML5&#8243; they are referring to a whole slew of technologies: Core HTML5, its friends and others entirely unrelated technologies, such as  <a href="/finding-your-position-with-geolocation/">Geolocation</a> (the ability for your browser to &#8220;know&#8221; its location), Device Orientation, Touch Events, CSS3 animations (that can replace very simple Flash animations), SVG (a way of describing graphics that look crisp and unpixellated at any screensize) and, the new kid on the block, <a href="http://en.wikipedia.org/wiki/WebGL">WebGL</a>, a port of a popular 3D graphics library to the Web that allows 3D graphics and games in the browser.</p>
<P>Many of these are developed by the W3C; WebGL is developed by <a href="http://en.wikipedia.org/wiki/Khronos_Group">Khronos Group</a>.</p>
<p>It&#8217;s also important to note that many so-called &quot;HTML5&quot; demos are nothing to do with HTML5 at all; many Google Doodles, for example, use <a href="http://en.wikipedia.org/wiki/Dhtml">DHTML</a> &#8211; an HTML 4 technology from the turn of the millennium.
<h2>Why has HTML5 been invented?</h2>
<p>HTML 4 was creaking at the seams for the new breed of applications. Some things were impossible and needed plugins like Adobe Flash or Microsoft Silverlight; other things required elaborate hacks on undocumented features, which wasn&#8217;t a robust foundation for websites that make money for their owners.</p>
<h2>How many HTML5-compliant browsers are there?</h2>
<p>It depends on your definition. Because HTML5 extends HTML4, by definition all browsers have some HTML5 features.</p>
<p>If, on the other hand, you want to know which browsers include all Core HTML5 features, none of them do. They are all implementing pieces of the specification (which is 700+ pages long) but none implement all.</p>
<p>Disregarding all the hype, the modern versions of the browsers are all around the same level of implementation (although different browsers implement different features at different times, depending on the needs of their customers).</p>
<h2>Who&#8217;s driving HTML5?</h2>
<p>It began in Opera, in 2004, edited by Ian Hickson. Gradually all the other browser manufacturers joined. Hickson left Opera and joined Google, where he continues to edit the spec. </p>
<p>It&#8217;s fairest to say that browser manufacturers collaboratively drive the spec, with the W3C and many other organisations and individuals. Ultimately, it&#8217;s driven by the needs of  Web developers.</p>
<h2>Who&#8217;s using HTML5?</h2>
<p>Lots of people &#8211; not just tech companies: <a href="http://www.bostonglobe.com/">Boston Globe Newspaper</a>; <a href="http://www.nationwide.co.uk/default.htm">Nationwide Building Society</a>, <a href="http://www.yell.com/">Yell.com</a> and hundreds more. <a href="http://html5gallery.com/">HTML5gallery.com</a> showcases many HTML5 sites.</p>
<h2 id=ready>When will HTML5 be ready?</h2>
<p>Perhaps 2012. Perhaps 2022. It doesn&#8217;t matter; what matters is that a lot of it is implemented in browsers now, so it can be used now.</p>
<p>Saying that we can&#8217;t use HTML5 because it isn&#8217;t finished is like saying we can&#8217;t speak English because it isn&#8217;t finished.</p>
<h2>Is HTML5 incompatible with Internet Explorer?</h2>
<p>Nope. IE9 has good support. Support for some APIs can be patched into older browsers with a technique called <b>polyfilling</b> with JavaScript, or with plugins like Flash and Silverlight. Support for <code>&lt;canvas&gt;</code> can be faked in IE&lt;9. It&#8217;s generally the slow JavaScript engines in older browsers that cause problems. Video content can use a Flash fallback in older versions of all browsers.</p>
<p>It&#8217;s worth noting that many of the features in HTML5 (like <code>contenteditable</code>, 
the Drag and Drop API) were invented by  Microsoft and were included in IE5.</p>
<h2>Is HTML5 just about mobile?</h2>
<p>Absolutely not. Behind HTML5 are some <a href="http://www.w3.org/TR/html-design-principles/">Design Principles</a>, one of which states that it&#8217;s about <a href="http://www.w3.org/TR/html-design-principles/#universal-access">universal access</a>:</p>
<blockquote>
  <p>Features should be designed for universal access&hellip;Features should, when possible, work across different platforms, devices, and media.</p>
</blockquote>
<p>That said, there are several features that are useful on Mobile. If you&#8217;re looking at &quot;real&quot; HTML5, then the ability to continue to interact with a website even when offline via <a href="/go-offline-with-application-cache/">Application Cache (&#8220;Appcache&#8221;)</a> is a useful one. 
<p>The fact that you can use HTML5 &lt;canvas&gt; for animations on devices that, by choice or necessity, can&#8217;t use Adobe Flash can be advantageous.
<p>In the broader &quot;New Exciting Web Techologies&quot; definition of HTML5, Geolocation is a huge feature.
<h2>Will HTML5  kill Adobe Flash?</h2>
<p>No &#8211; or we hope not. For years Flash was the only way to add video to a page; now there is HTML5. This competition means both are getting better, which is great for developers. </p>
<p>Apple decided not to allow Flash on their iOS devices, which is what gave HTML5 video a great boost. It&#8217;s important to note that HTML5 multimedia on iOS is hardly a perfect platform:</p><ul>
<li><a href="http://blog.millermedeiros.com/2011/03/html5-video-issues-on-the-ipad-and-how-to-solve-them/">HTML5 video issues on the iPad and how to solve them</a></li>
<li><a href="http://blog.millermedeiros.com/2011/04/unsolved-html5-video-issues-on-ios/">Unsolved HTML5 video issues on iOS</a></li>
<li><a href="http://remysharp.com/2010/12/23/audio-sprites/">Audio Sprites (and fixes for iOS)</a></li>
</ul>
<p>For video that uses adaptive bit-rate streaming,  or Digital Rights Management (DRM), Flash remains a useful cross-browser tool.</p>

<p>It&#8217;s also necessary to realise that Flash does more than simply video. Some its basic functions like simple gaming have been usurped by HTML5 &lt;canvas&gt;, and the kind of trivial animations that it used to be used for (things spinning on hover, for example) are moved into <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS 3</a>. However, for ease of authoring sophisticated animated content like  games and cartoons, it&#8217;s much easier for authors to write in Flash as Adobe&#8217;s authoring environment has many tools (tweening, timelines) that make it easy for visual developers. This will change as companies develop pleasant authoring environments for &lt;canvas&gt;, but it isn&#8217;t there yet.</p>
<p>(Adobe recently released a preview of a timeline-driven authoring environment for non-Flash animations called <a href="http://labs.adobe.com/technologies/edge/">Adobe Edge</a>. Ignore its claims to be &quot;HTML5&quot;; in its current early incarnation, it&#8217;s simply flying HTML 4&lt;div&gt;s around with JavaScript.)</p>
<h2>Will HTML5  kill mobile Apps?</h2>
<p>HTML5 (in the broadest sense of &quot;New Exciting Web Technologies&quot;) significantly enhance the capabilities of the Web. Two years ago, to access the Global Positioning System on the phone, you had to write a native app in C++ or Java or.NET or Objective C depending on platform. If you wanted to target all platforms, you write the same app multiple times. Now, you can access Geolocation data from JavaScript on every platform (and on laptops too!), by the user visiting a URL rather than downloading an app.</p>
<p>Open web technologies are providing access to the <a href="http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview">device&#8217;s camera and orientation</a>, the system <a href="https://mozillalabs.com/blog/2010/03/contacts-in-the-browser/">contact book</a>, peer-to-peer <a href="http://www.webrtc.org/">in-browser video conferencing</a>, the devices&#8217; file system, and many more. JavaScript engines are becoming almost as fast as native code, so the technical niche for native applications on high-end smartphones still exists, but is becoming smaller. On less sophisticated devices that can&#8217;t run fast JavaScript or a full web browser, native apps are still an important product.</p>
<p>There are non-technical reasons for apps, too. Operators like them very much: they can control distribution and therefore extract money from both purchasers and vendors. Whereas many people dislike the idea of a monolithic appstore and app approval process, some consumers value it. Appstores offer curation &#8211; consumers feel that the apps are vetted and therefore won&#8217;t wreck their phones, steal their identities or (shudder) expose them to Internet smut.</p>
<p>Apps built for one specific device can be highly integrated with the User Interface and User Experience conventions of that device. Some people see this as a compelling advantage. However, uptake of the Web doesn&#8217;t seem to have suffered because authors make one single website rather than  different websites for Linux, Mac and Windows. </p>
<h2>Any further questions?</h2>
<p>If you have any further questions, you can <a href="/ask-the-doctor/">ask the doctor</a>, or <a href="http://www.brucelawson.co.uk/contact/"> analysts/ accredited journalists can ask your author for a briefing</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li><li><a href="http://html5doctor.com/native-audio-in-the-browser/" rel="bookmark" class="crp_title">Native Audio in the browser</a></li><li><a href="http://html5doctor.com/why-designers-should-care-about-html5/" rel="bookmark" class="crp_title">Why designers should care about HTML5</a></li><li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li><li><a href="http://html5doctor.com/getusermedia/" rel="bookmark" class="crp_title">It&#8217;s Curtains for Marital Strife Thanks to getUserMedia</a></li></ul></div><p><a href="http://html5doctor.com/html5-briefing-notes-journalists-analysts/" rel="bookmark">HTML5: briefing notes for journalists and analysts</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on September 20, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-briefing-notes-journalists-analysts/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The Doctors win a Critter award</title>
		<link>http://html5doctor.com/the-doctors-win-a-critter-award/</link>
		<comments>http://html5doctor.com/the-doctors-win-a-critter-award/#comments</comments>
		<pubDate>Mon, 30 May 2011 14:59:57 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[award]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[critters]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[ubelly]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3304</guid>
		<description><![CDATA[Last Wednesday saw HTML5Doctor win a Critters award for best blog.]]></description>
			<content:encoded><![CDATA[<p>Last Wednesday saw HTML5Doctor win a <a href="http://ubelly.com/2011/05/winning-at-the-critters/">Critters award</a> for best blog, courtesy of <a href="http://ubelly.com/about-us/">Ubelly</a>.</p>
<p>Yay.</p>
<p>Jeremy Keith snapped five doctors together at our booth at the Web Directions/ @media conference. Left to right you can see Mike Robinson, Jack Osborne, Rich Clark and Remy Sharp with Bruce in the foreground. Missing are Tom Leadbetter, Oli Studholme and Brandan Lennox.</p>
<p><img src="http://farm4.static.flickr.com/3522/5766768398_0d000709b8.jpg" alt="5 doctors and an award" /></p>
<p>We also got a nice pic with two of the Ubelly team&mdash;back-end specialist Dr Andrew Spooner and Ms Alex Ball. </p>
<p>Thanks Ubelly! And, from Bruce, thanks to <a href="http://dev.opera.com/">Opera</a> for letting me sneak some doctoring in during work time.</p>
<p><img src="http://farm4.static.flickr.com/3103/5766227059_90040b1952.jpg" alt="5 doctors and two microsofties" /></p>
<p>If you have an award or large quantities of banknotes to give us, just get in touch.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/web-directions-atmedia-2010/" rel="bookmark" class="crp_title">HTML5 Doctor at Web Directions @media</a></li>
<li><a href="http://html5doctor.com/get-your-html5-prescription-filled-at-media/" rel="bookmark" class="crp_title">Get your HTML5 prescription filled at @media</a></li>
<li><a href="http://html5doctor.com/happy-1st-birthday-us/" rel="bookmark" class="crp_title">Happy 1st Birthday us</a></li>
<li><a href="http://html5doctor.com/the-address-element/" rel="bookmark" class="crp_title">The Address Element</a></li>
<li><a href="http://html5doctor.com/speaking/" rel="bookmark" class="crp_title">HTML5 Doctor Speaking and Training Appearances</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/the-doctors-win-a-critter-award/" rel="bookmark">The Doctors win a Critter award</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 30, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-doctors-win-a-critter-award/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz 6: Zeldman&#8217;s fat footer</title>
		<link>http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/</link>
		<comments>http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 14:30:20 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[zeldman]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2883</guid>
		<description><![CDATA[For the last couple of years, it's been fashionable to have “fat footers” in websites. Take, for example, Jeffrey Zeldman’s footer...]]></description>
			<content:encoded><![CDATA[<p>A few years ago, <a href="http://www.simplebits.com/">Dan Cederholm</a> published a series of articles called <a href="http://simplebits.com/categories/simplequiz/">Simplequiz</a> in which he posed some options for marking up a specified piece of content and invited readers to choose the one they felt was the best way to mark that up. The value was in the comments in which people said why they made that choice and debated the options (which means it is <em>THE LAW</em> that you read the preceeding comments before adding your own). With Dan&#8217;s blessing, we&#8217;re running an occasional series of <a href="/category/simplequiz/">HTML5 Simplequizzes</a>. </p>
<p>For the last couple of years, it&#8217;s been fashionable to have <a href="http://www.smashingmagazine.com/2009/06/17/informative-and-usable-footers-in-web-design/">&#8220;fat footers&#8221; in websites</a>. Take, for example, <a href="http://www.zeldman.com/#footer">Jeffrey Zeldman&#8217;s footer</a>:</p>
<figure>
<img src="http://html5doctor.com/wp-content/uploads/2011/02/SQ6-zeldman-screen-164x300.png" width="164" height="300" class="aligncenter size-medium wp-image-3109" /></p>
<figcaption>The bottom of Zeldman&#039;s blog has a fat footer</figcaption>
</figure>
<p>We see an area with a svelte black background, containing a super-glammo set of six images, each of which has a caption and links to other sites that Zeldman has an interest in: conferences, books, articles, podcasts. Below those images is a copyright notice, some more conventional footer links (contact, subscribe, style switcher) and a blue stripe:</p>
<figure>
<img src="http://html5doctor.com/wp-content/uploads/2011/02/SQ6-zeldman-footer-300x207.png" width="300" height="207" class="aligncenter size-medium wp-image-3110" /></p>
<figcaption>A closeup of Zeldman’s fat footer</figcaption>
</figure>
<p>Being HTML5 ninjas, we know that we&#8217;ll wrap each image and its attendant caption within <a href="http://html5doctor.com/the-figure-figcaption-elements/"><code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> elements</a> &#8211; but what will we wrap the whole group of external links in?</p>
<p>Choose from the answers below please. Make sure you show your working out. Escape your HTML, please, or we&#8217;ll put a severed unicorn head in your bed.</p>
<h2>A:</h2>
<p>Figures as direct children of the <code>&lt;footer&gt;</code> element:</p>
<pre><code>&lt;footer&gt;
&lt;figure&gt;&hellip;&lt;/figure&gt;
&hellip;
&lt;p&gt;&lt;small&gt;Copyright © 1995–2011 L. Jeffrey Zeldman.&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
</code></pre>
<h2>B:</h2>
<p>The figures in an  <code>&lt;aside&gt;</code> element nested in the <code>&lt;footer&gt;</code>:</p>
<pre><code>&lt;footer&gt;
&lt;aside&gt;
&lt;figure&gt;&hellip;&lt;/figure&gt;
&hellip;
&lt;/aside&gt;
&lt;p&gt;&lt;small&gt;Copyright © 1995–2011 L. Jeffrey Zeldman.&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
</code></pre>
<h2>C:</h2>
<p>The images in a <code>&lt;nav&gt;</code> element inside the  <code>&lt;footer&gt;</code>:</p>
<pre><code>&lt;footer&gt;
&lt;nav&gt;
&lt;figure&gt;&hellip;&lt;/figure&gt;
&hellip;
&lt;/nav&gt;
&lt;p&gt;&lt;small&gt;Copyright © 1995–2011 L. Jeffrey Zeldman.&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
</code></pre>
<h2>D:</h2>
<p>Images in a <code>&lt;div&gt;</code> element immediately before the  <code>&lt;footer&gt;</code>:</p>
<pre><code>&lt;div&gt;
&lt;figure&gt;&hellip;&lt;/figure&gt;
&hellip;
&lt;/div&gt;
&lt;footer&gt;
&lt;p&gt;&lt;small&gt;Copyright © 1995–2011 L. Jeffrey Zeldman.&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
</code></pre>
<h2>E:</h2>
<p>Images in an <code>&lt;aside&gt;</code> element immediately before the  <code>&lt;footer&gt;</code>:</p>
<pre><code>&lt;aside&gt;
&lt;figure&gt;&hellip;&lt;/figure&gt;
&hellip;
&lt;/aside&gt;
&lt;footer&gt;
&lt;p&gt;&lt;small&gt;Copyright © 1995–2011 L. Jeffrey Zeldman.&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
</code></pre>
<p>Your answers below, please, with your rationale, by Friday 12th March.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-1/" rel="bookmark" class="crp_title">HTML5 Simplequiz #1</a></li>
<li><a href="http://html5doctor.com/reviewing-html5-for-web-designers/" rel="bookmark" class="crp_title">Reviewing HTML5 for Web Designers</a></li>
<li><a href="http://html5doctor.com/the-figure-figcaption-elements/" rel="bookmark" class="crp_title">The figure &#038; figcaption elements</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/" rel="bookmark">HTML5 Simplequiz 6: Zeldman&#8217;s fat footer</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on March 4, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/feed/</wfw:commentRss>
		<slash:comments>85</slash:comments>
		</item>
		<item>
		<title>HTML as a Living Standard — For and Against</title>
		<link>http://html5doctor.com/html5-living-standard/</link>
		<comments>http://html5doctor.com/html5-living-standard/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 14:30:12 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Specification Changes]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3000</guid>
		<description><![CDATA[<p>Recently Ian Hickson, editor of the HTML5 specification, announced that HTML is the new HTML5, meaning that the WHATWG will drop the numeral “5” and just call their spec “HTML”. Giant brains John Foliot and Bruce Lawson engage in an intellectual clash of the titans over whether or not you should care.</p>]]></description>
			<content:encoded><![CDATA[<p>People have already written a number of articles either <a href="http://www.zeldman.com/2011/01/27/html5-vs-html/">for</a> or <a href="http://www.infoworld.com/print/149585">against</a> dropping the version number on <abbr>HTML</abbr>. Here are two contrasting views about this news presented by Bruce Lawson, and John Foliot.</p>

<h2>The facts</h2>

<p>Ian Hickson, editor of the <abbr>HTML</abbr>5 specification, announced that <a href="http://blog.whatwg.org/html-is-the-new-html5"><abbr>HTML</abbr> is the new <abbr>HTML</abbr>5</a>, meaning that the <abbr>WHATWG</abbr> will drop the numeral "5" and just call their spec "<abbr>HTML</abbr>". <abbr>HTML</abbr> will be a "<a href="http://wiki.whatwg.org/wiki/FAQ#What_does_.22Living_Standard.22_mean.3F">living standard</a>", with a mixture of widely-implemented features like <code>&lt;canvas&gt;</code> or <code>&lt;video&gt;</code> and wildly experimental features like <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#devices"><code>&lt;device&gt;</code></a>. The W3C produces a spec called "<abbr>HTML</abbr>5". Ian Hickson (currently) edits both of them. They are different. The W3C creates a version of this technology which is under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">W3C Royalty Free Patent Policy</a> to give a better guarantee for developers against patents. This specification has the version number 5. (There's an interesting conversation to be had about the <abbr>WHATWG</abbr>, patent policy, and licensing, but that's not for today.)</p>

<h2>TL;DR: nothing much changes (by Bruce Lawson)</h2>
<p>So what does this mean? What changes for us developers? In practice: very little for most of us. Browsers process what they can process regardless of what mode they're in, what "version" of <abbr>HTML</abbr> is current, or what a document's DOCTYPE claims.</p>

<p>Take for example a document containing a <code>&lt;video&gt;</code> element, using WebM, Ogg, and MP4 <code>&lt;source&gt;</code> elements, with scripted controls using the <a href="http://dev.w3.org/html5/spec/video.html#media-elements">media elements <abbr>API</abbr></a>, <a href="http://dev.w3.org/html5/spec/number-state.html#range-state"><code>input type=range</code></a>, and CSS3 opacity and transitions. With an <abbr>HTML</abbr>2 (yes, <abbr>HTML</abbr><strong>2</strong>!) DOCTYPE, it's a fine example of <a href="http://people.opera.com/brucel/articles/html5dr-html2-video.html"><abbr>HTML</abbr>2 video</a>.</p>

<p>If you're using a modern browser, everything will work fine. Your browser knows how to show those <abbr>HTML</abbr>5 goodies, so it does, regardless of what the DOCTYPE claims. What would be the point of a browser looking up what elements are part of <abbr>HTML</abbr>2 and refusing to show the video since <code>&lt;video&gt;</code> isn't part of that list? Such switching logic would take longer to process, delaying rendering for no practical benefit at all.</p>

<p>The only function of a DOCTYPE is to keep the browser out of <a href="http://en.wikipedia.org/wiki/Quirks_mode">Quirks Mode</a>. The <abbr>HTML</abbr>5 DOCTYPE <code>&lt;!DOCTYPE HTML&gt;</code> is the shortest string that does this reliably. And note that there's no version number on that.</p>

<p>If version-less <abbr>HTML</abbr> surprises you, it shouldn't. It's what <abbr>CSS</abbr> has used all along. We happily use some <abbr>CSS</abbr> 3 modules without vendor prefixes (<code>border-radius</code>, for example) while we avoid some <abbr>CSS</abbr> 2 features because they have no support. So the version number has no practical use and we don't sweat it at all.</p>

<p>Here's an extract from a <a href="http://xhtml.com/en/css/conversation-with-css-3-team/">2008 interview by xhtml.com with Bert Bos</a>, who co-created <abbr>CSS</abbr> with Håkon Wium Lie (one of the <a href="http://www.whatwg.org/charter">core <abbr>WHATWG</abbr> members</a>):</p>

<blockquote>
  <p><b>xhtml.com:</b> I suspect many people haven't noticed that <abbr>CSS</abbr> has no version identifier&hellip;.What drove the original decision not to include a version identifier and how has this affected the evolution of the <abbr>CSS</abbr> spec?</p>
</blockquote>

<blockquote>
  <p><b>Bos:</b> The working group has recognized since a long time that version numbers for document formats (as opposed to software) are a fallacy. <abbr>HTML</abbr> has version numbers (inside the DOCTYPE), but implementations either ignore them or use them for something else ("quirksmode").</p>

  <p>Formats may evolve and be extended, as <abbr>HTML</abbr> and <abbr>CSS</abbr> are, but implementations won't provide different parsers for the different versions. They only implement the current version. The new version better be backwards compatible, or disaster will ensue. You might think that putting in a version number will cause old implementations to refuse documents that are too new, but it doesn't. None of the browsers written in the days of <abbr>HTML</abbr>2 will refuse to handle an <abbr>HTML</abbr>4 DOCTYPE. And none of the current <abbr>HTML</abbr>4 browsers will refuse an <abbr>HTML</abbr>5 document once <abbr>HTML</abbr>5 becomes a standard. No browser wants to admit it can't understand something and users don't want to use new features if that causes the whole file to fail.</p>

  <p>The basic problem is that old and new software and old and new content have to coexist. It isn't possible to pick a day and switch all content and all software in the world over to the new version. And on the Web, some software, and especially some content, have very long life spans.</p>
</blockquote>

<p>Sounds familiar, doesn't it? </p>

<p>(It's not the whole story. As I've mentioned above, all browsers use DOCTYPE to switch between parsing modes. <a href="http://www.quirksmode.org/css/quirksmode.html">Quirks mode</a> is triggered by a line in the <abbr>HTML</abbr>, but it doesn't alter <abbr>HTML</abbr> parsing — it switches <abbr>CSS</abbr> parsing between <abbr>IE</abbr>5's broken box model or the W3C box model. Internet Explorer also has its <a href="http://blogs.msdn.com/b/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx">compatibility mode</a> which allows <abbr>IE</abbr> to mimic old, buggy versions. Note that these are switches to trigger buggy implementations; they are <em>not</em> switches between implementations of different versions of <abbr>CSS</abbr> or <abbr>HTML</abbr>. I may be splitting semantic hairs here.)</p>

<p>So <abbr>HTML</abbr> versioning will be the same as <abbr>CSS</abbr> versioning. With <abbr>CSS</abbr>, as it's only styling and not content or functionality, it doesn't matter much if something fails silently. With <abbr>HTML</abbr>5, we don't have vendor prefixes like <abbr>CSS</abbr> does, but most (<a href="https://github.com/Modernizr/Modernizr/wiki/Undetectables">if not all</a>) new features can be feature-detected and <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">poly-filled with JavaScript</a>. It might not be beautiful, but it's the way of the world, and version numbers won't change that.</p>

<p>Ultimately, the presence or absence of a version number is less important than the fact that we have a spec that extends <abbr>HTML</abbr> without breaking backwards compatibility. That's what I celebrate in my Geek Song <a href="http://www.brucelawson.co.uk/2011/living-standard/">Living Standard</a>.</p>

<h2>Versioning isn't for browsers. It's for authors. (By John Foliot)</h2>
<p>The main issue, as I see it, is that W3C Standards ("Recommendations" in their parlance) are not "snapshots". They're engravings, which implies a whole other level of stability and commitment. Engravings, for example, are used to print our paper currency.</p>

<p>The last standardized commit to <abbr>HTML</abbr> was over a decade ago with <abbr>HTML</abbr> 4.01 (Dec., 1999) (and/or the <abbr>XML</abbr> serialization of <abbr>XHTML</abbr> in January 2000, revised 1 August 2002), and <abbr>HTML</abbr>5 (the markup language), once finalized, will likely continue to be the benchmark a decade from now. While most would concede that <abbr>HTML</abbr> 4.01/<abbr>XHTML</abbr> 1.1 are somewhat dated today, you could (if you wanted) continue to build a site using <code>&lt;frames&gt;</code>, and it would work, and all user agents would know what to do with that code. Team members could work on that code in a shared environment, using different types of editing tools (including <abbr>WYSIWYG</abbr> tools). That work could span cultures and geographies as the specification has been translated into numerous world languages and teaching curricula. It is that kind of permanence and stability that comes with an actual Standard.</p>

<p>Just look at <code>&lt;hgroup&gt;</code>. Where are we with that today? Next week? April 2011? Who knows? (I sort of know. There's a bug filed, and it will likely be escalated to an actual issue in the Last Call process. <code>&lt;hgroup&gt;</code>'s future is under debate at this time, but with no firm timeline. The point is, you need to be on top of this stuff continuously, a task that many larger groups simply do not have the time or resources to do.) Then there is the accessibility of <code>&lt;canvas&gt;</code> and <code>&lt;video&gt;</code> — points I don't need to belabor, but issues that remain non-trivial today. Much of the current new "goodness" in the Draft <abbr>HTML</abbr>5 Specification has <a href="http://www.html5accessibility.com/">very little browser support</a>. Look at the lack of complete support for Web Forms or many of the other newly introduced elements. It's gotten so bad that some of the less-informed think that the solution today is that all of the browsers should just move to WebKit and the problems will be solved — a suggestion so far-removed from any kind of reality as to be laughable. The answer is not to move to one rendering engine for stability, but rather for all to agree on one firm specification that works across all browsers.</p>

<p>My larger objection is around perception of the spec: developers who think that just because it's spec'ed at <abbr>WHATWG</abbr> this week that it's good to go, bring it on, to heck with permanence and legacy! It's a continued "fix-it-in-the-mix" attitude far-removed from the real world of large corporations and government. In the contest to be cool and cutting-edge, some developers forget that there is a world of commerce and actual Just-Like-Mom users out there who think that the latest advancement of the internet is Farmville on their cell phone.</p>

<p>I think the recent release of Drupal 7 is a great example. After nearly three years of intense community collaboration by nearly a thousand contributors, the latest version of this high-profile Open Source <abbr>CMS</abbr> was launched simultaneously with numerous plug-in modules re-factored for this next-generation build. Standards conformance was a huge driver for this version (as was accessibility support), so this large group of developers required an extremely stable benchmark to work towards. They couldn't rely on spec that changes monthly. Nobody wants to go back and re-write code they shipped four months ago simply because the current Draft Specification has changed the way things are done. Thus, the bulk of Drupal 7 sites I've seen to date (including those with custom themes) proudly sport the following under the hood:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"></code></pre>

<p><abbr>WHATWG</abbr> serves a useful function, no doubt. Like the Fashion Houses of Paris, New York and London, they create and explore and push the boundaries. But they also often remain far-removed from the world of <a href="http://www.clothingattesco.com/women/icat/catgwomens/">F&amp;F Clothing</a> at Tesco — Tesco by the way being an "<a href="http://www.londonfashionweek.co.uk/sponsors.aspx">Official Sponsor of London Fashion Week</a>". I truly believe that the web community needs to be reminded of this fact. An evolving spec serves the needs of browser vendors, but it is no friend to many commercial developers as it hurts larger entities who need to share authoring responsibilities.</p>

<p>Like that paper currency made from those engravings, I want to be sure I can take it to the bank.</p>

<h3>About John Foliot:</h3>
<p><a href="http://john.foliot.ca">John Foliot</a> is a Web Accessibility Specialist with over a decade of experience in that field. He manages the Online Accessibility Program at Stanford University, and is a co-chair of the W3C's <abbr>HTML</abbr>5 Accessibility Task Force, where he is focused on accessibility of the new media elements. When not ranting on the web about web accessibility and web standards, he enjoys riding his motorcycle, listening to and collecting Blues music, and sampling fine Single Malts with fellow geek friends. You can follow him on twitter at <a href="http://www.twitter.com/johnfoliot">@johnfoliot</a>.</p>

<h2>In summary</h2>
<p>We've given two opposing views on this matter, and now we want to hear your thoughts. Are you for or against a living <abbr>HTML</abbr> standard?</p>
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/html5-for-web-developers/" rel="bookmark" class="crp_title">HTML5 for Web Developers</a></li><li><a href="http://html5doctor.com/absent-elements-and-validation/" rel="bookmark" class="crp_title">Absent Elements and Validation</a></li><li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li><li><a href="http://html5doctor.com/html5-briefing-notes-journalists-analysts/" rel="bookmark" class="crp_title">HTML5: briefing notes for journalists and analysts</a></li><li><a href="http://html5doctor.com/your-questions-13/" rel="bookmark" class="crp_title">Your Questions #13</a></li></ul></div><p><a href="http://html5doctor.com/html5-living-standard/" rel="bookmark">HTML as a Living Standard — For and Against</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on February 8, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-living-standard/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Review: HTML5 Designing Rich Internet Applications</title>
		<link>http://html5doctor.com/review-html5-designing-rich-internet-applications/</link>
		<comments>http://html5doctor.com/review-html5-designing-rich-internet-applications/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 14:30:06 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2881</guid>
		<description><![CDATA[<p>HTML5: Designing Rich Internet Applications by Matthew David (Focal Press). I'll be honest and up front, this is a pretty negative review. I've been sitting on it for months, but decided to post it as people have asked our opinion of this book.</p>]]></description>
			<content:encoded><![CDATA[<p>HTML5: Designing Rich Internet Applications by Matthew David (Focal Press)</p>
<p>I&#8217;ll be honest and up-front: this is a pretty negative review. I&#8217;ve been sitting on it for months, but decided to post it as people have asked our opinion of this book.</p>
<figure>
<img src="http://html5doctor.com/wp-content/uploads/2011/01/html5_matthew_david.jpg" alt="HTML5: Designing Rich Internet Applications by Matthew David">
<figcaption>Figure 1: Cover of HTML5 Designing Rich Internet Applications by Matthew David</figcaption>
</figure>
<p>Firstly, it&#8217;s true that all books have errors. As well as typos, there are authoring brain-farts (the book I co-wrote with Remy claims there is a &lt;heading&gt; element, for example). There is also the risk, when writing on a moving target like HTML5, that the spec will change after the book has gone to press.</p>

<section>
<h2>About the book</h2>
<p>Four of us doctors have read this book (figure 1) and in our opinion it contains an unacceptable number of errors which makes it misleading to the reader.</p>
<ul>
<li>The preface claims &quot;a group called the Web Standards project began developing HTML5 in 2007&quot;. It didn&#8217;t; it was the <a href="http://whatwg.org/">WHATWG</a>, in 2004.</li>
<li>In &quot;spring 2010 .. Microsoft formerly [sic] joined the HTML5 Working Group&quot;. Chris Wilson, then lead of Internet Explorer, was co-chair in 2006.</li>
<li>Page 11 mentions the &lt;m&gt; element. There isn&#8217;t one; it was renamed to the &lt;mark&gt; element (as it&#8217;s correctly called on page 22) <a href="http://www.w3.org/TR/html5-pubnotes/">before June 2008</a>, at least 2 years before  this book was published July 2010.</li>
<li>Page 19 discusses the &lt;dialog&gt; element, which was removed from the spec in September 2009. </li>
<li>Page 27 tells us &quot;The W3C had already begun modernizing the FORM element, called Forms 2.0, before HTML5&quot;. The WHATWG started with Webforms 2; the W3C had worked on XForms 1.0.</li>
<li>There is a &lt;navigation&gt; element used extensively in the chapter &quot;Building a web site using HTML5 blocking elements&quot; — this should be the <code>&lt;nav&gt;</code> element.</li>

<li>Page 72 tells us &#8220;The ANCHOR element has four pseudo classes: link, active, hover and visited&#8221;, omitting the <code>focus</code> pseudo-class which is vital for accessibility, as it is applied when a user navigates to a link using the keyboard rather than hovering with a mouse.</li> 
<li>Page 73 says &#8220;New to CSS3 is a new extension called pseudo elements&#8221;. Pseudo-elements were there from <a href="http://www.w3.org/TR/REC-CSS1/#pseudo-classes-and-pseudo-elements">CSS 1</a>.</li>
</ul>

<p>The book also promotes several examples of bad coding practices:</p>

<ul><li><code>&lt;br/&gt;&lt;br/&gt;</code> pairs to force new lines</li>
<li>classitis (<code>&lt;footer class="footerStyle"&gt;</code>)</li>
<li>form <code>&lt;label&gt;</code>s are not accessibly associated with their <code>&lt;input&gt;</code>s</li><li>not using the full vendor-prefix stack (-moz-, -ms- , -o-, -webkit-, [no prefix]) resulting in code that is neither <a href="http://www.brucelawson.co.uk/2010/cross-browser-future-proof-css-3/">future-proof nor cross-browser</a></li> 
<li>bad semantics, for example <code>&lt;p class=mainTitleStyle&gt;</code> rather than using  an HTML heading</li>
</ul>
<p>The author&#8217;s website is <a href="http://matthewdavid.ws/">http://matthewdavid.ws</a>.</p>
</section>

<section>
<h2>What I do recommend</h2>
<p>So I can&#8217;t recommend this book. I can, however, recommend any of the following resources:</p>
<ul>
<li><a href="http://books.alistapart.com/products/html5-for-web-designers">Jeremy Keith&#8217;s <cite>HTML5 For Web Designers</cite></a> is a brief overview for designers or IT director types</li>
<li><a href="http://diveinto.html5doctor.com/"><cite>Dive into HTML5</cite> by Mark Pilgim</a></li>
<li><a href="http://apress.com/book/view/1430227907"><cite>Professional HTML5 Programming</cite> by Peter Lubbers <i lang=la>et al</i></a> is a really good look at the APIs</li>
<li><a href="http://apress.com/book/view/1430230908"><cite>Definitive Guide to HTML5 Video</cite> by Silvia Pfeiffer</a></li>
<li><a href="http://www.peachpit.com/promotions/promotion.aspx?promo=137880">Tantek &Ccedil;elik&#8217;s <cite>HTML5 Now</cite></a> is a good video tutorial.</li>
</ul>
</section>

<p>Have you read this book? What did you think of it? Let us know in the comments.</p>

<p><small>Reviewed by Bruce Lawson, Richard Clark, Oli Studholme and Tom Leadbetter.</small></p>
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/reviewing-html5-for-web-designers/" rel="bookmark" class="crp_title">Reviewing HTML5 for Web Designers</a></li><li><a href="http://html5doctor.com/css3-pseudo-classes-and-html5-forms/" rel="bookmark" class="crp_title">CSS3 Pseudo-Classes and HTML5 Forms</a></li><li><a href="http://html5doctor.com/dive-into-html5-doctor/" rel="bookmark" class="crp_title">Dive into HTML5… on HTML5 Doctor</a></li><li><a href="http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/" rel="bookmark" class="crp_title">HTML5 Simplequiz 5: URLs of commenters</a></li><li><a href="http://html5doctor.com/block-level-links-in-html-5/" rel="bookmark" class="crp_title">&#8220;Block-level&#8221; links in HTML5</a></li></ul></div><p><a href="http://html5doctor.com/review-html5-designing-rich-internet-applications/" rel="bookmark">Review: HTML5 Designing Rich Internet Applications</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on January 28, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/review-html5-designing-rich-internet-applications/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Two cheers for the W3C&#8217;s HTML5 logo</title>
		<link>http://html5doctor.com/two-cheers-for-the-w3cs-html5-logo/</link>
		<comments>http://html5doctor.com/two-cheers-for-the-w3cs-html5-logo/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 14:30:41 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Comment]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2937</guid>
		<description><![CDATA[We Doctors like the proposed HTML5 logo from the W3C; it's down there, glistening in our footer. But we think that the definition of HTML5 that the W3C offers is too broad to be useful.]]></description>
			<content:encoded><![CDATA[<p>We Doctors like the proposed HTML5 logo from the W3C; it&#8217;s down there, glistening in our footer. But we think that the definition of HTML5 that the W3C offers is too broad to be useful:</p>
<blockquote><p>The logo is a general-purpose visual identity for a broad set of open web technologies, including HTML5, CSS, SVG, WOFF, and others.</p>
<footer><cite><a href="http://www.w3.org/html/logo/faq#mean">What does this logo mean?</a></cite></footer>
</blockquote>
<p><img src="http://html5doctor.com/wp-content/uploads/2011/01/HTML5_Logo_256.png" alt="W3C HTML5 Logo" style="float:right;" />We&#8217;re pretty much at ease with lumping specs that aren&#8217;t strictly HTML5 in to the buzzword. For example, Web Workers or Web Sockets were developed by the same people that specced HTML5 and, like many aspects of HTML5, are simple APIs that developers are adopting to facilitate development of Web Applications using Open Web technologies. Geolocation was nothing to do with the WHATWG but, because it&#8217;s a modern, simple, useful API, it&#8217;s philosophically satisfying to call it &#8220;HTML5&#8243;, although inaccurate.</p>
<p>But lumping technologies like CSS 3, WOFF (simply a font format) or SVG is too much jargon-creep. HTML is about semantics and structuring <em>data</em>, not about styling, fonts or graphics. It&#8217;s not just about purity of jargon—this stuff <em>matters</em>. The 2001-era memo about separation of content, style and behaviour is even more important now that &#8220;HTML5&#8243;/ real-HTML5 / HTML gives us so much more power. While we understand that clients and technical journalists will use &#8220;HTML5&#8243; as a buzzword, the W3C as the official standards body should be promoting clarity, not blurring the distinctions.</p>
<p>There is also the danger that other Open Standards might suffer from being excluded from the &#8220;HTML5&#8243; buzzword—for example, <a href="http://www.w3.org/TR/widgets/">W3C Widgets</a>, which <a href="http://www.quirksmode.org/blog/archives/2010/03/html5_apps.html">PPK has already suggested</a> we refer to as &#8220;HTML5 apps&#8221; because of this not-&#8221;HTML5&#8243; exclusion principle.</p>
<h2>What can be done?</h2>
<p>It&#8217;s not done until it&#8217;s done; the W3C says</p>
<blockquote><p>W3C introduced this logo in January 2011 with the goal of building community support. W3C has not yet taken it up in any official capacity.</p>
<footer><cite><a href="http://www.w3.org/html/logo/faq#official">Is this W3C&#8217;s &#8220;official&#8221; logo for HTML5?</a></cite></footer>
</blockquote>
<p>Quite rightly, the W3C has opened it up for debate. We suggest that the W3C rethink slightly, and have separate-but-related logos. For example, the current logo can represent markup and APIs that we accept may be legitimately referred to as &#8220;HTML5&#8243;, another logo for graphics &#8211; for example, SVG, and  a third logo for styling that brings together CSS, WOFF and the like. (We note in passing that using a &#8220;3&#8243; to represent CSS will quickly date when work on CSS 4 begins.)</p>
<p>They should be collectively referred to by some name like the &#8220;Open Web&#8221;, which should be the  umbrella brand, because it remains as important as ever to set Open technologies apart from proprietary tech. We applaud the W3C&#8217;s move to brand Open tech and raise awareness of it amongst developers and the wider tech world.</p>
<p>This is just a strawman taxonomy to get people thinking. Have you got any better ideas?</p>
<p>Note, we haven’t addressed <a title="HTML is the new HTML5" href="http://blog.whatwg.org/html-is-the-new-html5">WHATWG’s recent change to using the name “HTML”</a>. This is something that has been in the works for a long time, and better represents WHATWG’s actual process (and the process of implementers). We’ll cover this in a future post…</p>
<h2>Addendum</h2>
<p>Added just a few hours later:</p>
<p>The W3C have half-done the right thing by adding this clarification: </p>
<blockquote><p> Is W3C saying that CSS3 is part of the HTML5 specification?<br />
No. However, many HTML5 Web sites and applications do take advantage of CSS3 for styling and presentation.</p>
<footer><cite><a href="http://www.w3.org/html/logo/faq.html#css3">Is W3C saying that CSS3 is part of the HTML5 specification?</a></cite></footer>
</blockquote>
<p>But the CSS &#8220;styling&#8221; logo is still in the badge builder and the icon sets. It should be removed. </p>
<p>So two cheers for the clarification. Let&#8217;s see some commitment to complete clarity.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/net-awards-nomination/" rel="bookmark" class="crp_title">.net Awards Nomination</a></li>
<li><a href="http://html5doctor.com/web-directions-atmedia-2010/" rel="bookmark" class="crp_title">HTML5 Doctor at Web Directions @media</a></li>
<li><a href="http://html5doctor.com/avoiding-common-html5-mistakes/" rel="bookmark" class="crp_title">Avoiding common HTML5 mistakes</a></li>
<li><a href="http://html5doctor.com/html5-briefing-notes-journalists-analysts/" rel="bookmark" class="crp_title">HTML5: briefing notes for journalists and analysts</a></li>
<li><a href="http://html5doctor.com/using-modernizr-to-detect-html5-features-and-provide-fallbacks/" rel="bookmark" class="crp_title">Using Modernizr to detect HTML5 features and provide fallbacks</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/two-cheers-for-the-w3cs-html5-logo/" rel="bookmark">Two cheers for the W3C&#8217;s HTML5 logo</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on January 21, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/two-cheers-for-the-w3cs-html5-logo/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>HTML5 and Search Engine Optimisation (SEO)</title>
		<link>http://html5doctor.com/html5-seo-search-engine-optimisation/</link>
		<comments>http://html5doctor.com/html5-seo-search-engine-optimisation/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 14:30:58 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2821</guid>
		<description><![CDATA[<p>Through our handy Ask The Doctor service, we get a lot of e-mails asking us about <abbr>HTML</abbr>5's effect on Search Engine Optimisation (SEO). While we can't answer in great detail (Messrs Google, Yahoo, Bing, and their friends haven't sent us in-depth details of their algorithms), we've rounded up some useful facts from Google, the world's most dominant search engine.</p>]]></description>
			<content:encoded><![CDATA[<p>Through our handy <a href="http://html5doctor.com/ask-the-doctor/">Ask The Doctor</a> service, we get a lot of e-mails asking us about <abbr>HTML</abbr>5&#8242;s effect on Search Engine Optimisation (SEO). While we can&#8217;t answer in great detail (Messrs Google, Yahoo, Bing, and their friends haven&#8217;t sent us in-depth details of their algorithms), we&#8217;ve rounded up some useful facts from Google, the world&#8217;s most dominant search engine.</p>
<p>At the moment, <a href="http://googlewebmastercentral.blogspot.com/2010/03/microdata-support-for-rich-snippets.html">Google indexes HTML5 microdata</a> (<a href="/microdata/">more about microdata</a>) but does not reward you for using the new <abbr>HTML</abbr>5 structural elements, but neither does it penalise you:</p>
<blockquote cite="http://www.google.com/support/forum/p/Webmasters/thread?tid=2d4592cbb613e42c&amp;hl=en">
<p>As <abbr>HTML</abbr>5 gains in popularity and as we recognize specific markup elements that provide value to our indexing system, this is likely to change, but at the moment I would not assume that you would have an advantage by using <abbr>HTML</abbr>5 instead of older variants&hellip;.</p>
<p>Personally, I would recommend using <abbr>HTML</abbr>5 where you think that it already makes sense, perhaps reverting to <abbr>HTML</abbr>4 if you can determine that the browser won&#8217;t support the elements of <abbr>HTML</abbr>5 that you use properly. While this will not result in an advantage for your content in our search results, it generally wouldn&#8217;t be disadvantageous either.</p>
<footer><cite><a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=2d4592cbb613e42c&amp;hl=en">Google Webmaster Central: Does semantic html5 matter to google yet</a></cite></footer>
</blockquote>
<p><img src="http://html5doctor.com/wp-content/uploads/2011/01/search-engine-logos.jpg" alt="Logo's for Google, Yahoo and Bing" /></p>
<p>But they will take account of <abbr>HTML</abbr>5 once it becomes widespread, and they seem to be encouraging experimentation:</p>
<blockquote cite="http://www.google.com/support/forum/p/Webmasters/thread?tid=1d3850aec4e3dd96&amp;hl=en">
<p>Our general strategy is to wait to see how content is marked up on the web in practice and to adapt to that. If we find that more and more content uses <abbr>HTML</abbr>5 markup, that this markup can give us additional information, and that it doesn&#8217;t cause problems if webmasters incorrectly use it (which is always a problem in the beginning), then over time we&#8217;ll attempt to work that into our algorithms&hellip;.</p>
<p><abbr>HTML</abbr>5 is still very much a work in progress, so it&#8217;s great to see bleeding-edge sites making use of the new possibilities :)</p>
<footer><cite><a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=1d3850aec4e3dd96&amp;hl=en">Google Webmaster Central: How well does Googlebot deal with non-standard tags?</a></cite></footer>
</blockquote>
<p>The Doctors&#8217; advice on <abbr>SEO</abbr> is to follow Google&#8217;s time-honoured guidelines: <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=100782">write valid, cross-browser, accessible <abbr>HTML</abbr></a>, <a href="http://www.youtube.com/watch?v=GIn5qJKU8VM">don&#8217;t misuse markup or &#8220;cloak&#8221; with <abbr>CSS</abbr></a>, make a site with a clear hierarchy and text links, and <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">write good content</a>:</p>
<blockquote cite="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">
<p>Create a useful, information-rich site, and write pages that clearly and accurately describe your content.</p>
<footer><cite><a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">Google Webmaster Guidelines: Design and content guidelines</a></cite></footer>
</blockquote>
<p>Happy New Year. May your hat remain white.</p>
<h2>HTML5 microdata and schema.org</h2>
<p>Added October 2011:</p>
<p><a href="http://schema.org/">Schema.org</a> is a consortium of Bing, Google and Yahoo!. On its website it says</p>
<blockquote><p>[schema.org] provides a collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers. Search engines including Bing, Google and Yahoo! rely on this markup to improve the display of search results</p></blockquote>
<p>schema.org uses <a href="/microdata/">HTML5 microdata</a> with new elements like <a href="/the-time-element/"><code>&lt;time&gt;</code></a>. So, yes: in this special case (using these markup patterns) will ensure that this HTML5 will assist search engines to categorise your content (which is not the same as guaranteeing a higher ranking, of course).</p>
<h2>Multiple &lt;h1&gt;s on a page</h2>
<p>The new <a href="/outlines/">HTML5 outlining algorithm</a> allows multiple &lt;h1&gt;s in a page. We get lots of questions about whether developers will be penalised by Google which, according to myth, disallowed this.</p>
<p>I say &#8220;myth&#8221; because Google has always allowed multiple &lt;h1&gt;s on a page, provided that it&#8217;s organic rather than trying to game the system, as this video shows:</p>
<p><iframe width="400" height="233" src="http://www.youtube.com/embed/GIn5qJKU8VM?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>However, don&#8217;t go too crazy with the &lt;h1&gt;-only approach as it removes any hierarchy from your pages in browsers that don&#8217;t implement the outline algorithm and screenreaders that sit on top of them.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/the-nsfw-element/" rel="bookmark" class="crp_title">The nsfw element</a></li>
<li><a href="http://html5doctor.com/microdata/" rel="bookmark" class="crp_title">Extending HTML5 — Microdata</a></li>
<li><a href="http://html5doctor.com/time-and-data-element/" rel="bookmark" class="crp_title">Goodbye time, datetime, and pubdate. Hello data and value.</a></li>
<li><a href="http://html5doctor.com/outlines/" rel="bookmark" class="crp_title">Document Outlines</a></li>
<li><a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/" rel="bookmark" class="crp_title">YouTube and Vimeo support HTML5 Video</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/html5-seo-search-engine-optimisation/" rel="bookmark">HTML5 and Search Engine Optimisation (SEO)</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on January 11, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-seo-search-engine-optimisation/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz 5: URLs of commenters</title>
		<link>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/</link>
		<comments>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 14:30:57 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2741</guid>
		<description><![CDATA[<p>Here's nice and simple Simplquiz for Christmas. Imagine a new site, with  a news item in an <code>&#60;article&#62;</code> element. Within that are several user-submitted comments, each of which is in its own <code>&#60;article&#62;</code> element, as the spec recommends. Most commenting systems ask the commenter for his/ her URL, which is published in the header of the comment, usually as a link with the commenter's name as the linked text.</p>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s nice and simple Simplquiz for Christmas. Imagine a new site, with  a news item in an <code>&lt;article&gt;</code> element. Within that are several user-submitted comments, each of which is in its own <code>&lt;article&gt;</code> element, as the spec recommends. Most commenting systems ask the commenter for his/ her URL, which is published <del>in the header</del> <ins>at the beginning</ins> of the comment, usually as a link with the commenter&#8217;s name as the linked text.</p>

<p>How would you code the URL of a person leaving a comment (assuming they provided one)? Remember that there may be multiple comments on any one page. Also note that we’re not going to worry about what element wraps each comment this time. Choose from the five options below, and explain your rationale in the comments.</p>

<h2>A:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo/&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>B:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;cite&gt;&lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;&lt;/cite&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>C:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;&lt;cite&gt;Tim 
Berners-Lee&lt;/cite&gt;&lt;/a&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>D:</h2>
<pre><code>&lt;footer&gt;
Comment by &lt;address&gt;&lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;&lt;/address&gt;
&lt;/footer&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>E:</h2>
<pre><code>&lt;h1&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;&lt;address&gt;Tim 
Berners-Lee&lt;/address&gt;&lt;/a&gt;
&lt;/h1&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<p>Your answers below, please, and show your working out. We&#8217;ll close comments and give our opinions on Wednesday 22 December.</p>
<p>Rules: It is THE LAW that you read the preceding comments before adding your own. 
<strong>Note: please DON&#8217;T USE ANGLE BRACKETS in your comments. Escape them with &amp;lt; and &amp;gt; or just use [foo] – we&#8217;ll know what you mean.</strong>
</p><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</a></li><li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li><li><a href="http://html5doctor.com/block-level-links-in-html-5/" rel="bookmark" class="crp_title">&#8220;Block-level&#8221; links in HTML5</a></li><li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li><li><a href="http://html5doctor.com/the-time-element/" rel="bookmark" class="crp_title">The time element (and microformats)</a></li></ul></div><p><a href="http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/" rel="bookmark">HTML5 Simplequiz 5: URLs of commenters</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on December 17, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
	</channel>
</rss>

