<?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>Bruce Lawson's  personal site &#187; HTML5</title>
	<atom:link href="http://www.brucelawson.co.uk/category/accessibility-web-standards/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brucelawson.co.uk</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 10:12:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The best of &lt;time&gt;s</title>
		<link>http://www.brucelawson.co.uk/2012/best-of-time/</link>
		<comments>http://www.brucelawson.co.uk/2012/best-of-time/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 17:36:00 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=4127</guid>
		<description><![CDATA[Avid HTML5 watchers will know that the &#60;time&#62; element was dropped from HTML, then re-instated, with more New! Improved! semantics. As before, you can put anything you like between the opening and closing tags &#8211; that&#8217;s the human-readable bit. The machine-readable bit is contained within a datetime attribute. Dates are expressed YYYY-MM-DD. Previously, you could [...]]]></description>
			<content:encoded><![CDATA[<p>Avid HTML5 watchers will know that the <code>&lt;time&gt;</code> element was <a href="http://www.brucelawson.co.uk/2011/goodbye-html5-time-hello-data/">dropped</a> from HTML, then <a href="http://www.brucelawson.co.uk/2011/the-return-of-time/">re-instated</a>, with more New! Improved! semantics.</p>
<p>As before, you can put anything you like between the opening and closing tags &#8211; that&#8217;s the human-readable bit. The machine-readable bit is contained within a <code>datetime</code> attribute. Dates are expressed YYYY-MM-DD.</p>
<p>Previously, you could only mark up precise dates. So, 13 November 1905 could be expressed in HTML <code>&lt;time datetime="1905-11-13"></code> but November 1905 couldn&#8217;t be. This is a problem for historians where sometimes the precise date isn&#8217;t known.</p>
<p>Now, &#8220;fuzzy dates&#8221; are possible:</p>
<ul>
<li><code>&lt;time datetime="1905"&gt;</code> means the year 1905</li>
<li><code>&lt;time datetime="1905-11"&gt;</code> means November 1905</li>
<li><code>&lt;time datetime="11-13"&gt;</code> means 13 November (any year)</li>
<li><code>&lt;time datetime="1905-W21"&gt;</code> means week 21 of 1905</li>
</ul>
<p>As before, times are expressed using the 24 hour clock. Now, you can separate the date and time with a space rather than a &#8220;T&#8221; (but you don&#8217;t have to). So both of these are valid:</p>
<ul>
<li><code>&lt;time datetime="1905-11-13T09:00"&gt;</code></li>
<li><code>&lt;time datetime="1905-11-13 09:00"&gt;</code></li>
</ul>
<p>You can localise times, as before. Appending &#8220;Z&#8221; to the timezone indicates UTC (a way of saying &#8220;GMT&#8221; without it being comprehensible to normal people). Otherwise, use an offset:</p>
<ul>
<li><code>&lt;datetime="09:00Z"&gt;</code> is 9am, UTC.</li>
<li><code>&lt;datetime="09:00-05"&gt;</code> is 9am in the timezone 5 hours behind UTC.</li>
<li><code>&lt;datetime="09:00+05:45"&gt;</code> is 9am in <a href="http://en.wikipedia.org/wiki/Nepal_Time">Nepal</a>, which is UTC + 5 hours and 45 minutes.</li>
</ul>
<h3>Durations</h3>
<p>In New! Improved! HTML5 &lt;time&gt;, you can represent durations, with the prefix &#8220;P&#8221; for &#8220;period&#8221;. This uses &#8220;W&#8221; (or &#8220;w&#8221;) for weeks, &#8220;D&#8221; for days, &#8220;H&#8221; for hours, &#8220;M&#8221; for minutes and &#8220;XQ&#8221; for seconds. Just kidding &#8211; that&#8217;s &#8220;S&#8221;. </p>
<p>You can separate them with spaces (but you don&#8217;t have to). So <code>&lt;time datetime="P4W3D5H"&gt;</code> is a duration of 4 weeks, 3 days and 5 hours, as is <code>&lt;time datetime="P4W 3D 5H"&gt;</code>. A duration of 3 hours, 2 minutes and 23.005 seconds is <code>&lt;time datetime="P3H2M23.005S"&gt;</code> or <code>&lt;time datetime="P3H 2M 23.005S"&gt;</code>.</p>
<p>This can be boiled down by a machine to a precise number of seconds. Because of this, you can&#8217;t specify a duration in terms of months, because a month isn&#8217;t a precise number of seconds; a month can last from 28 to 31 days. Similarly, a year isn&#8217;t a precise number of seconds; it&#8217;s 12 months and February sometimes has an extra day.</p>
<p>You still can&#8217;t represent dates before the Christian era, as years can&#8217;t be negative.</p>
<h3>pubdate</h3>
<p>The pubdate attribute (a boolean that indicates that this particular date is the publication date of the parent &lt;article&gt; (or, if there is none, the whole document) is currently missing from the W3C version of the spec, but is still current in the WHATWG version. Its status is unclear to me (but I&#8217;m still using it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2012/best-of-time/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Beware Tim Berners-Lee&#8217;s elite squad of standards-avenging attack ninjas</title>
		<link>http://www.brucelawson.co.uk/2012/beware-tim-berners-lees-elite-squad-of-standards-avenging-attack-ninjas/</link>
		<comments>http://www.brucelawson.co.uk/2012/beware-tim-berners-lees-elite-squad-of-standards-avenging-attack-ninjas/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:33:16 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=4111</guid>
		<description><![CDATA[It&#8217;s been whispered about for some time, but only now can the truth be revealed. The Large Hadron Collider at CERN was built in order to produce enough Higgs Bosons to turn ordinary ninjas into an elite squad of standards-avenging attack ninjas under the sole command of Sir Tim Berners-Lee, previously from CERN (co-incidence? I [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been whispered about for some time, but only now can the truth be revealed. The <a href="http://en.wikipedia.org/wiki/Large_Hadron_Collider">Large Hadron Collider</a> at <a href="http://en.wikipedia.org/wiki/CERN">CERN</a> was built in order to produce enough Higgs Bosons to turn ordinary ninjas into an elite squad of standards-avenging attack  ninjas under the sole command of Sir Tim Berners-Lee, previously from CERN (co-incidence? I think not!).</p>
<p>Unnamed sources tell me that, as the Mayans nearly predicted, 2012 will be the year when <a href="http://www.brucelawson.co.uk/2012/vendor-prefixes-mobile-monoculture/">misusing vendor prefixes</a> will no longer be tolerated and manufacturers <a href="http://www.pigsgourdsandwikis.com/2012/01/media-queries-for-formatting-poetry-on.html">bastardising CSS Media Queries</a> to do UA-sniffing will not go unnoticed.</p>
<p>Don&#8217;t believe me? Here is an artist&#8217;s impression of an actual photo of Tim Berners-Lee summoning his standards-avenging attack ninjas. </p>
<p><img src="http://farm8.staticflickr.com/7172/6760369451_db38f5d91b.jpg"  alt="Cartoon Ninja using a computer with W3C logo on lid. Japanese text." /></p>
<p>Tremble, proprietary-lovin&#8217; developers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2012/beware-tim-berners-lees-elite-squad-of-standards-avenging-attack-ninjas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reading List</title>
		<link>http://www.brucelawson.co.uk/2011/reading-list-10/</link>
		<comments>http://www.brucelawson.co.uk/2011/reading-list-10/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 16:34:23 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[reading list]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=3977</guid>
		<description><![CDATA[The last reading list of the year is a bumper one, so you have plenty to read over the hols. Enjoy! Me I&#8217;m interviewed on the Sitepoint podcast. Opera&#8217;s TV emulator is released, so you can check your HTML5 and CE-HTML apps HTML App manifests, an anthology &#8211; on thge multiple manifest formats that attempt [...]]]></description>
			<content:encoded><![CDATA[<p>The last reading list of the year is a bumper one, so you have plenty to read over the hols. Enjoy!</p>
<h3>Me</h3>
<ul>
<li>I&#8217;m interviewed on the <a href="http://www.sitepoint.com/podcast-143-happy-html5-holidays-with-bruce-lawson/">Sitepoint podcast.</a></li>
<li>Opera&#8217;s <a href="http://www.opera.com/business/tv/emulator/ ">TV emulator</a> is released, so you can check your HTML5 and CE-HTML apps</li>
</ul>
<h3>HTML</h3>
<ul>
<li><a href="http://blog.tobie.me/post/14262541286/app-manifests-an-anthology">App manifests, an anthology</a> &#8211; on thge multiple manifest formats that attempt to lock in users. (Similar to my June post <a href="/2011/installable-web-apps-and-interoperability/">Installable web apps and interoperability</a>.)</li>
<li><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15278">Adding Islamic calendar support in HTML5</a> &#8211; a request from IBM to add new types of HTML &lt;input&gt; to cater for the three Islamic calendars. I agree with Lars and Lachlans&#8217; comments that this is a browser  enhancement and not an addition to the language.</li>
<li><a href="http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html">Shadow dom spec (very draft</a>)</li>
</ul>
<h3>CSS</h3>
<ul>
<li><a href="http://blog.millermedeiros.com/2011/11/the-problem-with-css-pre-processors/">CSS pre-processors and why you need to be careful with them</a>.</li>
<li>
  <a href="http://daneden.me/2011/12/putting-up-with-androids-bullshit/">Dispelling the Android CSS animation myths</a> &#8211; Feature detection only works if browsers tell the truth.</li>
</ul>
<h3>JavaScript</h3>
<ul>
<li><a href="https://lists.webkit.org/pipermail/webkit-dev/2011-December/018903.html">EcmaScript 6 versioning</a>. Dutch Specmeister <a href="https://plus.google.com/112284435661490019880/posts/6W7ErmRC1XN ">Anne van Kesteren writes</a> &#8220;this still strikes me as a slippery slope towards the mess Internet Explorer is dealing with (and Word has in the past). Not very webby, ECMAScript&#8221;</li>
<li>
<a href="https://github.com/addyosmani/backbone-fundamentals">Backbone.js mini-book</a> by Addy Osmani, who says &quot;any contributions welcome. Plan to keep adding more everyday&quot;.</li>
</ul>
<h3>Multimedia</h3>
<ul>
<li>
<a href="http://dev.w3.org/html5/canvas-extensions/Overview.html">HTML Canvas 2D Context Extensions</a>, draft spec  to add accessibility features  for caret and selection management, for setting the caret blink rate, for returning the vertical offset of a text anchor point, and for drawing a focus ring around the current path. Also see a change proposal <a href="http://www.w3.org/html/wg/wiki/ChangeProposals/FocusRingTextBaseline">Modify existing Canvas 2D API to expose text baseline and facilitate drawing of focus rings</a>.</li>
<li><a href="http://www.w3.org/TR/2011/WD-audioproc-20111215/">Two competing  Audio APIs</a>. (I like the <a href="http://www.w3.org/TR/streamproc/">MediaStream Processing API</a> better; <a href="https://plus.google.com/u/0/105458233028934590147/posts/VbkvKumx1YB">Philip Jägenstedt  explains why</a> it&#8217;s better.</li>
<li><a href="https://github.com/atsuya/webcam-test">webcam streaming only using JavaScript</a></li>
<li>An all-you-can eat <a href="http://5by5.tv/webahead/12">historical and technical look at web video</a>. What&#8217;s up with HTML5 and these competing codecs?</li>
<li>
GigaOM reports 80% of video is h.264 and iPad ready without re-encoding. Only 2% is webM. <a href="http://gigaom.com/video/h264-80-percent-of-videos/#comment-779697"><strong>ORLY</strong></a>? The stats don&#8217;t seem to match up.</li>
</ul>
<h3>Data</h3>
<ul>
<li>
I will <a href="http://shancarter.com/data_converter/">convert your Excel data into one of several web-friendly formats</a>, including HTML, JSON and XML.</li>
<li> <a href="http://londoncalling.co/2011/12/when-is-my-bus-due-a-brilliant-use-of-public-data-and-probably-the-best-use-of-mobile-ever/">When is my bus due?</a> Geolocation plus real-tme  open data for a mobile win</li>
<li>Anne van Kesteren&#8217;s latest spec has the ambitious goal to <a href="  http://dvcs.w3.org/hg/encoding/raw-file/tip/Overview.html">unify encoding handling across user agents for the web</a> so   legacy pages can be interpreted &quot;correctly&quot; (<a href="http://mail.apps.ietf.org/ietf/charsets/msg02027.html">background</a>)
</li>
</ul>
<h3>Mobile</h3>
<ul>
<li><a href="http://www.textually.org/textually/archives/2011/12/029968.htm">Mobile health apps provide health access</a> to potentially 18million people in Kenya</li>
</ul>
<h3>Kerrrazy Shit!</h3>
<ul>
<li>
<a href="http://bisforblock.com/">&lt;b&gt; is for Block</a>: &#8220;B means &#8220;block&#8221; and I means &#8220;inline&#8221;.&#8221; So I&#8217;d better update my presentation  <a href="http://www.slideshare.net/brucelawson/leveraging-html-50">Leveraging HTML 5.0: Super-hot HTML 5.0 tag elements to increase your buisness&#8217;es social mindshare</a> accordingly.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2011/reading-list-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reading List</title>
		<link>http://www.brucelawson.co.uk/2011/reading-list-8/</link>
		<comments>http://www.brucelawson.co.uk/2011/reading-list-8/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 16:55:09 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[reading list]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=3939</guid>
		<description><![CDATA[In amongst all the festive rancour, there were a few interesting sites I saw in the last week or so. Notes on Designing Websites for the Asian Market by Yours Truly. MPEG-DASH is the first International Standard for dynamic adaptive streaming of multimedia content over HTTP. It will be interesting to see what the royalty/ [...]]]></description>
			<content:encoded><![CDATA[<p>In amongst all the festive rancour, there were a few interesting sites I saw in the last week or so.</p>
<ul>
<li><a href="http://www.sitepoint.com/notes-on-designing-websites-for-the-asian-market/">Notes on Designing Websites for the Asian Market</a> by Yours Truly.</li>
<li><a href="http://mpeg.chiariglione.org/meetings/geneva11-1/geneva_press.htm">MPEG-DASH</a> is the first International Standard for dynamic adaptive streaming of multimedia content over HTTP. It will be interesting to see what the royalty/ licensing situation will be.</li>
<li>I don&#8217;t agree with everything Faruk says in <a href="http://farukat.es/journal/2011/12/626-threat">The Threat Against the Web</a>, but wholeheartedly applaud &#8220;The web will only thrive as long as the web is not owned by any one entity; not owned, not controlled, and not defined&#8221;.</li>
<li>On the subject of the constantly-embattled Open Web, <a href="https://lists.webkit.org/pipermail/webkit-dev/2011-December/018775.html">Google offered patches</a> to allow their super-whizzo! invented-in-secret Dart language to be in WebKit. <a href="https://lists.webkit.org/pipermail/webkit-dev/2011-December/018804.html">Oliver Hunt of Apple objected</a>: &#8220;As the 90s demonstrated such &#8220;features&#8221; are bad for developers, and bad for the open web.  This may not be apparent to people who have not spent years working in the environment but random additions frequently cause significant pain down the road&#8221; and <a href="https://lists.webkit.org/pipermail/webkit-dev/2011-December/018806.html">adding</a> adding &#8220;it fragments the web&#8221; and risks &#8220;turn[ing] webkit into the engine that everyone hates because of all its unique &#8220;features&#8221; that break the open web, a la certain browsers in the late 90s&#8221;.</li>
<li>W3C: <a href="http://www.w3.org/QA/2011/12/open_web_platform_weekly_summa.html">Open Web Platform Weekly Summary &#8211; 2011-12-05 &#8211; 2011-12-11</a> (worth an RSS subscription)</li>
<li><a href="http://shapecatcher.com/">Shapecatcher</a> lets you draw a shape and tries to match it to any of 10,877 unicode characters.</li>
<li><a href="http://owni.eu/2010/12/15/still-life-bent-objects/">Still life: Bent objects</a> &#8211; The secret life of everyday things</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2011/reading-list-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on Adaptive Images (yet again!)</title>
		<link>http://www.brucelawson.co.uk/2011/notes-on-adaptive-images-yet-again/</link>
		<comments>http://www.brucelawson.co.uk/2011/notes-on-adaptive-images-yet-again/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 12:00:04 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[DAP]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=3937</guid>
		<description><![CDATA[All the cool kids are doing responsive design, it seems. This means fluid designs, having some hot media query action to reformat your layout depending on screen size, and ensuring your images are flexible so they don&#8217;t break out of container, generally by setting them to {max-width:100%;}. Having images scaling down presents a problem though, [...]]]></description>
			<content:encoded><![CDATA[<p>All the cool kids are doing responsive design, it seems. This means fluid designs, having some hot media query action to reformat your layout depending on screen size, and ensuring your images are flexible so they don&#8217;t break out of container, generally by setting them to <code>{max-width:100%;}</code>.</p>
<p>Having images scaling down presents a problem though, if you&#8217;re a performance-minded sort of chap(ette). Why send a 300K 400 x 800 image that would look lovely on tablet device attached to wifi, but which takes ages to download on a 3G phone, and which gets resized by the browser to fit a 320px wide screen? Not only are you wasting your user&#8217;s bandwidth and time, but not every browser is created equal and not every resize algorithm makes pleasing end results. The CSS 4(!) <a href="http://jsfiddle.net/zda24/"><code>image-rendering</code> property</a> can help with this but it only hints to the browser.</p>
<p>Sending the right-sized image to devices without wasting bandwidth is one of the <a href="http://www.cloudfour.com/responsive-imgs/">knottiest problems</a> in cross-device and responsive design at the moment. In the 24ways advent calendar series of articles, the subject has been discussed twice in eight articles (by <a href="http://24ways.org/2011/adaptive-images-for-responsive-designs">Matt Wilcox</a> and <a href="http://24ways.org/2011/adaptive-images-for-responsive-designs-again">Jake Archibald</a>). There are numerous other techniques, as well, such as <a href="http://blog.trasatti.it/2011/05/responsive-images-and-tinysrc.html">tinySrc</a> and the Filament Group&#8217;s <a href="http://filamentgroup.com/lab/responsive_images_experimenting_with_context_aware_image_sizing/">Responsive Images</a>.</p>
<p>All these are very clever, different solutions to solve the same problem, and they all rely on scripts, or cookies, or server-side cleverness or (in the case of Jake&#8217;s ideas) dirty hacks and spacer GIFs. I&#8217;m reminded of <a href="http://css-tricks.com/630-css-image-replacement/">Image Replacement techniques</a> from more than 6 years ago, which were over-engineered solutions to the problem better solved by CSS web fonts.</p>
<p>Let&#8217;s recap. We have several images, of different sizes, and want to send only the most appropriately-sized image to the browser. The circumstances differ. The canonical use case is to send smaller, lower-resolution images to smaller screen-sizes on the assumption that connection speed is slow and they have low-resolution displays. This isn&#8217;t the case, though. Some people are using retina displays on fast wifi networks. SO, while currently CSS Media Queries allow us to detect screen width and pixel density, we need  new <a href="http://www.w3.org/TR/css3-mediaqueries/#media1">media features</a> such as network speed/ bandwidth.</p>
<p>The DAP is working on a <a href="http://dev.w3.org/2009/dap/netinfo/">Network Information API</a>, there&#8217;s a <a href="http://docs.phonegap.com/en/1.2.0/phonegap_connection_connection.md.html#connection.type">Phonegap version</a> for native apps, and a <a href="https://github.com/Modernizr/Modernizr/blob/master/feature-detects/network-connection.js">Modernizr detect</a>,  but using script for this seems much harder than being able to access it via Media Queries, and if you just want to rearrange CSS layout, CSS is the place to detect it. (Purists may argue that network connection isn&#8217;t a characteristic of device, but <em>in your face, purists!</em>)</p>
<p>Once you have a media query, you can swap images in and out using the CSS <code>content</code> property:</p>
<pre>
<code>&lt;img id=thingy src=picture.png alt="a mankini"&gt;
&hellip;
@media all and (max-width:600px) {
 #thingy {content: url(medium-res.png);}
 }

@media all and (max-width:320px) {
 #thingy {content: url(low-res.png);}
 }

@media all and (network-speed:3g) {
 #thingy {content: attr(alt);}
 }

</code>
</pre>
<p>A browser that doesn&#8217;t support Media Queries, or doesn&#8217;t report &#8220;true&#8221; for any of the Media Queries shows the picture.png, which is the <code>src</code> of the <code>img</code>. A browser that is less than 600px replaces picture.png with medium-res.png. A 320px or narrower browser replaces picture.png with low-res.png. A browser that is only connected via 3g replaces the image with its alt text.</p>
<p>I first researched this technique in 2008 as a way of doing <a href="http://my.opera.com/ODIN/blog/css-3-image-replacement">image replacement without extra  markup</a> (ironically enough). The first two media queries only works in Opera and Chrome at the moment, as they&#8217;re the only browsers that fully support <code>content</code> without <code>:before</code> or <code>:after</code>. (The <code>network-speed</code> media query works nowhere as I just made it up).</p>
<p>Recently, Nicolas Gallagher experimented with  <a href="http://nicolasgallagher.com/responsive-images-using-css3/">generated content for responsive images</a>, and unfortunately discovered that there are no advantages to the technique because browsers always download picture.png, even if they never show it because they immediately replace it. Perhaps this could be optimised away  by browsers, but there would still be the double-download problem with current browsers.</p>
<p>My mind turned to HTML5 video. Here we have an element that has the ability to specify multiple sources (because of different codecs) and can also switch sources according to media characteristics. It borrows syntax from Media Queries but puts them in the HTML:</p>
<pre>
<code>&lt;video&gt;
&lt;source src=high-res.webm media=&quot;min-width:800px&quot;&gt;
&lt;source src=low-res.webm&gt;
&lt;!-- fallback content --&gt;
&lt;/video&gt;
</code>
</pre>
<p>I firmly believe that if something as new-fangled as video can be responsive in a declarative manner (without needing script, APIs, cookies or server magic) then responsive images should be similarly simple.</p>
<p>Previously, on the mailing list, a new <a href="http://lists.w3.org/Archives/Public/public-html/2007Jul/0121.html"><code>&lt;picture&gt;</code> element was proposed</a>. I mashed up that idea with the already-proven <code>video</code> code above and came up with a strawman:</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;network-speed:3g&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>This would show a different source image for different situations. Old (=current) browsers get the fallback <code>img</code> element. As I said, this is a strawman; it ain&#8217;t pretty. But it would work. (It&#8217;s discussed in my recent Smashing Magazine article <a href="http://coding.smashingmagazine.com/2011/11/18/html5-semantics/">HTML5 Semantics</a>.)</p>
<p>I prefer the media queries to be in the HTML for two reasons: you don&#8217;t need to have <code>id</code>s or complex selectors to target a particular image, and (more importantly)  many content authors use a CMS and have no ability to edit the CSS. (Although the nasty <a href="http://html5doctor.com/the-scoped-attribute/"><code>&lt;style scoped&gt;</code></a> could solve this.)</p>
<p>On the other hand, I might be over-engineering the whole problem. I chatted informally with my colleague <a href="http://annevankesteren.nl/">Anne van Kesteren</a>, glamorous Dutch <a href="http://www.whatwg.org/charter">WHATWG inner circle member</a>. There&#8217;s a school of thought that says everything will be 300ppi and networks will be fast enough, so this is really an intermediate problem until everyone starts using highres graphics and all displays go from 150 to 300. Standards are long term, and by the time we have a standardised version, the problem might have gone away.</p>
<p>What do you think? </p>
<p>(Matt Machell pithily <a href="http://twitter.com/shuckle/statuses/144751104150876160">pointed out</a> &#8220;if only browsers hadn&#8217;t forgotten the old school <a href="http://lists.w3.org/Archives/Public/www-html/2002Nov/0136.html">lowsrc attribute for images</a>&#8220;.) </p>
<p>Looks like our chums at <a href="http://krijnhoetmer.nl/irc-logs/whatwg/20111208" title="http://krijnhoetmer.nl/irc-logs/whatwg/20111208">WHATWG are discussing this</a> too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2011/notes-on-adaptive-images-yet-again/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Reading List</title>
		<link>http://www.brucelawson.co.uk/2011/reading-list-7/</link>
		<comments>http://www.brucelawson.co.uk/2011/reading-list-7/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 10:29:37 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[reading list]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=3862</guid>
		<description><![CDATA[Links&#8217;n'stuff that I&#8217;ve tweeted, for those who don&#8217;t spend their days on twitter but who work instead. HTML5, markup Project-based cross-device development tutorial: Love your devices: adaptive web design with media queries, viewport and more My colleague Divya wrote a piece on semantics (which I disagree with) called Our Pointless Pursuit Of Semantic Value. Jeremy [...]]]></description>
			<content:encoded><![CDATA[<p>Links&#8217;n'stuff that I&#8217;ve tweeted, for those who don&#8217;t spend their days on twitter but who work instead.</p>
<h3>HTML5, markup</h3>
<ul>
<li>Project-based cross-device development tutorial: <a href="http://dev.opera.com/articles/view/love-your-devices-adaptive-web-design-with-media-queries-viewport-and-more/">Love your devices: adaptive web design with media queries, viewport and more</a></li>
<li>My  colleague Divya wrote a piece on semantics (which I disagree with) called  <a href="http://coding.smashingmagazine.com/2011/11/11/our-pointless-pursuit-of-semantic-value/">Our Pointless Pursuit Of Semantic Value</a>. Jeremy Keith <a href="http://coding.smashingmagazine.com/2011/11/12/pursuing-semantic-value/">also disagreed</a>, as did John Foliot in his ironically unsemantically-titled <a href="http://john.foliot.ca/my-thing-about-the-thing-that-thing-wrote-about-thing/">My Thing About the Thing That Thing Wrote About Thing</a>.</li>
<li>Co-incidentally, I had been asked by Smashing Magazine to write up my Fronteers talk into an article on <a href="http://coding.smashingmagazine.com/2011/11/18/html5-semantics/">HTML5 Semantics and why they do matter</a>.</li>
<li>If you&#8217;d rather see me talk about HTML5 with pink hair, here&#8217;s an Opera tech break:
<p><iframe width="500" height="284" src="http://www.youtube.com/embed/X52zJ3XehIM?rel=0" frameborder="0" allowfullscreen></iframe></li>
<li>Accessibility: <a href="http://twitter.com/rogerhudson">Roger Hudson</a> proposes a scoring system to measure *real* accessibility of a site called <a href="http://www.dingoaccess.com/accessibility/accessibility-barrier-scores-2/">Accessibility Barrier Scores.</a></li>
<li><a href="http://www.webmonkey.com/2011/11/the-trials-and-tribulations-of-html-video-in-the-post-flash-era/">The Trials and Tribulations of HTML Video in the Post-Flash Era</a> (with discussion of DRM)</li>
<li><a href="http://opensource.com/life/11/11/drm-graveyard-brief-history-digital-rights-management-music">The DRM graveyard: A brief history of digital rights management in music</a> </li>
<li><a href="http://royal.pingdom.com/2011/11/21/web-pages-getting-bloated-here-is-why/">Web pages are getting more bloated, and here’s why</a>. &#8220;Over the past year, web pages have on average become 25% bigger.&#8221; </li>
</ul>
<h3>Groovy webdev stuff</h3>
<ul>
<li>Mike Tayor has the low-down on HTML5 <a href="http://my.opera.com/ODIN/blog/2011/11/07/custom-protocol-and-content-handlers">Custom Protocol and Content Handlers</a></li>
<li><a href="http://www.andismith.com/blog/2011/11/25-dev-tool-secrets/">25 Secrets of the Browser Developer Tools</a></li>
<li><a href="http://my.opera.com/ODIN/blog/2011/11/11/the-developer-briefcase-and-other-neat-opera-extensions-for-developers">&#8216;The Developer Briefcase&#8217; and other neat Opera extensions for developers</a></li>
</ul>
<h3>CSS</h3>
<ul>
<li>Department of Unnecessary bling: <a href="http://tympanus.net/Tutorials/OriginalHoverEffects/">Flash-style hover effects replicated in CSS</a>!</li>
<li><a href="http://csscurmudgeon.com/2011/11/flexbox-sucks/">Flexbox will kick your dog and pee on your rug</a></li>
</ul>
<h4 id=vp>Vendor prefixes</h4>
<ul>
<li><a href="http://hsivonen.iki.fi/vendor-prefixes/">Vendor Prefixes Are Hurting the Web</a> says Henri Sivonen</li>
<li>WTF? zomg! says Daniel Glazman,co-chair of the CSS Working Group in his  <a href="http://www.glazman.org/weblog/dotclear/index.php?post/2011/11/16/CSS-vendor-prefixes-an-answer-to-Henri-Sivonen">answer to Henri Sivonen</a>
</li>
<li><a href="http://lea.verou.me/2011/11/vendor-prefixes-have-failed-whats-next/">Vendor prefixes have failed, what’s next?</a> asks Lea Verou</li>
<li><a href="http://infrequently.org/2011/11/vendor-prefixes-are-a-rousing-success/">Vendor Prefixes Are A Rousing Success</a> declaims Alex Russell. I tend to agree with Alex here, but think that <a href="http://infrequently.org/2011/11/vendor-prefixes-are-a-rousing-success/#comment-239435">Robert O&#8217;Callahan makes an excellent point</a> that Alex&#8217;s perspective isn&#8217;t neutral; it benefits WebKit (and thus his employer, Google).</li>
<li><a href="http://lea.verou.me/2011/10/prefixfree-break-free-from-css-prefix-hell/">PrefixFree: Break free from CSS prefix hell</a> &#8211; Lea&#8217;s script parses CSS on the client and adds only the vendor prefixes that the browser requires. A sort of Modernizr for CSS, but note it adds a dependency on JavaScript.</li>
<li><a href="http://prefixr.com/">Prefixr: Cross-Browser CSS in Seconds!</a> -copy your prefixless CSS, hit the button o get prefixes added, paste the result back into your CSS.</li>
</ul>
<h3>Misc</h3>
<ul>
<li><a href="http://imgur.com/Cpdaq">An 86 year old&#8217;s comic about the Web</a> (hopefully genuine!)</li>
<li><a href="http://lesbianswholooklikejustinbieber.tumblr.com/">Lesbians who look like Justin Bieber</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2011/reading-list-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

