<?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; Search Results  &#187;  ajax</title>
	<atom:link href="http://www.brucelawson.co.uk/search/ajax/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.brucelawson.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 13:02:55 +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>JavaScript and screenreaders</title>
		<link>http://www.brucelawson.co.uk/2011/javascript-and-screenreaders/</link>
		<comments>http://www.brucelawson.co.uk/2011/javascript-and-screenreaders/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 10:03:12 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[ARIA]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=3307</guid>
		<description><![CDATA[For three years Jared Smith and his lovable chums at WebAIM have conducted a survey of screenreader users, analysed the result and posted them. This year&#8217;s results are out. Let&#8217;s take a moment to give them a round of applause. There is much to digest, but one figure really caught my attention: only 1.6% of [...]]]></description>
			<content:encoded><![CDATA[<p>For three years  <a href="http://webaim.org/contact/#jaredsmith">Jared Smith</a> and his lovable chums at <a href="http://webaim.org/">WebAIM</a> have conducted a survey of screenreader users, analysed the result and posted them. <a href="http://webaim.org/projects/screenreadersurvey3/">This year&#8217;s results are out</a>. Let&#8217;s take a moment  to give them a round of applause.</p>
<p>There is much to digest, but one figure really caught my attention: only 1.6% of respondents had JavaScript disabled. Turning that round, <strong>98.4% of screenreader users had JavaScript enabled</strong>.</p>
<p>Hopefully this will finally bury the WCAG1-era myth that JavaScript is automatically bad for accessibility or that pages that depend on scripting are inaccessible to assistive technologies. </p>
<p>This myth came about from the early days of screenreaders, which took a snapshot of the rendered page into a buffer and, when a user was navigating a page, he was really navigating that snapshot. If a page was changed with script the user wouldn&#8217;t know because another snapshot wasn&#8217;t triggered. (Even in this model, some JavaScript was fine. If, for example, your page contained lots of <code>document.write</code>s that executed immediately, and wrote HTML to the page, that would be available.)</p>
<p>As the Web made more use of &#8220;Ajax&#8221;, screenreaders became  more sophisticated and now can handle most scripted interactions. This doesn&#8217;t mean that JavaScript is always fine to use; just as you can write inaccessible HTML and CSS, it&#8217;s possible to script away accessibility. An understanding of <a href="http://dev.opera.com/articles/view/introduction-to-wai-aria/">WAI ARIA</a> is vital to professional JavaScripters.</p>
<p>(It&#8217;s also important to understand that not all accessibility needs are assistive technology needs. Christian Heilmann and Antonia Hyde showed that some scripting can be empowering for people with cognitive problems with their <a href="http://icant.co.uk/easy-youtube/">Easy YouTube</a> and <a href="http://www.wait-till-i.com/2008/06/13/easy-flickr-just-the-photos-please/">Easy Flickr</a>.)</p>
<p>So we know that script doesn&#8217;t scare off assistive technologies, and we know from Yahoo! developer  Nicholas C. Zakas&#8217; report <a href="http://developer.yahoo.com/blogs/ydn/posts/2010/10/how-many-users-have-javascript-disabled/">How many users have JavaScript disabled?</a> that only 1% of visitors to Yahoo! have turned off JavaScript. Does this mean that we can safely forget about those who can&#8217;t use JavaScript.</p>
<p>Well, no. But <strong>JavaScript-required is not an accessibility problem, it&#8217;s  a usability problem</strong>. As Zakas says</p>
<blockquote><p>While the percentage of visitors with JavaScript disabled seems like a low number, keep in mind that small percentages of big numbers are also big numbers.</p></blockquote>
<p>We spend a lot of time making our sites work with old browsers, using JavaScript shivs and polyfills but we don&#8217;t talk much about users without JavaScript. The Opera mini browser, for example, is the most-widespread mobile browser out there but, because it renders on a server, interactivity is limited (See <a href="http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/">Opera Mini: web content authoring guidelines</a> for more information.)</p>
<p>How far can an application that requires Web Sockets, local storage, cross-domain messaging, canvas be expected to degrade gracefully?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2011/javascript-and-screenreaders/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>What HTML5 is and isn&#8217;t</title>
		<link>http://www.brucelawson.co.uk/2010/what-html5-is-and-isnt/</link>
		<comments>http://www.brucelawson.co.uk/2010/what-html5-is-and-isnt/#comments</comments>
		<pubDate>Thu, 13 May 2010 16:34:04 +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=2686</guid>
		<description><![CDATA[Like &#8220;Ajax&#8221;, HTML5 has become a bit of an umbrella term. Some people lump all kinds of unrelated technology like SVG, CSS 3, CORS, JavaScript, Geolocation, even webfonts in with it. Remy and I are guilty too; we talk about Geolocation, Web Workers and Web SQL in our book Introducing HTML5. Here&#8217;s a somewhat tongue-in-cheek [...]]]></description>
			<content:encoded><![CDATA[<p>Like &#8220;Ajax&#8221;, HTML5 has become a bit of an umbrella term. Some people lump all kinds of unrelated technology like SVG, CSS 3, CORS, JavaScript, Geolocation, even webfonts in with it. </p>
<p>Remy and I are guilty too; we talk about Geolocation, Web Workers and Web SQL in our book <a href="http://www.amazon.com/exec/obidos/ASIN/0321687299/brucelawson-21/">Introducing HTML5</a>.</p>
<p>Here&#8217;s a somewhat tongue-in-cheek handy cut-out-and-keep diagram that shows what is and isn&#8217;t HTML5, and also showcases my kick-ass design skills.</p>
<p><a href="http://www.flickr.com/photos/24374884@N08/4603715307/" title="What's HTML5? by brucelawson, on Flickr"><img src="http://farm2.static.flickr.com/1199/4603715307_c878c8a77b.jpg" width="500" height="363" alt="What's HTML5?" /></a></p>
<p>If you&#8217;re not busy next week, I&#8217;m building an HTML5 page from scratch (with Notepad++ and two visual aids) at <a href="http://www.amiando.com/e/fawkdu">Future of Web Design</a> in London on Wednesday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2010/what-html5-is-and-isnt/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A sexy new name for the Open Web Stack?</title>
		<link>http://www.brucelawson.co.uk/2009/a-sexy-new-name-for-the-open-web-stack/</link>
		<comments>http://www.brucelawson.co.uk/2009/a-sexy-new-name-for-the-open-web-stack/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 17:04:41 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=2210</guid>
		<description><![CDATA[&#8220;What’s in a name? that which we call a rose by any other name would smell as sweet&#8221; said Juliet of Romeo. Ultimately, in the heady world of Shakespearian romance, names do matter; if you&#8217;re name is Montague, you can&#8217;t marry someone called Capulet. And certainly names matter in the more prosaic (but equally passionate) [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;What’s in a name? that which we call a rose by any other name would smell as sweet&#8221; said Juliet of Romeo.</p>
<p>Ultimately, in the heady world of Shakespearian romance, names do matter; if you&#8217;re name is Montague, you can&#8217;t marry someone called Capulet.</p>
<p>And certainly names matter in the more prosaic (but equally passionate)  world of Web Standards. Until <a href="http://www.adaptivepath.com/ideas/essays/archives/000385.php">Jesse James Garrett coined the term &#8220;Ajax&#8221;</a> we didn&#8217;t really have a phrase to refer to web applications that allowed parts of pages to be updated without refreshing the page. No matter that some Ajax depended neither on JavaScript nor <abbr>XML</abbr>; the name was a useful method to describe both the  new techniques and the stepping-up of the users&#8217; experience.</p>
<p>I find myself consistently grasping for an umbrella term to describe the new technologies available to us, such as <abbr>HTML</abbr>5, <abbr>CSS</abbr> 3, Geolocation, <abbr>W3C</abbr> Widgets, WAI-ARIA, Web Fonts, Web Storage, Web Sockets, <abbr>SVG</abbr> and the like.</p>
<p>I&#8217;ve been using &#8220;<abbr>HTML</abbr>5&#8243; as such an umbrella term for new markup specs and <abbr>API</abbr>s, but it&#8217;s inaccurate; Geolocation was never in the <abbr>HTML</abbr>5 specification although technologies such as Web Storage used to be until they were split out. </p>
<p>The orginators of the <abbr>HTML</abbr>5 specs, the <abbr>WHATWG</abbr>, have recently resurrected the term <a href="http://www.whatwg.org/specs/web-apps/current-work/complete.html">Web Applications 1.0</a> as a superspec to wrap up <abbr>HTML</abbr>5, pre-defined microdata vocabularies, Web Workers, Web Storage, Web Database, Server-sent Events, and Web Sockets.</p>
<p>But that still leaves <abbr>SVG</abbr> and <abbr>CSS</abbr>. The term &#8220;Web 2.0&#8243; is too tainted by marketing <abbr>BS</abbr> and synergy-speak to be useful&mdash;and also seems to mean social networking, or user-generated content or any number of buzzwords.</p>
<p>Do you have any ideas for a sexy new term? Do we need a sexy new term at all?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2009/a-sexy-new-name-for-the-open-web-stack/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Opera Mini: what, why and how</title>
		<link>http://www.brucelawson.co.uk/2009/opera-mini-what-why-and-how/</link>
		<comments>http://www.brucelawson.co.uk/2009/opera-mini-what-why-and-how/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:06:57 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/?p=2079</guid>
		<description><![CDATA[Speaking to a few hundred developers this week at Future of Web Design Bristol and Glasgow, some attendees were surprised to learn that Opera passed the iPhone to lead the mobile-browser market. This seemed counter-intuitive as &#8220;everybody&#8221; in the web development world has an iPhone, just like &#8220;everyone&#8221; uses a Mac. Of course, we know [...]]]></description>
			<content:encoded><![CDATA[<p>Speaking to a few hundred developers this week at <a href="/2009/future-of-web-design-bristol/">Future of Web Design  
Bristol</a> and <a href="/2009/future-of-web-design-glasgow/">Glasgow</a>,  
some attendees were surprised to learn that <a href="http://www.reuters.com/article/technologyNews/idUSTRE55171K20090602">Opera  
passed the iPhone to lead the mobile-browser market</a>. This seemed  
counter-intuitive as &#8220;everybody&#8221; in  the web development world has an  
iPhone, just like &#8220;everyone&#8221; uses a Mac.</p>

<p>Of course, we know that in the real world, most people do not have an  
iPhone and don&#8217;t use a Mac. This is a  demonstration of the  potentially dangerous belief that &#8220;my customers  
are the same as me&#8221;. As everyone wants to make their sites mobile-friendly, and as today sees  
the release of <a href="http://www.opera.com/mini/next/">Opera Mini 5 beta</a>, now is a good time to explain what  
Opera Mini is and how you design for it and test it.</p>

<h3>What is Opera Mini?</h3>
<p>Web browsers are hugely complex beasts. Working out the interaction  
between <abbr>HTML</abbr>, <abbr>CSS</abbr>, <abbr>SVG</abbr>, JavaScript  
and rendering it all is highly processor-intensive. They rely  heavily on  
Operating Systems (which is why making cross-<abbr>OS</abbr> browsers like  
Opera and Firefox is hard).</p>

<p>World-wide there are 100 million or so smartphones, each of which has an  
Operating System that can run a full web browser such as <a href="http://www.opera.com/mobile/">Opera Mobile</a> or  
Safari.</p>

<p>But there is an estimated 1 <em>billion</em> lower-specced phones around the globe, many of them in the  
developing world (but by no means exclusively so; how many people do you know with featurephones rather than smartphones? A lot, I&#8217;ll bet).</p>

<p>Because it&#8217;s  a world-wide web, and not just a wealthy Western web, we  
developed Opera Mini, which works on all phones&mdash;even on the lower-end ones, as long as they support Java.</p>

<p>There often isn&#8217;t enough processing power to render the page on these phones, so the  
requests are pre-rendered on servers running Opera&#8217;s layout engine and the result is sent  
to the phones from the server as a heavily compressed &#8220;snapshot&#8221; of the  
page. It&#8217;s by no means uncommon for this to be as small as 10% of the size  
of the original page.</p>

<p>Because of this heavy compression, displaying pages on the user&#8217;s device occurs much faster than if it had processed the page itself, and for those who  
pay by the amount of data downloaded it&#8217;s also a huge cost saving. This  
compression and data saving also explains why many Western users of smartphones  
 use Opera Mini to reduce bankruptcy-inducing data-roaming charges when  
they travel to a neighbouring country.</p>


<h3>How to ensure your site works in Opera Mini</h3>
<p>The same way that you ensure your site works in every other browser: <strong>design  
using <a href="http://www.opera.com/wsc">Web Standards</a> and make sure  
your code validates</strong>.</p>

<p>A  useful technique for cross-browser and cross-device  
development are to use the <a href="http://domscripting.com/blog/display/41">Hijax methodology  for  
adding Ajax interactions</a>.</p>

<p>Don&#8217;t be immediately tempted to  start building a special mobile-only verson of your site (see my ZDNet article <a href="http://resources.zdnet.co.uk/articles/comment/0,1000002985,39621546-1,00.htm">Forget the mobile web: One site should work for all</a>). Using <a href=" http://www.css3.info/preview/media-queries/"><abbr>CSS</abbr> Media Queries</a>, you can send reformatted screen layouts to devices according to their display properties.</p>


<h4>Leverage those accessibility synergies!</h4>

<p>Another secret of developing with mobile devices in mind is to consider  
accessibility. If you think about it, having a small screen with no  
keyboard  is somewhat like browsing with  
assistive technologies.</p>

<p>Many people on expensive data plans browse with images turned off, so  
sensible alternate text gets the content to them. Many older mobile  
devices have limited fonts and colours,  so by not using those  as the  
sole way of giving information makes your sites both accessible and  
available to mobile devices.</p>

<p>The <abbr>W3C</abbr> produced a useful cross-reference  
that rejoices in the title <a href="http://www.w3.org/TR/mwbp-wcag/">Relationship between Mobile Web  
Best Practices (<abbr>MWBP</abbr>) and Web Content Accessibility Guidelines
(<abbr>WCAG</abbr>)</a> which explains this in more detail.</p>

<h3>Further resources</h3>
<ul>
<li><a href="http://www.opera.com/mini/next/">Download Opera Mini 5 beta</a></li>
<li><a href="http://dev.opera.com/articles/view/opera-mini-5-beta-developers/">A  
developer’s look at Opera Mini 5 beta</a></li>
<li><a href="http://www.opera.com/smw/">State of the Mobile Web  
reports</a>: a monthly look at the sites and handsets used by people in  
different territories</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2009/opera-mini-what-why-and-how/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Redesigning with HTML 5 and WAI-ARIA</title>
		<link>http://www.brucelawson.co.uk/2009/redesigning-with-html-5-wai-aria/</link>
		<comments>http://www.brucelawson.co.uk/2009/redesigning-with-html-5-wai-aria/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:00:48 +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/index.php/?p=1052</guid>
		<description><![CDATA[For the past few months, I&#8217;ve been lucky enough to tour places like Indonesia talking about cutting-edge web development languages like HTML 5 and WAI-ARIA. My new year resolution was to actually start using them, so made an HTML 5 test page to show that at least some those useful new elements can be used [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months, I&#8217;ve been lucky enough to tour places like <a href="/2008/opera-indonesian-tour-slides/">Indonesia</a> talking about cutting-edge web development languages like <abbr>HTML</abbr> 5 and <abbr title="Accessible Rich Internet Applications Suite">WAI-ARIA</abbr>. </p>
<p>My new year resolution was to actually start <em>using</em> them, so made an <a href="/2009/html-5-elements-test/"><abbr>HTML</abbr> 5 test page</a> to show that at least some  those useful new elements can be used now.</p>
<p>But a test page isn&#8217;t real world, so the logical next step was to redesign this site  to use the new technologies. While my blog is a set of old-school static documents  with none of the  &#8220;Web 2.0&#8243; Ajax sexiness that would best show off these technologies, it has one thing in its favour: it&#8217;s five years worth of often-dodgy markup (I was learning!) with 3000 or so comments, some containing unsanitised code. It&#8217;s a reasonable road-test for <abbr>HTML</abbr> 5, which was <a href="http://www.w3.org/TR/html-design-principles/">specifically designed for backwards compatibility</a>. This is still a test;  validation errors are part of that, although if you see any post with broken layout or unreadble content, please <a href="/contact/">let me know</a>. </p>
<p><span id="more-1052"></span></p>
<p>When I <a href="http://twitter.com/brucel/status/1094879114">announced this project</a>, I had no idea how long it would take or how enormous this write-up would be. So I&#8217;m doing it in parts. This part deals with the structural markup of the major page elements, and how to style it.</p>
<p>In <a href="/2009/marking-up-a-blog-with-html-5-part-2/">Part 2</a>, I&#8217;ll  show that Web Fonts can enhance accessibility by being &#8220;real text&#8221; instead of requiring images of text, I&#8217;ll  make some of the headings follow my &#8220;ransom note&#8221; theme with a <a href="http://dev.opera.com/articles/view/presto-2-2-and-opera-10-a-first-look/#webfonts">Web Font</a>. </p>
<p>Lastly, I&#8217;ll do some work on the guts of the page, using <abbr>HTML</abbr> 5&#8242;s <code>article</code> elements to better mark up blog posts and comments and show how to use the <code>section</code> elements to better structure accessible hierarchical headings on sites that are <abbr>CMS</abbr>-driven.</p>
<p>Please note that I&#8217;m not trying to persuade you to use <abbr>HTML</abbr> 5; the spec is unfinished and liable to change; this is <em>an experiment</em>. Neither do I claim that it&#8217;s the best thing ever; I&#8217;ve had <a href="/2007/html5-microformats-accessibility-testing/">my doubts about <abbr>HTML</abbr> 5</a>. But I do believe that it&#8217;s the only game in town for marking up documents and web applications in the (imminent) future, so it&#8217;s sensible to start understanding it and kicking the tyres. Testing it out like this and giving feedback to the <abbr>HTML</abbr> 5 lists will also help improve the language.</p>
<p>With those caveats out of the way,  let&#8217;s begin.</p>
<h3><abbr>HTML</abbr> 5 WordPress theme</h3>
<p>All I&#8217;m doing is hacking markup, so you need nothing other than a text editor and a web brower to duplicate what I&#8217;m up to. However, this blog uses a modified version of WordPress&#8217; default Kubrick theme, so where appropriate I&#8217;ll tell you which file I&#8217;m hacking or you can download my <a href="/downloads/BruceLawson-HTML5-wordpress-theme.zip">HTML 5 WordPress theme</a>.</p>
<p>Please note the small print (marked up using the <code>small</code> element, sensibly redefined in <abbr>HTML</abbr> 5 to &#8220;represent small print (part of a document often describing legal restrictions, such as copyrights or other disadvantages), or other side comments&#8221; but <a href="http://lists.w3.org/Archives/Public/public-html/2009Jan/0130.html">which, absurdly, must go around each item in the list rather wrap around the whole <code>ul</code></a> regardless of the fact that it <a href="/tests/html5-small.html">works in all browsers</a>):</p>
<ul>
<li><small>I&#8217;m no <abbr>PHP</abbr> coder, so it isn&#8217;t pretty</small></li>
<li><small>There&#8217;s no copyright (the only copyright stuff in this design are the logo and background images which aren&#8217;t in the download)</small></li>
<li><small>I&#8217;ll change it on Friday and again next week</small></li>
<li><small>I may change it at any time after feedback</small></li>
<li><small>It&#8217;s packaged &#8220;as is&#8221;, and you&#8217;ll need to change it, although I&#8217;ve noted where it requires a certain plug-in</small></li>
<li><small>It&#8217;s for educational purposes only; I make no guarantees for it and will not support it</small></li>
<li><small>If you can improve it, please tell me and I&#8217;ll replace it with yours!</small></li>
</ul>
<h3>Setting the DOCTYPE</h3>
<p><abbr>HTML</abbr> 5, when used as plain <abbr>HTML</abbr> rather than its <abbr>XHTML</abbr> 5 sibling doesn&#8217;t need a DOCTYPE. But all browsers do, otherwise they go into <a href="http://en.wikipedia.org/wiki/Quirks_mode">Quirksmode</a>, which you don&#8217;t want: the collision of <abbr>HTML</abbr> 5 and Quirksmode is like matter and anti-matter meeting, and will cause a negative reality inversion that will make your underwear catch fire. </p>
<p>You&#8217;ve been warned, so at the top of your document, you need the line <code>&lt;!DOCTYPE html&gt;</code>. (In WordPress, this is at the top of header.php).</p>
<p>Some sites &#8220;use&#8221; <abbr>HTML</abbr> 5, when in actual fact all they&#8217;ve done is take their existing code and change the DOCTYPE. That&#8217;s fine and dandy if you&#8217;ve been using valid, semantic code as <abbr>HTML</abbr> 5 is very similar to valid <abbr>HTML</abbr> 4.01. <a href="http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/">Eric Meyer mentions small differences</a> like &#8220;not permitting a value attribute on an image submit&#8221;, and there are a few differences between the languages, summarised in the document <a href="http://dev.w3.org/html5/html4-differences/">HTML 5 differences from HTML 4</a>.</p>
<p>However, I didn&#8217;t want to simply rebadge my existing code, but show that you can use some of the new structural elements now.</p>
<h3>Using some new structural elements</h3>
<p>My blog &#8211; like millions of others &#8211; has a header denoted by <code>&lt;div id="header"&gt;</code>, a footer <code>&lt;div id="footer"&gt;</code>, some articles (wrapped by an area called &#8220;content&#8221;, <code>&lt;div id="content"&gt;</code>) and some navigation (wrapped up in an area called &#8220;sidebar&#8221; <code>&lt;div id="sidebar"&gt;</code>). </p>
<p>Although these all have very different functions within the page, they  use  the same generic <code>div</code> in the markup. as <abbr>HTML 4</abbr>  has no other way to code them. <abbr>HTML</abbr> 5 has new elements for distinguishing  these logical areas: <code>header</code>, <code>nav</code>, <code>footer</code> and <code>aside</code>. (There&#8217;s  more on this in an artice by Lachlan Hunt on A List Apart: <a href="http://www.alistapart.com/articles/previewofhtml5">A Preview of <abbr>HTML</abbr> 5</a>.)</p>
<p>It&#8217;s a simple matter to change the <abbr>HTML</abbr> <code>div</code>s into the new elements. (In WordPress, the relevant files are header.php, footer.php, sidebar.php and index.php.) The only difficulty I had was deciding which element to use to mark up my sidebar, as it also includes a search field and &#8220;colophon&#8221; information as well as site-wide navigation. </p>
<p>I decided against the <code>aside</code> element,  as <a href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element">the spec says</a> it &#8220;represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content&#8221;, but it&#8217;s nevertheless <em>content</em> rather than navigation. So I decided to go for the <code>nav</code> element as the closest fit.</p>
<p>However, there&#8217;s  no equivalent structure to the grouping &#8220;content&#8221; div in <abbr>HTML</abbr> so I&#8217;ve left that there. </p>
<p>The overall aim is to replace this structure:</p>
<p><img src="/images/html5-before.gif" alt="structure chart before redesign" class="border standalone" /></p>
<p>with this:</p>
<p><img src="/images/html5-after.gif" alt="structure chart before redesign" class="border standalone" /></p>
<p>Note that I&#8217;ll be coming back  the individual posts inside the content <code>div</code> next week, using some clever <abbr>HTML</abbr> 5 tricks to mark up sections, comments and headings that can dynamically change their &#8220;level&#8221; in the hierarchy depending on where the <abbr>CMS</abbr> puts them.</p>
<h3>New form attributes</h3>
<p>As well as the main structural item on the page, I&#8217;ve added some new attributes on <code>input</code> elements in the comments form.</p>
<p><abbr>HTML</abbr> 5 was designed to reflect what developers actually do, rather than to reflect a philosophical purity, and that&#8217;s very clearly manifested in the new attributes which mean the browser takes up much of the work currently done by developers re-inventing validation routines in JavaScript. (Extending forms functionality was how the <abbr>HTML</abbr> 5 spec began).</p>
<p>So I amended the email input field in the comments to be <code>input type="email"</code> which means that when the user submits the form, an <abbr>HTML</abbr> 5-aware browser will use built-in validation routines to check that it&#8217;s in the correct format, without any JavaScript. (Check it out in an experimental implementation in the current version of <a href="http://www.opera.com/">Opera</a>, as that&#8217;s my employer who is paying for me to do this, and note that it also adds a &#8220;mail&#8221; icon in the input field as a cue to the user.)</p>
<p>There are similar input validation routines triggered by some of the  new <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#attr-input-type"><code>input</code> types</a>, such as <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#url-state"><code>url</code></a> (which I use on the field that asks for the user&#8217;s web address), <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#number-state"><code>number</code></a> and  <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#attr-input-pattern"><code>pattern</code></a> which compares the input with an arbitrary regular expression.</p>
<p>Another good example is <code>input type="date"</code>, which pops up a calendar widget/ date picker when the user focusses on the input field. You can <a href="/tests/html5-date-test.html">test the date picker</a>, or here&#8217;s a screenshot from Opera 9.6:</p>
<p><img src="/images/html5-form-date.gif" alt="date picker pops up next to input field" class="border standalone" /></p>
<p>A very useful new attribute I used on both <code>input</code> fields for commenter&#8217;s name and email address, and the comment <code>textarea</code> was <code>type="required"</code> which generates a message on submission if the fields are left blank. I suppose each different localisation of a browser would need to have a different message, and it&#8217;s not (as far as I know) customisable by the developer. </p>
<p><img src="/images/html5-required-feedback.gif" alt="red-bordered browser message 'You have to specify a value'" next to unfilled required field" class="border standalone" /></p>
<p>The good thing with all these new form geegaws is that they&#8217;re all attributes on an exisiting element, so people using older browsers just see a plain old <code>input</code> field.</p>
<h4>A note on screenreaders and <abbr>HTML 5</abbr></h4>
<p>I hope screenreaders are ready for these new interactions; I asked the html 5 group to formally <a href="http://lists.w3.org/Archives/Public/public-html/2007Jul/1249.html">invite screenreader vendors to participate</a> in the specification; to my knowledge, <a href="http://lists.w3.org/Archives/Public/public-html/2008Aug/0795.html">none have done so</a>.</p>
<h3>Laying out the new elements</h3>
<p>It&#8217;s not too hard to layout the new elements (although I wasted half a day wrestling with <abbr>IE</abbr> 6 until <a href="http://justbeyondthebridge.co.uk/">Andy Higgs</a> pointed out that dropped floats were an <abbr>IE</abbr> 6  problem, not an <abbr>HTML</abbr> 5 problem, so <abbr>IE</abbr> 6 users just get a fixed width site. Thanks Andy; wish I&#8217;d thought of that four hours before you did!)</p>
<p>In all the non-<abbr>IE</abbr> browsers, you can lay out anything using <abbr>CSS</abbr> &#8211; even a <a href="/tests/html5-nonsense-element.html">nonsense element</a>. One gotcha that wasted a whole day is when I forgot that the current crop of browsers have no &#8220;knowledge&#8221; of these elements. </p>
<p>All browsers have default settings for the elements they &#8220;know about&#8221;&mdash;how much padding, margin they element gets, does it display as a block or inline?. (Here&#8217;s a <a href="http://www.w3.org/TR/CSS2/sample.html">sample default stylesheet</a>.) Unless over-ridden by <abbr>CSS</abbr>, these defaults apply. But the browsers don&#8217;t know about <code>header</code>, <code>nav</code> and the like, so have no defaults to apply to them.</p>
<p>I got terrible rendering oddities until I explicitly told the browsers </p>
<p><code>header, footer, nav, article {display:block;}</code></p>
<h4><abbr>IE</abbr> layout</h4>
<p>There&#8217;s one gotcha about styling <abbr>HTML</abbr> 5 pages in <abbr>IE</abbr>: it doesn&#8217;t work. You can force it to quite easily with a JavaScript hack <code>document.createElement('element name')</code>. (Lachlan Hunt gets to the bottom of <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">why IE needs this</a>.)</p>
<p>For your convenience, Remy Sharp has written an <a href="http://remysharp.com/2009/01/07/html5-enabling-script/"><abbr>HTML</abbr> 5 enabling script</a> which I use in the header to conjure all the missing elements into existence all at once.</p>
<p>But let&#8217;s be clear: <strong>this won&#8217;t work if your <abbr>IE</abbr> user doesn&#8217;t have JavaScript turned on</strong>. How much of that&#8217;s a big deal that is for you to decide. Pragmatically, it seems to me that the sites that will benefit the most from HTML 5’s new “Ajax”-style features, such as drag-and-drop, are the sites that currently have no hope of working without JavaScript. </p>
<h4 id="gecko-bug">Firefox 2 and Camino 1 layout</h4>
<p>Firefox 2 and Camino 1 both use Gecko 1.9 which has a bug and so gets grumpy if you don&#8217;t serve the page as <abbr>XHTML</abbr>. (Go figure; that&#8217;s almost enough to trigger a negative reality inversion and you know how bad that can be). Nice Mr Zeppelin (can I call you &#8220;Led&#8221;?) provided some <a href="/2009/html-5-elements-test/#comment-592462"><abbr>PHP</abbr> for content negotiation</a>, to send that errant rendering engine the wrong DOCTYPE while the good boys get the sweeties.</p>
<p>I decided not to use it, because Firefox 2 immediately choked on the first piece of code it found that wasn&#8217;t well-formed <abbr>XML</abbr>, and  one  purpose of this experiment is to see how current browsers behave with backwardly-compatible <abbr>HTML</abbr> 5. My conscience is reasonably clear; Firefox and Camino users (while not having the <a href="http://www.flickr.com/photos/dotjay/183692197/">grace</a>, <a href="http://www.flickr.com/photos/redux/228419899/">charm</a> and <a href="http://www.flickr.com/photos/redux/1060085453/">irresistable sexual magnetism</a> of Opera users) are a clever lot who upgrade frequently (I&#8217;ve never heard of a corporate lock-in to Firefox 2).</p>
<h3>What&#8217;s the point of those new structural elements</h3>
<p>Well, they add semantics to the page. The browser now knows which area of your site is the header or the footer because there are <code>header</code> and <code>footer</code> elements, whereas <code>div</code> might be called &#8220;branding&#8221; and &#8220;legal&#8221;, or even  &#8220;<span lang="fr">en-tete</span>&#8221; and &#8220;<span lang="fr">pied-de-page</span>&#8221; or &#8220;<span lang="de">kopfzeile</span>&#8221; and &#8220;<span lang="de">fusszeile</span>&#8220;.</p>
<p>But <em>so what</em>?</p>
<p>Robin Berjon expressed it beautifully in a <a href="http://www.alistapart.com/comments/semanticsinhtml5?page=2#12">comment on <cite>A List Apart</cite></a>: </p>
<blockquote cite="http://www.alistapart.com/comments/semanticsinhtml5?page=2#12"><p>Pretty much everyone in the Web community agrees that “semantics are yummy, and will get you cookies”, and that’s probably true. But once you start digging a little bit further, it becomes clear that very few people can actually articulate a reason why. So before we all go another round on this, I have to ask: what’s it you wanna do with them darn semantics?</p>
<p>The general answer is “to repurpose content”. That’s fine on the surface, but you quickly reach a point where you have to ask “repurpose to what?” &hellip; I think <abbr>HTML</abbr> should add only elements that either expose functionality that would be pretty much meaningless otherwise (e.g. <code>canvas</code>) or that provide semantics that help repurpose for Web browsing uses.</p>
</blockquote>
<p>In my view, there are a couple of things I want to do with those semantics. The first is for search engine use; it&#8217;s easy to imagine Messrs Google or Yahoo! giving lower weighting to content in <code>footer</code> elements, or extra weight to content in the <code>header</code>. The second reason is to make the site navigable for people with disabilities. People with learning difficulties might instruct their browser always to put the articles before the navigation, for example. User agents might very well have a keyboard shortcut which jumped straight to the <code>nav</code> for example, or jumped straight past the navigation, in a programmatic implementation of &#8220;<a href="http://juicystudio.com/article/skip-links.php">skip links</a>&#8220;.</p>
<p>Which brings me to&hellip;</p>
<h3>WAI-ARIA</h3>
<p>WAI–ARIA is new <abbr>W3C</abbr> specification (see Gez Lemon&#8217;s <a href="http://dev.opera.com/articles/view/introduction-to-wai-aria/">Introduction to ARIA</a>) which is expected to become a standard in 2009. It&#8217;s the <a href="http://www.w3.org/WAI/intro/aria">Accessible Rich Internet Applications Suite</a>, which  allows developers to make web 2.0 applications more accessible by extending <abbr>HTML</abbr> 4 for all the bolt-ons that that web applications require such as sliders, date pickers and Ajax-updated dynamic regions. </p>
<p>Until <abbr>HTML</abbr> 5 is widespread, such Ajax widgets can only be made through scripting and are    pretty much invisible to assistive technologies unless extra information is added to the HTML and manipulated by the scripts.  That&#8217;s what ARIA does, and it&#8217;s being supported by all the browsers,  the main screenreader manufacturers and  JavaScript libraries such as Dojo, the Yahoo! User Interface Library and (partially) jQuery. </p>
<p>There&#8217;s a lot of overlap between WAI-ARIA and new elements and attributes in <abbr>HTML</abbr> 5, and there are many political mailing list yawnfests about which is better, what will supersede what, but the fact is that ARIA has some support now, while most browsers are just beginning to support <abbr>HTML</abbr> 5&mdash;so to make my site as accessible as possible, I&#8217;m adding ARIA attributes, too.</p>
<p>Firstly, on the main structural areas of the page, I&#8217;ve added what ARIA calls &#8220;<a href="http://www.w3.org/WAI/PF/aria-practices/#kbd_layout">document landmark roles</a>&#8221; which are pre-defined keywords that assistive technologies look out for. Steve Faulkner has a useful list of  <a href="http://www.paciellogroup.com/blog/?p=106">equivalences between <abbr>HTML</abbr> 5 elements and landmark roles</a>, although I disagree with him on one aspect, as I believe <code>header</code> to be fucntionally the same as ARIA&#8217;s <code>banner</code> role, so have marked up that element <code>header aria-role="banner"</code>.</p>
<p>I&#8217;ve also added ARIA information to the comments form. The ARIA equivalent of the <abbr>HTML</abbr> 5 <code>input</code> attribute <code>required</code> is <code>aria-required="true"</code>.</p>
<h4>Relations between ARIA and HTML 5</h4>
<p>The <a href="http://validator.nu/"><abbr>HTML</abbr> 5 validator</a> gives errors when it encounters ARIA information. </p>
<p>In an email conversation about this with <a href="http://www.juicystudio.com/">Gez Lemon</a>, Gez said </p>
<blockquote><p>ARIA is intended to bridge accessibility issues with <abbr>HTML</abbr> 4.01,  <abbr>XHTML</abbr> 1.0 (and every other markup language), which wouldn&#8217;t validate. As <abbr>HTML</abbr> 5 is being developed at the same time as ARIA (although ARIA is likely to reach recommendation status before <abbr>HTML</abbr> 5), <abbr>HTML</abbr> 5 is likely to include some of the benefits afforded by ARIA natively, so are explicitly stating what parts from ARIA are allowed.</p></blockquote>
<p><a href="http://hsivonen.iki.fi/">Henri Sivonen</a>,  who made the <abbr>HTML</abbr> 5 validator told me</p>
<blockquote><p>I chose not to support landmarks for the time being, because a year ago, it seemed that the introduction of landmark roles could have been avoided by moving to corresponding <abbr>HTML</abbr> 5 elements directly.</p>
<p>Eventually, there needs to be a spec that covers the integration of ARIA and <abbr>HTML</abbr> 5 both from the point of view of document conformance and from the point of view of processing in browsers. There&#8217;s no such spec yet.</p>
</blockquote>
<p>I don&#8217;t mind; <abbr>HTML</abbr> <strong>4</strong> won&#8217;t validate with ARIA information, either, but for me, accessibility trumps validation.</p>
<p>The biggest worry, perhaps, is if the  ARIA and <abbr>HTML</abbr> 5 information contradict each other. The <a href="http://www.w3.org/WAI/PF/aria/#host_general_conflict">ARIA spec says</a></p>
<blockquote cite="http://www.w3.org/WAI/PF/aria/#host_general_conflict"><p>If the host language incorporates ARIA support and there is a conflict between a host language feature and an ARIA feature, assistive technologies should assign preference to the ARIA feature.</p></blockquote>
<p>What, exactly &#8220;if the host language incorporates ARIA support&#8221; means is unclear to me.</p>
<h3>The end</h3>
<p>Phew, this has turned out to be War and Peace, hasn&#8217;t it? </p>
<p><strong>Read <a href="/2009/marking-up-a-blog-with-html-5-part-2/">Part 2</a></strong></p>
<h3>Thanks</h3>
<p>Thanks to my colleagues and bosses at Opera for indulging me and allowing me the time to figure this out. <a href="http://lachy.id.au/log/">Lachlan Hunt</a> was patience personified, answering my endless <abbr>HTML</abbr> 5 questions. Also to Gez Lemon and Henri Sivonen for advice about the relationship between ARIA and <abbr>HTML</abbr> 5, and for letting me quote them. Finally, thanks to all those kind people on Twitter who helped me with <abbr>IE</abbr> and other pesky browsers (<a href="http://www.my-debugbar.com/wiki/IETester/HomePage">IE Tester</a> was sometimes  inaccurate, while <a href="http://browsershots.org/">browsershots</a> was down. But I don&#8217;t really trust emulators, anyway). You&#8217;re not all named above because you&#8217;re so numerous. But thanks all the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2009/redesigning-with-html-5-wai-aria/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Speeding adoption of WAI-ARIA</title>
		<link>http://www.brucelawson.co.uk/2008/speeding-adoption-of-wai-aria/</link>
		<comments>http://www.brucelawson.co.uk/2008/speeding-adoption-of-wai-aria/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 09:56:55 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[accessibility  web standards]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://www.brucelawson.co.uk/index.php/?p=824</guid>
		<description><![CDATA[The Web Accessiiblity Initiative&#8217;s Accessible Rich Internet Applications Suite, WAI-ARIA is a simple way to add information to HTML that can make Ajax applications accessible. It&#8217;s being supported by all the big four browsers and screenreaders are starting to support it. Therefore, although the specification is still formally in &#8220;Working Draft&#8221; status, the W3C are [...]]]></description>
			<content:encoded><![CDATA[<p>The Web Accessiiblity Initiative&#8217;s Accessible Rich Internet Applications Suite, <a href="http://dev.opera.com/articles/view/introduction-to-wai-aria/">WAI-ARIA</a> is a simple way to add information to HTML that can make Ajax applications accessible. It&#8217;s being supported by all the big four browsers and <a href="http://www.paciellogroup.com/blog/?p=89">screenreaders are starting to support it</a>.</p>
<p>Therefore, although the specification is still formally in &#8220;Working Draft&#8221; status, the <abbr>W3C</abbr> are encouraging authors to <a href="http://www.w3.org/WAI/aria/faq.html#do_now">use it now</a>. I plan to; it&#8217;s the only game in town to add the necessary semantics to lovable old <abbr>HTML</abbr> 4 until <abbr>HTML</abbr> 5 is widely implemented.</p>
<p>To encourage adoption, there is a mailing list called the <a href="http://groups.google.com/group/free-aria">Free ARIA google group</a> which you can read and join.</p>
<p>Opera is taking the message to the Ajax crew  at the <a href="http://ajaxexperience.techtarget.com/html/index.html">Ajax Experience conference</a> next week, and Anne Van Kesteren is presenting &#8220;<a href="http://ajaxexperience.techtarget.com/east/html/client.html#AKesterenAjax">Ajax 2.0</a>&#8221; in which he&#8217;ll introduce and demo <abbr>ARIA</abbr> (and other exciting things). </p>
<p>Speaking from my experience as a web author, though, one of the things that might slow adoption is the fact that new semantics like <abbr>ARIA</abbr> don&#8217;t validate against the old <abbr>HTML</abbr> specs. As someone who has spent half a decade badgering people about valid code, I know that lots of enlightened organisations don&#8217;t allow invalid code on their websites&mdash;and these are just the kind of thought-leaders who I&#8217;d like to see adopting <abbr>ARIA</abbr>.</p>
<p>The experimental <a href="http://validator.nu/"><abbr>HTML</abbr> 5 validator</a> has support for <abbr>ARIA</abbr> but doesn&#8217;t have the kudos of the W3C name.</p>
<p>So, I suggest that the <abbr>W3C</abbr> to add <abbr>ARIA</abbr> to the official validator. That would send a strong message about its commitment to <abbr>ARIA</abbr>, as well as allow codeshops, organisations and individuals who want validation to use it, to the immediate benefit of web users with disabilities.</p>
<p>Added Tues 30 September: Steve Faulkner, of the Paciello Group and member of the <abbr>W3C</abbr>&#8216;s Protocols and Formats Working Group has <a href="http://lists.w3.org/Archives/Public/wai-xtech/2008Sep/0381.html">asked if the <abbr>W3C</abbr> can build an  a validator that can test <abbr>(X)HTML</abbr> and <abbr>ARIA</abbr> conformance</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brucelawson.co.uk/2008/speeding-adoption-of-wai-aria/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

