<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.yuiblog.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Yahoo! User Interface Blog (YUIBlog) » Accessibility</title>
	
	<link>http://www.yuiblog.com/blog</link>
	<description>The official blog of the YUI Project.</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:51:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.yuiblog.com/yuiblog/accessibility" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="yuiblog/accessibility" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Making Search Direct Accessible</title>
		<link>http://www.yuiblog.com/blog/2011/08/08/making-search-direct-accessible/</link>
		<comments>http://www.yuiblog.com/blog/2011/08/08/making-search-direct-accessible/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 04:44:01 +0000</pubDate>
		<dc:creator>Caridy Patino</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/2011/08/04/</guid>
		<description><![CDATA[A few months ago we launched the first beta release of Search Direct. This new product explores the concept of real-time feedback, instantly delivering answers to the user with each keystroke. Given the diversity of Yahoo!&#8217;s audience, we wanted to make Search Direct as accessible as possible. Initially, we believed that this would be an [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago we launched the first beta release of Search Direct. This new product explores the concept of real-time feedback, instantly delivering answers to the user with each keystroke. Given the diversity of Yahoo!&#8217;s audience, we wanted to make Search Direct as accessible as possible. Initially, we believed that this would be an easy task since this product would be based on YUI 3, a JavaScript library with accessibility baked into its DNA. Contrary to my expectations as an engineer, this task turned out to be more difficult than we anticipated.</p>
<h3>Introducing Search Direct</h3>
<p>Although Search Direct is built from the ground up using YUI&#8217;s component infrastructure, its most visibly prominent interface is based on the <a href="http://developer.yahoo.com/yui/3/autocomplete/">YUI AutoComplete widget</a> which includes many accessibility features right out of the box. Suggestions related to a particular query are displayed in this autocomplete implementation. Search Direct also features a content panel, a.k.a. the <i>rich panel</i>, where suggestion-related content is displayed. The intention of the rich panel is to provide a direct answer to the user when a suggestion from the autocomplete list is selected.</p>
<p><a href="http://search.yahoo.com/"><img src="http://yuiblog.com/assets/accessible-search-direct/sd.jpg" alt="Search Direct Screenshot - Query: jen, Soft-selection: Jennifer Aniston" width="100%" /></a></p>
<p>A new set of suggestions is displayed in the list on every keystroke, and the first suggestion is selected by default. This default selection is called a <i>soft selection</i>. Soft selections and subsequent interactions with the suggestion list dictate the content that is rendered into the rich panel. In reality, things are a bit more complicated (performance optimizations, additional cache layers, etc), but for the sake of simplicity we can assume that this is the common workflow.</p>
<h3>Accessibility features</h3>
<p>In the quest for making Search Direct accessible, we looked at the implementation of Search Assistant, a technology that Yahoo! pioneered a few years back, as well as the native accessibility features of YUI.</p>
<p>After this investigation, three primary accessibility features were proposed for Search Direct:</p>
<ul>
<li>Using the <a href="http://developer.yahoo.com/yui/3/intl/">YUI Internationalization utility</a> to serve localized content.</li>
<li>Setting <code>role</code> and <code>aria-*</code> attributes on elements within the autocomplete widget, that need to be identified and processed by screen readers.</li>
<li>Using a hidden <code>div</code> that represents a live region (<code>aria-live</code>) to notify the user when something happens. E.g., the number of available suggestions, the selected suggestion, etc.</li>
</ul>
<p>The plan was to notify the user of any changes in the Search Direct interface, and provide a set of keyboard shortcuts to navigate the following visual components:</p>
<ul>
<li>Searchbox</li>
<li>Submit button</li>
<li>Suggestion list</li>
<li>Rich panel</li>
</ul>
<p>Sounds like a breeze, right? Well, let&#8217;s take a step back.</p>
<h3>The problem</h3>
<p>What we have here are two asynchronous processes &mdash; one of them for updating the suggestion set and the other one for retrieving corresponding answers &mdash; and they&#8217;re both <i>really</i> fast. We&#8217;re talking about 250ms end to end. Since the interface is changing at such a rapid pace, keeping track of everything can be difficult for a screen reader user. It gets an order of magnitude more complicated when updates happen in an asynchronous, near real-time manner. Because the screen reader was being notified of every change in the interface, the resulting chatter made it difficult to make sense of what was going on.</p>
<p>Lacking an acceptable solution, we started collaborating with Yahoo!&#8217;s resident accessibility guru, Victor Tsaran (<a href="http://twitter.com/#!/vick08">@vick08</a>) to try and come up with something better.</p>
<p>The first time we watched Victor interact with Search Direct, it was immediately clear to me that a majority of his focus was on the rich panel instead of the suggestion list. This was a surprise for me, as we viewed the list as the &#8220;source of truth&#8221;. During one of our sessions, we had a stroke of luck when we happened to disable all the accessibility features of the list. As soon as the noise introduced by the list was cut out, Search Direct started to make sense to Victor!</p>
<h3>How users of screen readers perceive Search Direct</h3>
<p>After realizing that we were trying to solve the wrong problem, we went back to the original user story: <i>&#8220;As a user, I can get an answer as I type&#8221;</i>. Getting the answer across to the user was the priority. After redefining the problem, we concentrated our accessibility efforts on an implementation where the screen reader prioritized the rich panel content over the suggestion list.</p>
<p>For example, if the user types <code>"miami wea"</code>, the screen reader will tell them two things:</p>
<ul>
<li>10 suggestions.</li>
<li>WEATHER MIAMI, FL. TODAY, Scattered Thunderstorms, 89°F 77°F. TOMORROW, Isolated Thunderstorms, 90°F 74°F&#8230;</li>
</ul>
<p>It will then continue reading out the rest of the rich panel content. The user doesn&#8217;t need to know all 10 suggestions up front, every time the list updates. If they do want to know, the information is readily accessible via keyboard navigation.</p>
<p>To ensure that the suggestion list is adding value to the experience, we make sure that the first phrase in the rich panel is closely related to its corresponding suggestion. For instance, based on the previous example, <code>"weather miami"</code> is the first phrase in the rich panel for the suggestion: &#8220;miami weather&#8221;.</p>
<p>Victor Tsaran, of the Yahoo! Accessibility Lab, shows how it works on FireFox with the NVDA screen reader:</p>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/Vd_W_8tIDNA" frameborder="0" allowfullscreen></iframe></p>
<p>The screen reader experience for our application is easier to follow since we now only focus on the following two visual components:</p>
<ul>
<li>Searchbox</li>
<li>Rich panel</li>
</ul>
<p>Changes to the autocomplete list as a whole are no longer tracked, and the submit button is ignored since the user can always hit enter for the current query or use a keyboard shortcut (tilda access key: <code>[control, alt or shift] + ~</code>) to switch between the input element and the rich panel. These keyboard navigation options are revealed to the user when the searchbox is acknowledged by the screen reader.</p>
<p>From an engineering perspective, this change greatly simplified things. The amount of DOM manipulation in the most active component was drastically reduced, improving the overall performance of Search Direct. Here is an example of the implementation:</p>
<p><code>
<pre>
function SDAAria () {
    var node = this._liveRegion = Y.Node.create(&#x27;&lt;div role=&quot;status&quot; class=&quot;off-screen&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;&#x27;);
    // Create the ARIA live region...
    Y.one(&#x27;body&#x27;).append(node);
    // listening for aria:live messages to update the live region
    this.on(&#x27;aria:live&#x27;, this._handlerMsg, this);
    // listening for gossip:refresh to announce how many suggestions
    this.on(&#x27;gossip:refresh&#x27;, this._handleGossipRefresh, this);
}
SDAAria.ATTRS = {
     strings: {
         valueFn: function () {
             return Y.Intl.get(&#x27;sd-aria&#x27;);
         }
     }
};
SDAAria.prototype = {
    _ariaSay: function (stringId, subs) {
        var message = this.get(&#x27;strings.&#x27; + stringId) || &#x27;&#x27;;
        this._liveRegion.setContent( subs ? Y.Lang.sub(message, subs) : message );
    },
    _handlerMsg: function (e) {
        if (e.id) {
            this._ariaSay(e.id, e.subs);
        }
    },
    _handleGossipRefresh: function () {
        var size = this.get(&#x27;suggestions&#x27;).size();
        this._ariaSay( (size &gt; 0 ? &#x27;SUGGESTIONS&#x27; : &#x27;NO_SUGGESTIONS&#x27;), {
            n: size
        });
    }
};
</pre>
<p></code></p>
<h3>Lessons learned</h3>
<p>When creating an accessible interface, it&#8217;s important to ask the right questions. Making every bit of your application accessible may not be the right approach.</p>
<p>Request early feedback from users of screen readers &mdash; don&#8217;t assume that you have your bases covered until you get some user feedback. Utilizing every tool and feature at your disposal may not have the intended effect.</p>
<p>Users of screen readers may have difficulty keeping track of real-time updates, especially if screen readers are bombarded with notifications. In these scenarios, less can be more. Identify and focus on what is important for the user instead of trying to replicate the raw experience of the application for the screen reader.</p>
<p class="authorbox"><img src="http://yuiblog.com/assets/accessible-search-direct/caridy.jpg" class="alignleft" width="259" height="266" alt="Caridy Pati&#241;o"><em><strong>About the author:</strong> Caridy Pati&#241;o, Principal Frontend for Yahoo! Search Direct. He has been a longtime YUI Contributor and creator of Bubbling Library YUI Extension, as well as guest blogger at YUIBlog.com sharing some of his extensive experience building high performance web applications. Loading strategies, event-driven architectures and SSJS are some of the subjects where Caridy spends most of his time these days.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2011/08/08/making-search-direct-accessible/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Developing an Accessible Star Ratings Widget</title>
		<link>http://www.yuiblog.com/blog/2010/08/24/developing-an-accessible-star-ratings-widget/</link>
		<comments>http://www.yuiblog.com/blog/2010/08/24/developing-an-accessible-star-ratings-widget/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 17:00:41 +0000</pubDate>
		<dc:creator>Thierry Koblentz</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=2500</guid>
		<description><![CDATA[/* * for the forms in this article */ .tjk-form {margin-bottom:3em;} /* **************************** Image Replacement Techniques **************************** * * A la Yahoo! Music * the original sprite is vertical and the styling is slightly different */ #noticias .tjk-spans span, .tjk-spans span { background:transparent url(http://yuiblog.com/assets/starTutorial/sprite.png) no-repeat scroll 0; font-size:0; height: 19px; overflow:hidden; vertical-align:middle; width: 96px; display: [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
/*
 * for the forms in this article
 */
.tjk-form {margin-bottom:3em;}
/*
 ****************************
 Image Replacement Techniques 
 ****************************
 *
 * A la Yahoo! Music
 * the original sprite is vertical and the styling is slightly different
 */
 #noticias .tjk-spans span, .tjk-spans span {
	background:transparent url(http://yuiblog.com/assets/starTutorial/sprite.png) no-repeat scroll 0; 
	font-size:0;
	height: 19px;
	overflow:hidden;
	vertical-align:middle;
	width: 96px; 
	display: block;
}
.tjk-spans em {
	display:block;
}
.tjk-spans .r15 {
	background-position:-385px 0;
}
.tjk-spans .r25 {
	background-position:-288px 0;
}
.tjk-spans .r35 {
	background-position:-192px 0;
}
.tjk-spans .r45 {
	background-position:-96px 0;
}
/*
 * TIP Method
 * http://www.tjkdesign.com/articles/tip.asp
 */
.tjk-tip span {
	position:relative;
	height:1.6em;
	width:8.1em;
	overflow:hidden;
	vertical-align:middle;
	display:block;
}
.tjk-tip img {
	position: absolute;
	width: 40.5em;
	height: 1.55em;
	top: 0;
	border:1px solid #fff;
}
.tjk-tip .r15 img {
	right:0;
}
.tjk-tip .r25 img {
	left:-24.4em;
}
.tjk-tip .r35 img {
	left:-16.2em;
}
.tjk-tip .r45 img {
	left:-8.1em;
}
/*
 * to overwrite SM styles sheet
 */
.tjk-tip img,
#tjk-une img,
#tjk-deux img,
#tjk-trois img,
#tjk-quatre img,
#tjk-cinq img,
#tjk-six img,
#tjk-sept img,
#tjk-huit img {
	margin: 0;
}
.tjk-tip {
	line-height:3;
}
/*
 ****************************
 Labels, <br />, <img> in Forms 
 ****************************
 *
 *
 * #1
 */
#tjk-une img {
	width:2.8em;
	height:1.4em;
}
/*
 * #2
 */
#tjk-deux label {
	position:relative;
}
#tjk-deux img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;	
}
/*
 * #3
 */
#tjk-trois label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	display:block;
}
#tjk-trois img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;		
}
/*
 * #4
 */
#tjk-quatre br {
	display:none;
}
#tjk-quatre label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	float:left;
}
#tjk-quatre img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;
}
/*
 * #5
 */
#tjk-cinq br {
	display:none; 
}
#tjk-cinq label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	float:left;
}
#tjk-cinq img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;
}
#tjk-cinq .no_star img {
	left:-1.4em;
}
/*
 * #6
 */
#tjk-six br {
	display:none; 
} 
#tjk-six label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	float:left;
	background:teal;
	margin-right:1px;
	text-indent:-999em; /* this also remmoves the jump of the stars on focus */
}
#tjk-six img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;
}
#tjk-six .no_star img {
	left:-1.4em;
}
#tjk-six label.no_star {
	background:#ccc;
}
/*
 * #7
 */
#tjk-sept br {
	display:none; 
} 
#tjk-sept label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	float:left;
	background:teal;
	margin-right:1px;
	text-indent:-999em; 
}
#tjk-sept img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;
	cursor: pointer;
}
#tjk-sept .no_star img {
	left:-1.4em;
}
#tjk-sept label.no_star {
	background:#ccc;
}
/*
 * of course this does not work in IE6 
 * Opera lets the background color bleed through 
 */
#tjk-sept label:hover {
	opacity:.5;
	filter:alpha(opacity=50);
}
#tjk-sept fieldset {
	border:0;
}
#tjk-sept legend {
	text-indent:-999em;
}
/*
 * #8
 */
#tjk-huit br {
	display:none; 
} 
#tjk-huit label {
	position:relative;
	height:1.4em;
	width:1.4em;
	overflow:hidden;
	float:left;
	background:teal;
	margin-right:1px;
	text-indent:-999em; 
}
#tjk-huit img {
	width:2.8em;
	height:1.4em;
	position:absolute;
	top:0;
	left:0;
}
#tjk-huit .no_star img {
	left:-1.4em;
}
#tjk-huit label.no_star {
	background:#ccc;
}
#tjk-huit fieldset {
	border:0;
}
#tjk-huit legend {
	text-indent:-999em;
}
</style>
<p>In a hurry? Skip to the <a href="http://tjkdesign.com/lab/stars/demo.html">demo page</a>.</p>
<p>Many ecommerce sites, social networking services, and online communities include rating or assessment features. Soliciting people&#8217;s opinion has even become a business model; there are now  sites dedicated to rating products, services, businesses, and more.</p>
<p>The most common interface used to display votes is the &#8220;star rating system,&#8221; in which a particular number of points (often expressed as stars) is assigned to an item by each reviewer. We find this model on many sites, from Amazon to Yelp.</p>
<div class="figure">
<img src="http://yuiblog.com/assets/star-examples-20100823-131202.jpg" width="501" height="284" alt="Examples of star rating systems"></p>
<p class="legend">Figure A. Star rating examples from <a href="http://www.amazon.com">Amazon</a> and <a href="http://www.yelp.com">Yelp</a>.</p>
</div>
<p>As <a href="#A">Figure A</a> shows, both visual interfaces are similar, but what makes these two solutions <em>interesting</em> is their markup base. One relies on <code>&lt;map&gt;</code>, the other on <code>&lt;img&gt;</code>.</p>
<p>You might think that most rating systems would be based on some markup proven to be semantic and &quot;operational&quot; across many User Agents — that is, that rating systems would be based on a specific set of HTML elements and attributes to which one applies behavior and style via JS and CSS. That would make sense, but it is far from the truth. When it comes to markup, authors try just about everything:</p>
<ul>
<li><code>&lt;a&gt;</code>,</li>
<li><code>&lt;img&gt;</code>,</li>
<li><code>&lt;span&gt;</code>,</li>
<li><code>&lt;li&gt;</code>,</li>
<li><code>&lt;map&gt;</code>,</li>
<li><code>&lt;div&gt;</code>,</li>
<li><code>&lt;input&gt;</code>,</li>
<li>and more&#8230;</li>
</ul>
<h3>The case of Microformats</h3>
<p>Before presenting a few image-based techniques to mark up ratings, I think it is worth mentioning a basic and straightforward approach (from <a href="http://microformats.org/wiki/hreview">Microformats</a>) that uses <em>characters</em>:</p>
<pre><code>&lt;abbr class=&quot;rating&quot; title=&quot;3 stars&quot;&gt;***&lt;/abbr&gt;</code></pre>
<dl>
<dt>Pros</dt>
<dd>It is straightforward and semantic.</dd>
<dd>The markup is minimal.</dd>
<dd>The method is not reliant on <abbr title="Cascading Styles Sheet">CSS</abbr>.</dd>
<dd>The method is not reliant on images.</dd>
<dd>There is no HTTP request.</dd>
<dt>Cons</dt>
<dd>It is impossible to represent half values (i.e. 3.5 stars)</dd>
<dd>It &quot;works&quot; only with asterisks (&quot;star rating&quot;).</dd>
<dd>Screen-readers, by default, do not expand abbreviations (which may not be a big deal in this case).</dd>
</dl>
<p><em>Note</em>: I use &quot;*&quot; rather than &#9733; (&#9733;) because screen-readers (at least <a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">JAWS</a> and <a href="http://www.nvda-project.org/">NVDA</a>) seem to ignore html entities.</p>
<h3>Markup to <em>display</em> image-based ratings</h3>
<p>When it comes to display images, authors have many options.</p>
<h4>One image per rating</h4>
<p>Using a single image:</p>
<pre><code>&lt;img src=&quot;4stars.png&quot; alt=&quot;4 out of five&quot;&gt;</code></pre>
<dl>
<dt>One star</dt>
<dd><img src="http://yuiblog.com/assets/starTutorial/1-star.png" alt="1 out of five"></dd>
<dt>Two stars</dt>
<dd><img src="http://yuiblog.com/assets/starTutorial/2-stars.png" alt="2 out of five"></dd>
<dt>Three stars</dt>
<dd><img src="http://yuiblog.com/assets/starTutorial/3-stars.png" alt="3 out of five"></dd>
<dt>Four stars</dt>
<dd><img src="http://yuiblog.com/assets/starTutorial/4-stars.png" alt="4 out of five"></dd>
<dt>Five stars</dt>
<dd><img src="http://yuiblog.com/assets/starTutorial/5-stars.png" alt="5 out of five"></dd>
</dl>
<dl>
<dt>Pros</dt>
<dd>Using one image per rating is straightforward and semantic.</dd>
<dd>The method is not reliant on <abbr>CSS</abbr>.</dd>
<dd>Minimal markup.</dd>
<dt>Cons</dt>
<dd>It creates many HTTP requests as there are many different images.</dd>
<dd>On top of the performance issue, it can be a maintenance nightmare as authors have to deal with <em>more</em> assets (images to create, to push to a CDN, to modify when site colors change, etc.).</dd>
<dd>Text selection <em>is not possible</em> in Opera (at least in version 9.52) as the <em>alternate text</em> is ignored</dd>
</dl>
<h4>One image per unit</h4>
<p>From the <abbr title="Web Hypertext Application Technology Working Group">whatwg</abbr>&#8216;s <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-0.html#a-group-of-images-that-form-a-single-larger-picture-with-no-links">working draft</a>: </p>
<pre><code>&lt;img alt=&quot;4 out of 5&quot; src=&quot;one-star.png&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;one-star.png&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;one-star.png&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;one-star.png&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;no-star.png&quot;&gt;</code></pre>
<dl>
<dt>One star</dt>
<dd> <span class="rating"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt="1 out of five"> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> </span> </dd>
<dt>Two stars</dt>
<dd> <span class="rating"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt="2 out of five"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> </span> </dd>
<dt>Three stars</dt>
<dd> <span class="rating"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt="3 out of five"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> </span> </dd>
<dt>Four stars</dt>
<dd> <span class="rating"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt="4 out of five"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/no-star.png" alt=""> </span> </dd>
<dt>Five stars</dt>
<dd> <span class="rating"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt="5 out of five"> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> <img src="http://yuiblog.com/assets/starTutorial/one-star.png" alt=""> </span> </dd>
</dl>
<dl>
<dt>Pros</dt>
<dd>Using two <code>img</code> elements per rating diminishes the number of HTTP requests.</dd>
<dd>The method is not reliant on <abbr>CSS</abbr>.</dd>
<dt>Cons</dt>
<dd>In Opera, when images are disabled, <em>alternate text</em> is not selectable, and (in small-screen view) that text is rendered with a border which makes it less legible.</dd>
</dl>
<p>Note that this is taken from a <em>controversial working draft</em>. In my opinion, this method is not acceptable because the alternate text does not describe the image <em>accurately</em> and succinctly. Besides, if the basis of this approach is that these images represent content, then why leave some of them with <em>no</em> <code>alt</code> text?</p>
<p> On <a href="http://ajaxian.com/">Ajaxian</a>, for example, the author is using alternate text with <em>every single image</em>, which makes a lot of sense if he considers that <em>each one is content</em>: </p>
<pre><code>&lt;img [snip] alt=&quot;+&quot; src=&quot;star1.png&quot;/&gt;
&lt;img [snip] alt=&quot;+&quot; src=&quot;star1.png&quot;/&gt;
&lt;img [snip] alt=&quot;+&quot; src=&quot;star1.png&quot;/&gt;
&lt;img [snip] alt=&quot;-&quot; src=&quot;star0.png&quot;/&gt;
&lt;img [snip] alt=&quot;-&quot; src=&quot;star0.png&quot;/&gt;</code></pre>
<p>In any case, using as many images as there are stars versus using a single element (an <code>img</code> or  something else) has the main advantage of facilitating voting mechanisms &#8211; where a user selects one of the stars to cast his vote. So we should keep this in mind&#8230;</p>
<h4>A sprite for background images</h4>
<p>The following technique is a adaptation of a strategy originally implemented by developers at <a href="http://new.music.yahoo.com/">Yahoo! Music</a>:</p>
<h5>Markup</h5>
<pre><code>&lt;span class=&quot;rating r1 stars&quot;&gt;1 of 5&lt;/span&gt;
&lt;span class=&quot;rating r2 stars&quot;&gt;2 of 5&lt;/span&gt;
&lt;span class=&quot;rating r3 stars&quot;&gt;3 of 5&lt;/span&gt;
&lt;span class=&quot;rating r4 stars&quot;&gt;4 of 5&lt;/span&gt;
&lt;span class=&quot;rating r5 stars&quot;&gt;5 of 5&lt;/span&gt;
</code></pre>
<h5>CSS</h5>
<pre><code>.stars {
  background: transparent url(img/sprite.png) no-repeat;
}
.rating {
  font-size: 0;
  height: 19px;
  overflow: hidden;
  vertical-align: middle;
  width: 96px;
  display: block;
}
.r1 { background-position: -385px 0; }
.r2 { background-position: -288px 0; }
.r3 { background-position: -192px 0; }
.r4 { background-position: -96px 0; }</code></pre>
<dl class="tjk-spans">
<dt>One star</dt>
<dd><span class="r15"><em>1 of 5</em></span></dd>
<dt>Two stars</dt>
<dd><span class="r25"><em>2 of 5</em></span></dd>
<dt>Three stars</dt>
<dd><span class="r35"><em>3 of 5</em></span></dd>
<dt>Four stars</dt>
<dd><span class="r45"><em>4 of 5</em></span></dd>
<dt>Five stars</dt>
<dd><span class="r55"><em>5 of 5</em></span></dd>
</dl>
<dl>
<dt>Pros</dt>
<dd>This method requires a single HTTP request as it relies on a single sprite image.</dd>
<dd>Minimal &quot;foot print&quot;.</dd>
<dt>Cons</dt>
<dd>Content is not revealed with images off.</dd>
<dd>Nothing shows  when the page is printed (a print stylesheet could take care of this issue). </dd>
<dd>In Opera, the high contrast stylesheet makes all the stars disappear; the same is true in <a href="http://www.artzstudio.com/2010/04/img-sprites-high-contrast/">High Contrast Mode Optimization</a>.</dd>
<dd>Text selection is possible, but it&#8217;s not obvious (via highlighting).</dd>
</dl>
<h4>A sprite in the markup</h4>
<p>This approach is based on the <a href="http://tjkdesign.com/articles/how-to_use_sprites_with_my_Image_Replacement_technique.asp">TIP method</a>, which uses a <a href="http://tjkdesign.com/lab/stars/img/sprite.gif">sprite image</a> as an <code>&lt;img&gt;</code> element rather than a background image:</p>
<h5>Markup</h5>
<pre><code>&lt;span title=&quot;1 of 5&quot; class=&quot;rating r1&quot;&gt;&lt;img width=&quot;0&quot; height=&quot;1&quot; src=&quot;sprite.gif&quot; alt=&quot;&quot;/&gt;1 out of 5&lt;/span&gt;
&lt;span title=&quot;2 of 5&quot; class=&quot;rating r2&quot;&gt;&lt;img width=&quot;0&quot; height=&quot;1&quot; src=&quot;sprite.gif&quot; alt=&quot;&quot;/&gt;2 out of 5&lt;/span&gt;
&lt;span title=&quot;3 of 5&quot; class=&quot;rating r3&quot;&gt;&lt;img width=&quot;0&quot; height=&quot;1&quot; src=&quot;sprite.gif&quot; alt=&quot;&quot;/&gt;3 out of 5&lt;/span&gt;
&lt;span title=&quot;4 of 5&quot; class=&quot;rating r4&quot;&gt;&lt;img width=&quot;0&quot; height=&quot;1&quot; src=&quot;sprite.gif&quot; alt=&quot;&quot;/&gt;4 out of 5&lt;/span&gt;
&lt;span title=&quot;5 of 5&quot; class=&quot;rating r5&quot;&gt;&lt;img width=&quot;0&quot; height=&quot;1&quot; src=&quot;sprite.gif&quot; alt=&quot;&quot;/&gt;5 out of 5&lt;/span&gt;
</code></pre>
<h5>CSS</h5>
<pre><code>.rating {
  position: relative;
  height: 1.6em;
  width: 8.1em;
  overflow: hidden;
  vertical-align: middle;
  display: block;
}
.rating img {
  position: absolute;
  width: 40.5em;
  height: 1.55em;
  top: 0;
  border: 1px solid #fff;
}
.r1 img { right: 0; }
.r2 img { left: -24.4em; }
.r3 img { left: -16.2em; }
.r4 img { left: -8.1em; }
</code></pre>
<dl class="tjk-tip">
<dt>One star</dt>
<dd><span title="1 out of 5" class="r15"><img width="0" height="1" src="http://yuiblog.com/assets/starTutorial/sprite.gif" alt="">1 out of 5</span></dd>
<dt>Two stars</dt>
<dd><span title="2 out of 5" class="r25"><img width="0" height="1" src="http://yuiblog.com/assets/starTutorial/sprite.gif" alt="">2 out of 5</span></dd>
<dt>Three stars</dt>
<dd><span title="3 out of 5" class="r35"><img width="0" height="1" src="http://yuiblog.com/assets/starTutorial/sprite.gif" alt="">3 out of 5</span></dd>
<dt>Four stars</dt>
<dd><span title="4 out of 5" class="r45"><img width="0" height="1" src="http://yuiblog.com/assets/starTutorial/sprite.gif" alt="">4 out of 5</span></dd>
<dt>Five stars</dt>
<dd><span title="5 out of 5" class="r55"><img width="0" height="1" src="http://yuiblog.com/assets/starTutorial/sprite.gif" alt="">5 out of 5</span></dd>
</dl>
<dl>
<dt>Pros</dt>
<dd>This method requires a single HTTP request.</dd>
<dd>This technique is the only one of the four methods above that <em>reveals</em> content when  Firefox users select &quot;hide images&quot; or &quot;make images invisible&quot; (from the developer&#8217;s toolbar).</dd>
<dd>When images are unavailable a red &quot;x&quot; appears only in the highest rating (i.e. 5 out of 5) instead of in each one as it is the case with other solutions that rely on <code>img</code> elements.</dd>
<dt>Cons</dt>
<dd>The display of images is reliant on <abbr>CSS</abbr>.</dd>
</dl>
<p> It is worth noting that unlike other Image Replacement techniques, this method allows:</p>
<ul>
<li> images to <em>scale</em> depending on text-size settings.</li>
<li>images to be <em>printed</em>.</li>
<li> alternate text to be easily <em>selected</em> as the whole image appears highlighted (Firefox). </li>
<li>the image to not disappear in a high-contrast setting/stylesheet.</li>
<li>alternate text selection in Opera (when images are disabled).</li>
<li>borderless alternate text in Opera&#8217;s small screen view.</li>
</ul>
<h3>Markup to <em>cast</em> votes</h3>
<h4>Starting with a native mechanism</h4>
<p>To <em>cast votes</em>, we need  a low-level voting mechanism that allows  simple user selection and submission. For this, we can rely on using a form with labels and controls: </p>
<h5>Markup</h5>
<pre><code>&lt;fieldset&gt;
  &lt;legend&gt;Rating&lt;/legend&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;1_5&quot;&gt;1/5&lt;/label&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;2_5&quot;&gt;2/5&lt;/label&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;3_5&quot;&gt;3/5&lt;/label&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;4_5&quot;&gt;4/5&lt;/label&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;5_5&quot;&gt;5/5&lt;/label&gt;
&lt;/fieldset&gt;</code></pre>
<h5>Result</h5>
<form class="tjk-form"  name="form_1" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><br />
<input type="radio" name="movie" value="1_5">1/5</label><br />
<label><br />
<input type="radio" name="movie" value="2_5">2/5</label><br />
<label><br />
<input type="radio" name="movie" value="3_5">3/5</label><br />
<label><br />
<input type="radio" name="movie" value="4_5">4/5</label><br />
<label><br />
<input type="radio" name="movie" value="5_5">5/5</label><br />
</fieldset>
</form>
<h4>Adding breaks and whitespace</h4>
<p>For better legibility, we add <code>&lt;br&gt;</code> and whitespace.</p>
<h5>Markup</h5>
<pre><code>&lt;fieldset&gt;  &lt;legend&gt;Rating&lt;/legend&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;1_5&quot;&gt; 1/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;2_5&quot;&gt; 2/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;3_5&quot;&gt; 3/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;4_5&quot;&gt; 4/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;5_5&quot;&gt; 5/5&lt;/label&gt;
&lt;/fieldset&gt;</code></pre>
<h5>Result</h5>
<form class="tjk-form"  name="form_2" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h4>Introducing the sprite image in the markup</h4>
<p>For this solution, we are using a smaller sprite than the one in the example above. It is now composed of <a href="http://tjkdesign.com/lab/stars/img/small-sprite.gif">two single stars</a> (&#8220;on&#8221; and &#8220;off&#8221;).</p>
<p>We place <code>img</code> elements inside the labels. We assume they will have no value without CSS support, thus we &quot;hide&quot; them by setting specific dimensions via their <code>width</code> and <code>height</code> attributes. Note that using <code>0</code> with both attributes would show a broken image in some <abbr title="User Agent">UA</abbr>s.</p>
<pre><code>
&lt;form ...&gt;
  &lt;fieldset&gt;
    &lt;legend&gt;Rating&lt;/legend&gt;
    &lt;label class=&quot;one&quot; title=&quot;1 out of 5&quot;&gt;&lt;input name=&quot;LandOf&quot; value=&quot;1&quot; checked=&quot;checked&quot; type=&quot;radio&quot;&gt; 1/5&lt;img src=&quot;star-sprite.gif&quot; alt=&quot;&quot; height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/label&gt;
    &lt;label class=&quot;two&quot; title=&quot;2 out of 5&quot;&gt;&lt;input name=&quot;LandOf&quot; value=&quot;2&quot; type=&quot;radio&quot;&gt; 2/5&lt;img src=&quot;star-sprite.gif&quot; alt=&quot;&quot; height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/label&gt;
    &lt;label class=&quot;three&quot; title=&quot;3 out of 5&quot;&gt;&lt;input name=&quot;LandOf&quot; value=&quot;3&quot; type=&quot;radio&quot;&gt; 3/5&lt;img src=&quot;star-sprite.gif&quot; alt=&quot;&quot; height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/label&gt;
    &lt;label class=&quot;four&quot; title=&quot;4 out of 5&quot;&gt;&lt;input name=&quot;LandOf&quot; value=&quot;4&quot; type=&quot;radio&quot;&gt; 4/5&lt;img src=&quot;star-sprite.gif&quot; alt=&quot;&quot; height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/label&gt;
    &lt;label class=&quot;five&quot; title=&quot;5 out of 5&quot;&gt;&lt;input name=&quot;LandOf&quot; value=&quot;5&quot; type=&quot;radio&quot;&gt; 5/5&lt;img src=&quot;star-sprite.gif&quot; alt=&quot;&quot; height=&quot;0&quot; width=&quot;0&quot;&gt;&lt;/label&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;</code></pre>
<p>Note that with the above markup, we can expect (in most browsers) field selection via label selection.</p>
<h5>Considering Accessibility</h5>
<p>Unfortunately, <em>as is</em>, this markup creates issues in at least two screen-readers: <a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">JAWS</a> and <a href="http://www.nvda-project.org/">NVDA</a> (see <a href="http://public.yahoo.com/~thierryk/test-case/implicit-labeling-and-attributes.html">test case</a> for these bugs). The problem is  related to the use of a <code>title</code> attribute and an empty string for alternate text. </p>
<p>The workaround to not confuse screen-reader users is to use &quot;stars&quot; as alternate text (<code>alt</code>) and use JavaScript to insert <code> title</code> on <em>mouseover</em>. </p>
<h5>Better Markup</h5>
<pre><code>&lt;fieldset&gt;  &lt;legend&gt;Rating&lt;/legend&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;1_5&quot;&gt; 1/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;2_5&quot;&gt; 2/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;3_5&quot;&gt; 3/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;4_5&quot;&gt; 4/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;5_5&quot;&gt; 5/5&lt;/label&gt;
&lt;/fieldset&gt; </code></pre>
<h5>Result</h5>
<form class="tjk-form" name="form_trois" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h3>Styling</h3>
<h4>Giving dimensions to the image via CSS</h4>
<p>We use <code>em</code>  to allow the image to grow or shrink depending on font-size.</p>
<h5>Markup</h5>
<p>Unchanged</p>
<h5>CSS</h5>
<pre><code>img {
  width:2.8em;
  height:1.4em;
}</code></pre>
<h5>Result</h5>
<form class="tjk-form" id="tjk-une" name="tjk-une" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<p>As you can see already, clicking on an image selects the corresponding radio button. There is no need for scripting as implicit labeling produces this behavior (except in IE).</p>
<h4>Removing the image from the flow</h4>
<p>Styling the <code>label</code> with <code>position:relative</code> and the image with <code>position:absolute</code> with <code>top</code>/<code>left</code> values is enough to hide <code>input</code> and text inside the labels.</p>
<h5>Markup</h5>
<p>Unchanged</p>
<h5>CSS</h5>
<pre><code><ins>label {</ins>
  <ins>position:relative;
}</ins>
img {
  width:2.8em;
  height:1.4em;
  <ins>position:absolute;</ins>
  <ins>top:0;</ins>
  <ins>left:0;</ins>
}</code></pre>
<h5>Result</h5>
<form class="tjk-form" id="tjk-deux" name="tjk-deux" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h4>Displaying one star per label</h4>
<p>We style the label so its dimensions match the height and width of a single star.</p>
<h5>Markup</h5>
<p>Unchanged</p>
<h5>CSS</h5>
<pre><code>label {
  position:relative;
  <ins>height:1.4em;
</ins>  <ins>width:1.4em;
</ins>  <ins>overflow:hidden;
</ins>  <ins>display:block;</ins>
}
img {
  width:2.8em;
  height:1.4em;
  position:absolute;
  top:0;
  left:0;
}</code></pre>
<h5>Result</h5>
<form class="tjk-form" id="tjk-trois" name="tjk-trois" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h4>Displaying the stars horizontally</h4>
<p>We remove the <code>br</code>s and we float  the labels.</p>
<h5>Markup</h5>
<p>Unchanged</p>
<h5>CSS</h5>
<pre><code><ins>br {
</ins>  <ins>display:none;
}</ins>
label {
  position:relative;
  height:1.4em;
  width:1.4em;
  overflow:hidden;
  <del>display:block;</del>
  <ins>float:left;</ins>
}
img {
  width:2.8em;
  height:1.4em;
  position:absolute;
  top:0;
  left:0;
}</code></pre>
<h5>Result</h5>
<form class="tjk-form" id="tjk-quatre" name="tjk-quatre" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h4>Displaying the sprite image depending on rating</h4>
<p>To set a &quot;3 out of 5&quot; rating, we  apply the same class  to the last two labels. This class will shift the position of the image inside the label.</p>
<h5>Markup</h5>
<pre><code>&lt;fieldset&gt;
&lt;legend&gt;Rating&lt;/legend&gt;
&lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;1_5&quot;&gt; 1/5&lt;/label&gt;&lt;br&gt;
&lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;2_5&quot;&gt; 2/5&lt;/label&gt;&lt;br&gt;
&lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;3_5&quot;&gt; 3/5&lt;/label&gt;&lt;br&gt;
&lt;label <ins>class=&quot;no_star&quot;</ins>&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;4_5&quot;&gt; 4/5&lt;/label&gt;&lt;br&gt;
&lt;label <ins>class=&quot;no_star&quot;</ins>&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;5_5&quot;&gt; 5/5&lt;/label&gt;
&lt;/fieldset&gt;</code></pre>
<h5>CSS</h5>
<pre><code>br {
  display:none;
}
label {
  position:relative;
  height:1.4em;
  width:1.4em;
  overflow:hidden;
  float:left;
}
img {
  width:2.8em;
  height:1.4em;
  position:absolute;
  top:0;
  left:0;
}
<ins>.no_star img {
</ins>  <ins>left:-1.4em;
}</ins></code></pre>
<h5>Result</h5>
<form class="tjk-form" id="tjk-cinq" name="tjk-cinq" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
</form>
<h4>Not relying on image alone to display information</h4>
<p>It&#8217;s important to offer an alternative to the display of stars in case images are not available. This is because  labels and  radio buttons are styled to be on top of each other. A simple solution is to move <code>input</code> and text off-screen (i.e. using <code>text-indent:-999em</code>) and apply a background color to the labels.</p>
<h5>Markup</h5>
<p>No change</p>
<h5>CSS</h5>
<pre><code>br {
  display:none;
}
label {
  position:relative;
  height:1.4em;
  width:1.4em;
  overflow:hidden;
  float:left;
  <ins>background:teal;
</ins>  <ins>margin-right:1px;
</ins>  <ins>text-indent:-999em;</ins>
}
img {
  width:2.8em;
  height:1.4em;
  position:absolute;
  top:0;
  left:0;
}
<ins>.no_star {
</ins>  <ins>background:#ccc;
}</ins>
.no_star img {
  left:-1.4em;
}</code></pre>
<p><em>Note</em>:</p>
<ul>
<li><code>text-indent</code> also fixes a upwards jump of the image each time the  controls get focus.</li>
<li>the right margin is to make sure background colors create squares and not rectangles (which would happen with adjacent labels  sharing the same background color).</li>
</ul>
<h5>Result</h5>
<form class="tjk-form" id="tjk-six" name="tjk-six" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h4>Finishing touch</h4>
<ul>
<li>We use the pseudo-class <code>:hover</code> to create some rollover effect,</li>
<li>We hide the fieldset border,</li>
<li>We hide the legend,</li>
<li>We style the cursor.</li>
</ul>
<h5>Markup</h5>
<p>Unchanged</p>
<h5>CSS</h5>
<pre><code>br {
  display:none;
}
label {
  position:relative;
  height:1.4em;
  width:1.4em;
  overflow:hidden;
  float:left;
  background:teal;
  margin-right:1px;
  text-indent:-999em;
}
input {
  position:absolute;
  left:-999em;
  top:.5em;
}
img {
  width:2.8em;
  height:1.4em;
  position:absolute;
  top:0;
  left:0;
  <ins>cursor: pointer;</ins>
}
.no_star {
  background:#ccc;
}
.no_star img {
  left:-1.4em;
}
<ins>label:hover {
</ins>  <ins>opacity:.5;
</ins>  <ins>filter:alpha(opacity=50);
}
fieldset {
</ins>  <ins>border:0;
}
legend {
</ins>  <ins>text-indent:-999em;
}</ins></code></pre>
<p><em>Note</em>: <code>label:hover</code> is ignored by IE6 and in Opera the background color bleeds through the images. In the <a href="http://tjkdesign.com/lab/stars/demo.html">demo page</a>, instead of using <code>opacity</code>, I am using a <a href="http://yuiblog.com/assets/starTutorial/star-sprite.gif">different sprite</a> that shows four states.</p>
<h4>Result</h4>
<form class="tjk-form" id="tjk-sept" name="tjk-sept" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5"> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5"> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5"> 3/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5"> 4/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5"> 5/5</label><br />
</fieldset>
</form>
<h3>Displaying the ratings without allowing user interaction</h3>
<p>We can make the ratings &quot;read-only&quot; by adding <code>disabled</code> and <code>checked</code> attributes in the appropriate <code>input</code> fields. </p>
<h4>Markup</h4>
<pre><code>&lt;fieldset&gt;
  &lt;legend&gt;Rating&lt;/legend&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;1_5&quot; <ins>disabled</ins>&gt; 1/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;2_5&quot; <ins>disabled</ins>&gt; 2/5&lt;/label&gt;&lt;br&gt;
  &lt;label&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;3_5&quot; checked=&quot;<ins>checked</ins>&quot;&gt; 3/5&lt;/label&gt;&lt;br&gt;
  &lt;label class=&quot;no_star&quot;&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;4_5&quot; <ins>disabled</ins>&gt; 4/5&lt;/label&gt;&lt;br&gt;
  &lt;label class=&quot;no_star&quot;&gt;&lt;img src=&quot;img/small-sprite.gif&quot;  width=&quot;0&quot; height=&quot;1&quot; alt=&quot;stars&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;movie&quot; value=&quot;5_5&quot; <ins>disabled</ins>&gt; 5/5&lt;/label&gt;
&lt;/fieldset&gt; </code></pre>
<h4>CSS</h4>
<p>The rule using <code>:hover</code> has been removed</p>
<p>h4>Result</h4>
<form class="tjk-form" id="tjk-huit" name="tjk-huit" action="" method="post">
<fieldset>
<legend>Rating</legend>
<p><label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="1_5" disabled> 1/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="2_5" disabled> 2/5</label><br />
<label><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="3_5" checked="checked"> 3/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="4_5" disabled> 4/5</label><br />
<label class="no_star"><img src="http://yuiblog.com/assets/starTutorial/small-sprite.gif"  width="0" height="1" alt="stars"><br />
<input type="radio" name="movie" value="5_5" disabled> 5/5</label><br />
</fieldset>
</form>
<h3>Giving more thought to the process</h3>
<p>At this point, it is possible to cast votes without script support, but sighted users have no clue about their selection. So we use JavaScript to:</p>
<ul>
<li>give feedback to the user regarding his selection,</li>
<li>give keyboard users a visual clue while they navigate through the radio buttons. </li>
</ul>
<p>At the same time, we take advantage of using a script to insert <code>title</code> attributes that will create &quot;tooltips&quot; when users hover over the labels/stars.</p>
<p>Because of  the lack of feedback regarding selection without JavaScript, we style labels and form controls <em>only</em> if there is script support. To do so we use JavaScript to set a flag on the <code>html</code> element and then we create a rule based on descendant selectors containing that hook. If the flag is missing, that rule does not apply and elements are <strong>not</strong> styled.</p>
<p class="next">This is the <a href="http://tjkdesign.com/lab/stars/demo.html">demo page</a>, the final product.  To see how this solution behaves according to various settings, you may want to use your favorite developer tools to increase text-size, break image paths, disable JavaScript, turn CSS off, and more&#8230;</p>
<h3>Wrap up</h3>
<p>Coming up with a &quot;acceptable&quot; solution requires  to identify  users&#8217; needs, User Agents&#8217; peculiarities, User Agents&#8217; settings and  more &#8211; which means extensive testing. </p>
<p>In this process, users&#8217; feedback is essential because  following best practices is not always a sure thing. For example, as mentioned earlier, setting no value for the <code>alt</code> attribute of the images within the labels seem to be the safe thing to do, but it turns out that it creates issues with at least two screenreaders (see <a title="TITLE and ALT create issues in JAWS and NVDA" href="http://public.yahoo.com/~thierryk/test-case/implicit-labeling-and-attributes.html">test case</a>). </p>
<p>Also, feedback from assistive devices&#8217; users allows to ignore some validation error messages &#8211; as the one that the Firefox Accessibility Toolbar   reports (according to <a href="http://bestpractices.cita.uiuc.edu/html/nav/form/">http://bestpractices.cita.uiuc.edu/html/nav/form/</a>). </p>
<p>The goal here was not to fix everything, though. Being able to cast votes without a pointing device was one of my priorities, but  improving the look and feel of the solution in Opera when images are disabled is not something I consider essential.</p>
<p>The most interesting part of this &quot;journey&quot; was to make the solution accessible to many users under various conditions, addressing issues such as:</p>
<ul>
<li>images off,</li>
<li>javascript off,</li>
<li> CSS off,</li>
<li>a combination of the above.</li>
</ul>
<p>It is also nice to know that this technique relies on <code>img</code> elements rather than background images, which allows the stars to:</p>
<ul>
<li> resize themselves according to the user&#8217;s settings, </li>
<li>show in high contrast mode,</li>
<li>be printed by default (unlike background images). </li>
</ul>
<p>All of this comes without sacrificing performance, as this solution relies on this single sprite: <img alt="stars" src="http://yuiblog.com/assets/starTutorial/star-sprite.gif"></p>
<h3>Late finding</h3>
<p>I recently discovered the system Amazon has built for its voting page. It is quite interesting as they serve a <em>different</em> solution depending on script support. If there is script support, they use an image <code>&lt;map&gt;</code> (interesting approach), if there is no script support they use <strong>radio buttons</strong>. In both cases, the solution is <em>accessible</em> to keyboard users, and this helps to maximize access to a feature that is a core differentiator for the Amazon platform.</p>
<p>Note that they do not use JavaScript to <em>replace</em> the radio buttons with a image <code>&lt;map&gt;</code>; instead, they use <code>noscript</code> elements in which table markup contains radio buttons.</p>
<h3>&quot;Out of the box&quot; solutions</h3>
<dl>
<dt>Dreamweaver<sup>&reg;</sup></dt>
<dd><a href="http://labs.adobe.com/technologies/spry/samples/rating/RatingSample.html">Spry Rating Widget</a></dd>
<dt>YUI</dt>
<dd><a href="http://www.unessa.net/en/hoyci/projects/yui-star-rating/">Star Rating Script for YUI</a></dd>
<dd><a href="http://www.devseo.co.uk/blog/view/star-rating-script-with-yui">Star Rating script with YUI</a></dd>
<dt>JQuery</dt>
<dd><a href="http://www.javascriptplugins.com/framework/jquery/half-star-rating-plugin/">Half-Star Rating Plugin</a></dd>
<dd><a href="http://www.javascriptplugins.com/framework/jquery/jquery-ajax-rater/">jQuery Ajax Rater</a></dd>
<dd><a href="http://www.javascriptplugins.com/framework/jquery/simple-star-rating-system/">Simple Star Rating System</a></dd>
<dd><a href="http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/">5 star rating system in PHP, MySQL and jQuery</a></dd>
<dt>WordPress</dt>
<dd><a href="http://www.blogperfume.com/plugin-gd-star-rating-system-for-wordpress/">GD Star Rating System for WordPress</a></dd>
<dd><a href="http://wordpress.org/extend/plugins/gd-star-rating/">GD Star Rating</a></dd>
<dd><a href="http://www.channel-ai.com/blog/plugins/star-rating/">Star Rating for Reviews</a></dd>
<dt>Flash</dt>
<dd><a href="http://www.adriantnt.com/products/rating_system/?gclid=CL3Vm--7oKECFSCjiQodwxTvyA">5 Star rating system component</a></dd>
<dt>Misc.</dt>
<dd><a href="http://nofunc.org/AJAX_Star_Rating/">How a star rating should be</a></dd>
<dd><a href="http://www.duarte.com/starry/">Starry widget 2</a></dd>
</dl>
<h3>Special thanks</h3>
<p>Special thanks to Victor Tsaran and Todd Kloots for their valuable feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2010/08/24/developing-an-accessible-star-ratings-widget/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>YUI Theater — Nicholas Zakas and Victor Tsaran: “Accessibility on the Yahoo Homepage (58 min.)”</title>
		<link>http://www.yuiblog.com/blog/2010/08/16/video-zakas-tsaran/</link>
		<comments>http://www.yuiblog.com/blog/2010/08/16/video-zakas-tsaran/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 20:53:52 +0000</pubDate>
		<dc:creator>Allen Rabinovich</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[YUI Theater]]></category>
		<category><![CDATA[bayjax]]></category>
		<category><![CDATA[nicholas zakas]]></category>
		<category><![CDATA[victor tsaran]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=2425</guid>
		<description><![CDATA[In June, Yahoo! hosted a BayJax meetup dedicated to web accessibility. Nicholas Zakas, Yahoo! homepage developer, and Victor Tsaran, Yahoo! senior accessibility program manager, gave a talk on the process of making Yahoo!&#8217;s homepage highly accessible. We apologize for the uneven audio levels: there were technical issues with the microphones that we unfortunately were only [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yui/theater/video.php?v=zakas-tsaran"><img src="http://yuiblog.com/assets/zakas-tsaran-blog-june-10.jpg" alt="Nicholas Zakas and Victor Tsaran's Talk at the BayJax event at Yahoo! in June, 2010." width="510"></a></p>
<p>In June, Yahoo! hosted a <a href="www.meetup.com/BayJax/" target="_blank">BayJax</a> meetup dedicated to web accessibility. Nicholas Zakas, Yahoo! homepage developer, and Victor Tsaran, Yahoo! senior accessibility program manager, gave a talk on the process of making Yahoo!&#8217;s homepage highly accessible.</p>
<p>We apologize for the uneven audio levels: there were technical issues with the microphones that we unfortunately were only able to adjust towards the second half of the talk.</p>
<p>If the video embed below doesn&#8217;t show up correctly in your RSS reader of choice, be sure to <a href="http://developer.yahoo.com/yui/theater/video.php?v=zakas-tsaran">click through to watch the high-resolution version of the video on YUI Theater</a>.</p>
<p>
<div><object width="510" height="287"><param name="movie" value="http://d.yimg.com/m/up/ypp/default/player.swf"></param><param name="flashVars" value="vid=20586117&#038;"></param><param name="allowfullscreen" value="true"></param><param name="wmode" value="transparent"></param><embed width="510" height="287" allowFullScreen="true" src="http://d.yimg.com/m/up/ypp/default/player.swf" type="application/x-shockwave-flash" flashvars="vid=20586117&#038;"></embed></object></div>
</p>
<ul>
<li><a href='http://yui.zenfs.com/theater/zakas-tsaran-hd.mov'>Download HD video (480p ~1.4GB)</a></li>
<li><a href="http://yui.zenfs.com/theater/zakas-tsaran.m4v">Download video (m4v)</a></li>
</ul>
<h3>Other Recent YUI Theater Videos:</h3>
<ul>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=lembree-a11y'><strong>Dennis Lembree:</strong> Making JavaScript Accessible</a> &mdash; Dennis Lembree, an accessibility expert and the creator of AccessibleTwitter discusses the challenges of making JS-enabled sites accessible. The talk took place at the June 2010 BayJax meetup at Yahoo.</li>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2010/08/16/video-zakas-tsaran/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>YUI Theater — Dennis Lembree: “Making JavaScript Accessible (26 min.)”</title>
		<link>http://www.yuiblog.com/blog/2010/08/16/video-lembree/</link>
		<comments>http://www.yuiblog.com/blog/2010/08/16/video-lembree/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 20:46:09 +0000</pubDate>
		<dc:creator>Allen Rabinovich</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[YUI Theater]]></category>
		<category><![CDATA[Dennis Lembree]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=2428</guid>
		<description><![CDATA[In June, at the BayJax meetup on web accessibility hosted by Yahoo!, the accessibility expert Dennis Lembree gave a talk on the challenges of making JavaScript-enabled websites accessible. If the video embed below doesn&#8217;t show up correctly in your RSS reader of choice, be sure to click through to watch the high-resolution version of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yui/theater/video.php?v=lembree-a11y"><img src="http://yuiblog.com/assets/dennis-lembree-blog-june-10.jpg" alt="Dennis Lembree's Talk at the BayJax event at Yahoo! in June, 2010." width="510"></a></p>
<p>In June, at the <a href="www.meetup.com/BayJax/" target="_blank">BayJax</a> meetup on web accessibility hosted by Yahoo!, the accessibility expert Dennis Lembree gave a talk on the challenges of making JavaScript-enabled websites accessible.</p>
<p>If the video embed below doesn&#8217;t show up correctly in your RSS reader of choice, be sure to <a href="http://developer.yahoo.com/yui/theater/video.php?v=lembree-a11y">click through to watch the high-resolution version of the video on YUI Theater</a>.</p>
<p>
<div><object width="510" height="287"><param name="movie" value="http://d.yimg.com/m/up/ypp/default/player.swf"></param><param name="flashVars" value="vid=20586113&#038;"></param><param name="allowfullscreen" value="true"></param><param name="wmode" value="transparent"></param><embed width="510" height="287" allowFullScreen="true" src="http://d.yimg.com/m/up/ypp/default/player.swf" type="application/x-shockwave-flash" flashvars="vid=20586113&#038;"></embed></object></div>
</p>
<ul>
<li><a href='http://yui.zenfs.com/theater/lembree-a11y-hd.mov'>Download HD video (480p ~682MB)</a></li>
<li><a href="http://yui.zenfs.com/theater/lembree-a11y.m4v">Download video (m4v)</a></li>
</ul>
<h3>Other Recent YUI Theater Videos:</h3>
<ul>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=zakas-tsaran'><strong>Nicholas Zakas and Victor Tsaran:</strong> Accessibility on the Yahoo Homepage</a> &mdash; Nicholas Zakas, a principal developer of the Yahoo! homepage, and Victor Tsaran&#8217;s, Yahoo!&#8217;s senior accessibility manager, discuss the strategies and methods that made one of the most visited websites in the world fully accessible. The talk took place at the June 2010 BayJax meetup at Yahoo.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=zakas-hpjs'><strong>Nicholas Zakas, Stoyan Stefanov, Ross Harmes, Julien Lecomte, Matt Sweeney:</strong> High Performance JavaScript</a> &mdash; Five contributors to O&#8217;Reilly&#8217;s <em>High Performance JavaScript</em> discuss advanced JavaScript and DOM scripting optimizations at the April 2010 BayJax meetup at Yahoo.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=heilmann-yql'><strong>Christian Heilmann:</strong> YQL and YUI: Building Blocks for Quick Applications</a> &mdash; The Yahoo! Developer Network&#8217;s international evangelist Christian Heilmann discusses his philosophy for creating fast, powerful, compelling applications using the Yahoo Query Language (YQL) and the Yahoo User Interface Library (YUI).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2010/08/16/video-lembree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Theater —  Todd Kloots: “Building Accessible Widgets with YUI 3″</title>
		<link>http://www.yuiblog.com/blog/2009/11/23/video-kloots-yuiconf2009-a11y/</link>
		<comments>http://www.yuiblog.com/blog/2009/11/23/video-kloots-yuiconf2009-a11y/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 16:39:23 +0000</pubDate>
		<dc:creator>Eric Miraglia</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[YUI Theater]]></category>
		<category><![CDATA[a11y]]></category>
		<category><![CDATA[aria]]></category>
		<category><![CDATA[todd kloots]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=967</guid>
		<description><![CDATA[We wrap up YUI Theater coverage of YUICONF 2009 with a talk from Todd Kloots (@toddkloots) on the accessibility features of YUI 3: &#8220;Building Accessible Widgets with YUI 3.&#8221; Todd covers YUI&#8217;s support for keyboard handling, focus styling and management, ARIA roles and states, and much more. (Don&#8217;t miss Todd&#8217;s other YUICONF talk, &#8220;YUI 3 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-a11y"><img src="http://yuiblog.com/assets/kloots-yuiconf2009-a11y-20091110-101857.jpg" alt="YUI engineer Todd Kloots speaks at YUICONF 2009, held at the Yahoo! HQ in Sunnyvale; October 28, 2009." width="510"></a></p>
<p>We wrap up <a href="http://developer.yahoo.com/yui/theater/">YUI Theater</a> coverage of <a href="http://yuilibrary.com/yuiconf2009">YUICONF 2009</a> with a talk from Todd Kloots (<a href="http://twitter.com/toddkloots">@toddkloots</a>) on the accessibility features of <a href="http://developer.yahoo.com/yui/3/">YUI 3</a>: &#8220;<a href="http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-a11y">Building Accessible Widgets with YUI 3</a>.&#8221;  Todd covers YUI&#8217;s support for keyboard handling, focus styling and management, ARIA roles and states, and much more.  (Don&#8217;t miss Todd&#8217;s other YUICONF talk, &#8220;<a href="http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-sugar">YUI 3 Sugar,</a>&#8221; which is a great primer on other hidden gems in the library.)</p>
<p>If the video embed below doesn&#8217;t show up correctly in your RSS reader of choice, be sure to <a href="http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-a11y">click through to watch the high-resolution version of the video on YUI Theater</a>; the downloadable version is much smaller, optimized as it is for iPods, iPhones, and other handheld devices.</p>
<p>
<div><object width="510" height="287"><param name="movie" value="http://d.yimg.com/m/up/ypp/default/player.swf"></param><param name="flashVars" value="vid=16714388&#038;"></param><param name="allowfullscreen" value="true"></param><param name="wmode" value="transparent"></param><embed width="510" height="287" allowFullScreen="true" src="http://d.yimg.com/m/up/ypp/default/player.swf" type="application/x-shockwave-flash" flashvars="vid=16714388&#038;"></embed></object></div>
</p>
<ul>
<li><a href="http://yuiblog.com/yuitheater/kloots-yuiconf2009-a11y.m4v">Download video (m4v)</a></li>
<li><a href="http://yuiblog.com/assets/kloots-yuiconf2009-a11y.zip">Download slides</a></li>
</ul>
<h3>The Full Roster of YUICONF 2009 Videos on YUI Theater:</h3>
<ul>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=crockford-yuiconf2009-state'><strong>Douglas Crockford:</strong> The State and Future of JavaScript</a> &mdash; Yahoo! JavaScript Architect Douglas Crockford discusses the recent ECMA5 development process and efforts to improve the language in the future.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=eich-yuiconf2009-harmony'><strong>Brendan Eich:</strong> ECMA Harmony and the Future of JavaScript</a> &mdash; Brendan Eich, the creator of the world&#8217;s most popular programming language, talks about the struggle over the ES4 proposal and how it resulted in a specific set of proposals for ES5.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=smith-yuiconf2009-events'><strong>Luke Smith:</strong> Events Evolved</a> &mdash; YUI engineer Luke Smith provides a deep introduction to the YUI 3 event system including its support for DOM events, event delegation, synthetic events, and custom events.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-sugar'><strong>Todd Kloots:</strong> YUI 3 Sugar</a> &mdash; YUI engineer Todd Kloots presents an indispensable introduction to YUI 3&#8242;s powerful suite of tools.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=schlueter-yuiconf2009-yui3'><strong>Isaac Schlueter:</strong> Solving Problems with YUI 3</a> &mdash; YUI engineer Isaac Schlueter works through a real-world use case of building YUI 3&#8242;s forthcoming AutoComplete widget.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=glass-yuiconf2009-contributing'><strong>Dav Glass:</strong> Contributing to YUI</a> &mdash; YUI engineer Dav Glass introduces you to the YUI Gallery and steps through the process of making contributions to the YUI project.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=rabinovich-yuiconf2009-charts'><strong>Allen Rabinovich:</strong> YUI 3 Infographics</a> &mdash; YUI engineer Allen Rabinovich discusses the YUI 3 Charts implementation, currently under development.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=burke-yuiconf2009-yap'><strong>Reid Burke:</strong> Building YAP Applications with YUI</a> &mdash; YUI engineer Reid Burke discusses the Yahoo! Application Platform and how you can use it, along with YUI, to reach Yahoo!&#8217;s vast audience.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=sweeney-yuiconf2009-performance'><strong>Matt Sweeney:</strong> YUI 3 Performance</a> &mdash; YUI architect Matt Sweeney reviews principles of high-performance web development and looks at how best to implement those principles in YUI 3-based projects.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=desai-yuiconf2009-widgets'><strong>Satyen Desai:</strong> A Widget Walkthrough</a> &mdash; YUI engineer Satyen Desai provides a detailed tour of the YUI 3 widget subsystem.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=kloots-yuiconf2009-a11y'><strong>Todd Kloots:</strong> Building Accessible Widgets with YUI 3</a> &mdash; YUI engineer Todd Kloots demonstrates the accessibility toolkit built into YUI 3.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=auld-yuiconf2009-phploader'><strong>Chad Auld:</strong> Introducing PHP Loader</a> &mdash; Chad Auld of Yahoo! introduces the YUI PHP Loader, a flexible tool for loading modular JavaScript and CSS projects.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=ericf-yuiconf2009-webapps'><strong>Eric Ferraiuolo:</strong> Web App Development with YUI 3</a> &mdash; Eric Ferraiuolo of Oddnut Software talks about the nuances of deploying real-world web applications using YUI 3.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=adams-yuiconf2009-testing'><strong>Ron Adams:</strong> Automated Integration Testing with YUI Test, Selenium and Hudson</a> &mdash; Yahoo! engineer Ron Adams discusses the creation of automated QA workflows that combine YUI Test, Selenium and Hudson to automate JavaScript unit tests.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=woods-yuiconf2009-yuidoc'><strong>Stephen Woods:</strong> Creating Beautiful Documentation with YUI Doc</a> &mdash; Yahoo! frontend engineer Stephen Woods provides a guided tour to YUI&#8217;s documentation engine, YUI Doc.  YUI Doc is language-agnostic and can be used to document a variety of project styles.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=snider-yuiconf2009-storage'><strong>Matt Snider:</strong> Introducing the YUI 2.8.0 Storage Utility</a> &mdash; Matt Snider, the lead frontend engineer for Mint.com (recently acquired by Intuit), contributed the YUI Storage Utility in the 2.8.0 release.  In this session, he provides an overview of the Storage Utility&#8217;s features and the nuances of the various storage backends.</li>
<li><a href='http://developer.yahoo.com/yui/theater/video.php?v=smith-yuiconf2009-debugging'><strong>Luke Smith:</strong> Debugging in YUI 3</a> &mdash; YUI engineer Luke Smith discusses the fine art of debugging web applications, looking at general tools and techniques and providing a few specific hints about debugging in YUI 3.</li>
</ul>
<h3>Subscribing to YUI Theater:</h3>
<ul>
<li><a href="http://feeds.feedburner.com/yuiblog/yui-theater">YUI Theater RSS feed</a></li>
<li><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=263846173&amp;s=143441">YUI Theater on iTunes</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/11/23/video-kloots-yuiconf2009-a11y/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI’s Todd Kloots in London for Accessibility/ARIA Tech Talk on Nov. 17</title>
		<link>http://www.yuiblog.com/blog/2009/09/17/kloots-nov-16-aria-london/</link>
		<comments>http://www.yuiblog.com/blog/2009/09/17/kloots-nov-16-aria-london/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 17:16:10 +0000</pubDate>
		<dc:creator>Eric Miraglia</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[aria]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[tech talk]]></category>
		<category><![CDATA[todd kloots]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=489</guid>
		<description><![CDATA[Yahoo! accessibility specialist Todd Kloots will be in London in November for a tech talk hosted by Skills Matter. The talk, &#8220;More Accessible User Interfaces with ARIA,&#8221; will offer practical tips and design patterns for using ARIA to create accessible user interfaces that work across all of the various combinations of browsers and assistive technology [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://upcoming.yahoo.com/event/4422218/http://yuiblog.com/assets/klootsinlondon-20090917-100306.png"><img src="http://yuiblog.com/assets/klootsinlondon-20090917-100306.png"></a></p>
<p>Yahoo! accessibility specialist Todd Kloots will be in London in November for a tech talk hosted by Skills Matter.  The talk, &#8220;More Accessible User Interfaces with ARIA,&#8221; will offer practical tips and design patterns for using ARIA to create accessible user interfaces that work across all of the various combinations of browsers and assistive technology that support ARIA.</p>
<p>The event is free; you can <a href="http://skillsmatter.com/event/os-mobile-server/more-accessible-user-interfaces-with-aria">register on the Skills Matter website</a>.</p>
<p>If you can&#8217;t wait until November to start diving into ARIA, Todd has you covered with a good library of <a href="http://yuiblog.com/blog/category/accessibility">blog posts</a> and <a href="http://video.yahoo.com/watch/4073211/10996186">tech videos</a> on the subject.</p>
<p><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=10996186&#038;vid=4073211&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/6384/76312827.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=10996186&#038;vid=4073211&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/6384/76312827.jpeg&#038;embed=1" ></embed></object></p>
<p><a href="http://video.yahoo.com/watch/4073211/10996186">Todd Kloots: &quot;Developing Accessible Widgets Using ARIA&quot;</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/09/17/kloots-nov-16-aria-london/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARIA Made Easier With YUI 3</title>
		<link>http://www.yuiblog.com/blog/2009/08/03/aria-made-easier-with-yui-3/</link>
		<comments>http://www.yuiblog.com/blog/2009/08/03/aria-made-easier-with-yui-3/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 21:24:22 +0000</pubDate>
		<dc:creator>Todd Kloots</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.yuiblog.com/blog/?p=408</guid>
		<description><![CDATA[As mentioned in my talk Developing an Accessible Web 2.0 Widget Framework, one of the goals of YUI 3 is to make it easier for developers to build accessible user interfaces. To that end we&#8217;ve taken accessibility into consideration from the very start while building YUI 3, and the recent YUI 3.0.0 beta 1 release [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in my talk <a href="http://video.yahoo.com/watch/5100659/13530238" title="Todd Kloots: &quot;Developing an Accessible Web 2.0 Widget Framework&quot; on Yahoo! Video">Developing an Accessible Web 2.0 Widget Framework</a>, one of the goals of <a href="http://developer.yahoo.com/yui/3/">YUI 3</a> is to make it easier for developers to build accessible user interfaces.  To that end we&#8217;ve taken accessibility into consideration from the very start while building YUI 3, and the recent <a href="http://yuilibrary.com/downloads/#yui3">YUI 3.0.0 beta 1 release</a> introduces several new additions that make it easier for developers to build <a href="http://www.w3.org/TR/wai-aria/">ARIA</a>-enabled widgets.
</p>
<h3 id="aria-support-in-node">ARIA Attribute Support Added to Node</h3>
<p> The <a href="http://developer.yahoo.com/yui/3/node/" title="The Node Utility">Node Utility</a> is YUI 3&#8242;s primary interface for interacting with the DOM, and it provides not only an abstraction model but built-in support for CSS Selector queries as a means of accessing HTML elements.  Support for ARIA attributes has been added to the Node interface in the YUI 3.0.0 beta 1 release, allowing developers to use the expressive power of CSS Selector queries to apply and manage an element&#8217;s ARIA <a href="http://www.w3.org/TR/wai-aria/#roles">roles</a> and <a href="http://www.w3.org/TR/wai-aria/#state_prop_def">states and properties</a>.
</p>
<p>Apply any of the ARIA attributes via Node&#8217;s <code>set</code> method.  For example, to apply the <code>role</code> of <a href="http://www.w3.org/TR/wai-aria/#toolbar"><code>toolbar</code></a> to a <code>&#60;div&#62;</code> with an id of &#8220;toolbar&#8221;: </p>
<pre>
<code>
YUI().use('node', function(Y) {
    var node = Y.get('#toolbar').set('role', 'toolbar');
});
</code>
</pre>
<p>In addition to Node&#8217;s built-in support for CSS selector queries, it also supports chaining and the ability to set multiple attributes on a single Node.  When used together, these features of Node make it especially easy to apply the ARIA roles, states, and properties when building DHTML widgets with a large subtree.</p>
<p>For example, when building a menubar widget it is necessary to apply a <code>role</code> of <a href="http://www.w3.org/TR/wai-aria/#menubar"><code>menubar</code></a> to the root DOM element containing the menubar, and the <code>role</code> of <a href="http://www.w3.org/TR/wai-aria/#menu"><code>menu</code></a> to the root DOM element containing each submenu. Additionally, as each submenu is hidden by default, the <a href="http://www.w3.org/TR/wai-aria/#aria-hidden"><code>aria-hidden</code></a> state will need to be applied to each submenu as well. The Node interface makes it possible to do all of this in one line of code:
</p>
<pre>
<code>
YUI().use('node', function(Y) {
    Y.get('#rootmenu').set('role', 'menubar').queryAll('.menu').setAttrs({ role: 'menu', 'aria-hidden': true });
});
</code>
</pre>
<h3 id="adding-keyboard-support">Keyboard Support with the New Focus Manager Node Plugin</h3>
<p> To work, ARIA requires developers provide keyboard access for widgets, since users of screen readers rely on the keyboard to navigate web sites and applications. As outlined in the <a href="http://www.w3.org/TR/wai-aria/" title="Accessible Rich Internet Applications (WAI-ARIA) Version 1.0">ARIA specification</a> and corresponding <a href="http://www.w3.org/TR/wai-aria-practices/">Best Practices</a> document, providing keyboard access requires, in part, that each widget has one tab stop by default and is responsible for discretely managing focus for its descendants. Following these guidelines enables users to quickly navigate a page or application by using the tab key to move between widgets. Once a user has tabbed into a widget, they can then use other keys (the arrow keys for example) to move focus amongst the widget&#8217;s descendants.
</p>
<p>The <a href="http://developer.yahoo.com/yui/3/node-focusmanager/" title="The Focus Manager Node Plugin">Focus Manager Node Plugin</a>, which is available as of the YUI 3.0.0 beta 1 release, makes it easy to define a Node&#8217;s focusable descendants, define which descendant should be in the default tab flow, and define the keys that move focus among each descendant. Additionally, since the CSS pseudo class <a href="http://www.w3.org/TR/CSS21/selector.html#x38"><code>:focus</code></a> is not supported on all elements in all <a href="http://developer.yahoo.com/yui/articles/gbs/">A-Grade browsers</a>, the Focus Manager Node Plugin provides an easy, cross-browser means of styling focus.
</p>
<h3 id="aria-examples">New ARIA Examples</h3>
<p> For YUI 3.0.0 beta 1 we&#8217;ve also added a handful of examples that demonstrate the power of the Focus Manager Node Plugin to implement keyboard support to existing widgets and exercise Node&#8217;s new ARIA-related APIs.
</p>
<ul>
<li><a href="http://developer.yahoo.com/yui/3/examples/node-focusmanager/node-focusmanager-1.html" title="YUI Library Examples: Focus Manager Node Plugin: Accessible Toolbar">ARIA-Enabled Toolbar</a></li>
<li><a href="http://developer.yahoo.com/yui/3/examples/node-focusmanager/node-focusmanager-2.html" title="YUI Library Examples: Focus Manager Node Plugin: Accessible TabView">ARIA-Enabled TabView</a></li>
<li><a href="http://developer.yahoo.com/yui/3/examples/node-focusmanager/node-focusmanager-3.html" title="YUI Library Examples: Focus Manager Node Plugin: Accessible Menu Button">ARIA-Enabled Menu Button</a></li>
</ul>
<p>Developers wishing to experience the benefits that ARIA provides can download the open-source <a href="http://www.nvda-project.org/">NVDA Screen Reader</a> and <a href="http://getfirefox.com">Firefox</a> to test each example themselves.  Alternatively, I&#8217;ve made screencasts of each example running with NVDA and Firefox.
</p>
<h4 id="toolbar-video">YUI 3 Beta 1 ARIA Toolbar Video</h4>
<div><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=14686161&#038;vid=5595217&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984503.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=14686161&#038;vid=5595217&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984503.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/5595217/14686161">YUI 3 Beta 1 ARIA Toolbar</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></div>
<h4 id="menu-button-video">YUI 3 Beta 1 Menu Button Video</h4>
<div><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=14686277&#038;vid=5595263&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984976.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=14686277&#038;vid=5595263&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984976.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/5595263/14686277">YUI 3 Beta 1 ARIA Menu Button</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></div>
<h4 id="tabview-video">YUI 3 Beta 1 ARIA Tabview Video</h4>
<div><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=14686262&#038;vid=5595254&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984890.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=14686262&#038;vid=5595254&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//l.yimg.com/a/p/i/bcst/videosearch/10189/89984890.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/5595254/14686262">YUI 3 Beta 1 ARIA Tabview</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></div>
<h3 id="the-road-ahead">The Road Ahead</h3>
<p>While YUI 3 is presently composed mostly of utilities, we are hard at work polishing our widget infrastructure and will soon begin building out widgets. With YUI 3 our goal is to make it as easy as possible to build accessible user interfaces, whether you are building a widget from scratch, or implementing one of ours.  We think we&#8217;re off to a good start with ARIA support incorporated into the Node interface and the Focus Manager Node Plugin.  So, I want to encourage developers to start using these interfaces, and to let us know what&#8217;s missing, what&#8217;s not working, and what it is.
</p>
<h3 id="additional-resources">Additional Resources</h3>
<ul>
<li><a href="http://video.yahoo.com/watch/4073211/10996186" title="Todd Kloots: &quot;Developing Accessible Widgets Using ARIA&quot; on Yahoo! Video">Developing Accessible Widgets Using ARIA</a></li>
<li><a href="http://yuiblog.com/blog/2009/02/23/managing-focus/" title="Improving Accessibility Through Focus Management &raquo; Yahoo! User Interface Blog">Improving Accessibility Through Focus Management</a></li>
<li><a href="http://www.yuiblog.com/blog/2008/12/30/configuring-screen-readers/" title="Configuring Your Machine For Testing With A Screen Reader &raquo; Yahoo! User Interface Blog">Configuring Your Machine For Testing With A Screen Reader</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/08/03/aria-made-easier-with-yui-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Accessible YUI Grids Layouts with ARIA Landmark Roles</title>
		<link>http://www.yuiblog.com/blog/2009/03/05/aria-grids/</link>
		<comments>http://www.yuiblog.com/blog/2009/03/05/aria-grids/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 00:09:43 +0000</pubDate>
		<dc:creator>Todd Kloots</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuiblog.com/blog/2009/03/05/aria-grids/</guid>
		<description><![CDATA[YUI Grids CSS has long been an important tool for developers wishing to create more accessible layouts. Through its support of source-order independent layouts, Grids enables control of the reading order of a page, allowing developers to place the most important content higher in the markup so that it can be quickly discovered by users [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yui/grids/">YUI Grids CSS</a> has long been an important tool for developers wishing to create more accessible layouts. Through its support of source-order independent layouts, Grids enables control of the reading order of a page, allowing developers to place the most important content higher in the markup so that it can be quickly discovered by users of screen readers.  However, while the role of each section of a Grid (e.g., navigation, main content, footer, etc.) is easily perceived through visual style and layout, it is not immediately perceived by users of screen readers because <code>&lt;div&gt;</code>s are inherently structural elements with no default semantic meaning.</p>
<h3 id="landmark-benefits">The Benefit of Landmark Roles</h3>
<p><a href="http://www.w3.org/TR/wai-aria/#roleattribute_inherits">ARIA Landmark Roles</a> improve the content parsability of Grids for users of screen readers.   By allowing developers to declare the intended purpose of each section of a layout, Landmark Roles provide semantic meaning to each section of a Grid, giving users of screen readers a high-level summary of how a page is organized.  In addition, Landmark Roles significantly improves a Grid&#8217;s navigability. For example, the <a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">JAWS screen reader</a> will announce all of the Landmarks when a page is loaded and allows users to quickly jump between them by pressing the semicolon key:</p>
<div><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" /><param name="allowFullScreen" value="true" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=12214507&#038;vid=4561284&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7558/80857405.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" bgcolor="#000000" flashVars="id=12214507&#038;vid=4561284&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7558/80857405.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/4561284/12214507">Example Page Using YUI Grids And ARIA Landmark Roles</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></div>
<h3 id="using-landmarks">Using Landmark Roles</h3>
<p>Of all the roles defined in the <a href="http://www.w3.org/TR/wai-aria/">ARIA Specification</a>, the Landmark Roles are among the easiest to implement since they <em>don&#8217;t require JavaScript for keyboard support or state management</em>. Landmark Roles are applied to an element using the <code>role</code> attribute and can be used to improve the semantics of any section of a Grid. For example, to declare a section of a Grid as navigation, simply set the role attribute to a value of &#8220;navigation&#8221;:</p>
<pre><code>&lt;div class="yui-b" role="navigation"&gt;</code></pre>
<p>Presently the ARIA Specification defines seven different Landmark Roles:</p>
<ul>
<li><a href="http://www.w3.org/TR/wai-aria/#application"><code>application</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#banner"><code>banner</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#complementary"><code>complementary</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#contentinfo"><code>contentinfo</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#main"><code>main</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#navigation"><code>navigation</code></a></li>
<li><a href="http://www.w3.org/TR/wai-aria/#search"><code>search</code></a></li>
</ul>
<h3 id="landmark-getting-started">Getting Started Is Easy</h3>
<p>Since ARIA Landmark Roles are such a perfect complement to Grids, we&#8217;ve added built-in support to <a href="http://developer.yahoo.com/yui/grids/builder/">YUI Grids Builder</a>, added a <a href="http://developer.yahoo.com/yui/grids/#using-landmark-roles">new section on using Landmarks</a> to the Grids user guide, and created a <a href="http://developer.yahoo.com/yui/examples/grids/grids-landmarks.html">new example to highlight usage of Landmarks Roles</a> within YUI Grids CSS. Developers who are currently using Grids should definitely consider adding ARIA Landmark Roles to their markup to easily improve the accessibility of existing layouts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/03/05/aria-grids/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Improving Accessibility Through Focus Management</title>
		<link>http://www.yuiblog.com/blog/2009/02/23/managing-focus/</link>
		<comments>http://www.yuiblog.com/blog/2009/02/23/managing-focus/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 18:05:01 +0000</pubDate>
		<dc:creator>Todd Kloots</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuiblog.com/blog/2009/02/23/managing-focus/</guid>
		<description><![CDATA[A core requirement for developers using ARIA is to provide keyboard access for widgets, as users of screen readers rely on the keyboard to navigate web sites and applications. A large part of providing keyboard access is managing focus of a widget&#8217;s descendants (e.g., buttons in a toolbar, tabs in a tablist, menuitems in a [...]]]></description>
			<content:encoded><![CDATA[<p>A core requirement for developers using ARIA is to provide keyboard access for widgets, as users of screen readers rely on the keyboard to navigate web sites and applications. A large part of providing keyboard access is managing focus of a widget&#8217;s descendants (e.g., buttons in a toolbar, tabs in a tablist, menuitems in a menu, etc.), and the W3C guidelines provide two different approaches for doing so. This article explains both approaches and provides some practical advice for choosing between them.</p>
<h3>The Benefit of Focus Management</h3>
<p>As outlined in the <a href="http://www.w3.org/TR/wai-aria/" title="Accessible Rich Internet Applications (WAI-ARIA) Version 1.0">ARIA specification</a> and corresponding <a href="http://www.w3.org/TR/wai-aria-practices/">Best Practices</a> document, providing keyboard access requires, in part, that each widget has one tab stop by default and is responsible for discreetly managing focus for its descendants. Following these guidelines enables users to quickly navigate a page or application by using the tab key to move between widgets. Once a user has tabbed into a widget, they can then use other keys (the arrow keys for example) to move focus amongst the widget&#8217;s descendants.</p>
<h3>Two Approaches</h3>
<p>When it comes to managing focus, the WAI-ARIA Best Practices document provides two different techniques for developers: the <a href="http://www.w3.org/TR/wai-aria-practices/#focus_tabindex">Roaming TabIndex Technique</a> and use of the <a href="http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant"><code>activedescendant</code></a> property.</p>
<h3>Using the Roaming TabIndex Technique</h3>
<p>The Roaming TabIndex Technique requires each of a widget&#8217;s descendants be focusable, either through the use of natively focusable HTML elements, or by making an element focusable using the <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex"><code>tabIndex</code></a> attribute. To use this technique, begin by setting the <code>tabIndex</code> attribute of a widget&#8217;s first descendant to a value that is equal to or greater than 0. (A value of 0 will result in the tab order of the widget being relative to its position in the page. Use a value greater than 0 to precisely control a widget&#8217;s tab order.) Next, set the <code>tabIndex</code> attribute of all remaining descendants to -1. (A value of -1 removes an element from the default tab flow, while preserving its ability to be focused via JavaScript.) This ensures that all of a widget&#8217;s descendants are focusable via JavaScript, but only one is in the default tab flow of its containing page or application, and therefore focusable by the user.</p>
<p>With these <code>tabIndex</code> values, use a  <code>keydown</code>  event handler to manage focus of the descendants once the widget is focused by the user. As the user presses the arrow keys, call the <code>focus</code> method to activate the appropriate descendant and update the <code>tabIndex</code> of the remaining descendants so that the currently focused element is the only one that is natively focusable.</p>
<p>The following menu button example illustrates how to use the Roaming TabIndex Technique to create a widget that is both keyboard and screen-reader accessible. To test this example yourself, you can use the free <a href="http://www.nvda-project.org/">NVDA Screen Reader</a> and <a href="http://www.mozilla.com/en-US/firefox/">Firefox 3</a>. Alternatively, you can watch the screen cast of the example running in Firefox 3 using the NVDA screen reader.</p>
<h4>Roaming TabIndex Example</h4>
<p><a href="http://yuiblog.com/sandbox/yui/v300pr2/examples/aria/example-1.html" target="_blank">Test Menu Roaming TabIndex Example</a></p>
<h4>Roaming TabIndex Example Screen Cast</h4>
<p><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=12030121&#038;vid=4487975&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7356/80165708.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=12030121&#038;vid=4487975&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7356/80165708.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/4487975/12030121">Menu Button Using Roaming TabIndex Technique</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></p>
<h4>The Roaming TabIndex Technique Best Practices</h4>
<p>Having studied the WAI-ARIA Best Practices document, as well as having used the Roaming TabIndex Technique in several widget implementations, I have distilled several best practices for using this approach:</p>
<ul>
<li>I prefer using natively focusable elements instead of using the <code>tabIndex</code> attribute to make non-focusable HTML elements focusable, for better backward compatibility in browsers that don&#8217;t support the <code>tabIndex</code> attribute on all elements.</li>
<li>Use the  <code>keydown</code>  event when binding handlers used to manage focus since it is not possible to handle non-alphanumeric keys using the <code>keypress</code> event in IE.</li>
<li>In most cases it is necessary to prevent the browser&#8217;s default behavior when handling key events.</li>
<li>When setting the <code>tabIndex</code> attribute, avoid using the <code>setAttribute</code> method, to prevent case-sensitivity mistakes in IE. Setting the <code>tabIndex</code> attribute using the camel-case DOM property is both the most compact and most compatible syntax across browsers. For example: <code>myElement.tabIndex = -1;</code></li>
<li>When updating the <code>tabIndex</code> attribute of a widget&#8217;s descendants, set the attribute&#8217;s value to 0 before calling the <code>focus</code> method to ensure that the element&#8217;s default focus outline is rendered in IE.</li>
<li>When styling a descendant&#8217;s focused state, work with or augment the browser&#8217;s default rendering of focus rather than suppress it. The default rendering of focus is familiar to the user and, in many cases, consistent with the browser&#8217;s host OS. Working with the default focus model improves the learnability of the widget. If you suppress the browser&#8217;s default rendering of focus, be sure to provide a focus model that is consistent across your entire site or application so that the user only has to recognize and learn one focus model within a single context.</li>
<li>Set focus to HTML elements using both the <code>setTimeout</code> method and a <code>try/catch</code> block. Using <code>setTimeout</code> can help screen readers keep up while the focus is being changed. I have found this to be true when testing on <a href="http://www.apple.com/accessibility/voiceover/">VoiceOver</a> for the Mac. A <code>try/catch</code> block can help suppress unwanted XUL-related errors logged to the console when focusing elements in Firefox.</li>
</ul>
<h3>Using the <code>activedescendant</code> Property</h3>
<p>Unlike the Roaming TabIndex Technique, use of the <code>activedescendant</code> property doesn&#8217;t require any of a widget&#8217;s descendants to be focusable. Instead, this technique requires only that the widget&#8217;s root element be made focusable via the <code>tabIndex</code> attribute. (Note: this technique doesn&#8217;t work in the current version of Safari as it doesn&#8217;t support the <code>tabIndex</code> attribute on all HTML elements.) Using this approach, the <code>activedescendant</code> property is applied to the widget&#8217;s root element, and as the user presses the arrow keys, the value of the property is set to the id of the element that represents the user&#8217;s current selection. Since this approach doesn&#8217;t rely on focusing a widget&#8217;s descendants via the <code>focus</code> method, the browser will not provide any default rendering of the user&#8217;s current selection. Therefore, when using the <code>activedescendant</code> property the developer is responsible for rendering focus for the widget&#8217;s currently active descendant via CSS.</p>
<h4><code>activedescendant</code> Example</h4>
<p>The following example adapts the previous example to illustrate how to use the <code>activedescendant</code> property.</p>
<p><a href="http://yuiblog.com/sandbox/yui/v300pr2/examples/aria/example-2.html">Test <code>activedescendant</code> Example</a></p>
<h4><code>activedescendant</code> Example Screen Cast</h4>
<p><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=12052104&#038;vid=4497444&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7381/80255044.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=12052104&#038;vid=4497444&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7381/80255044.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/4497444/12052104">Menu Button Using The &quot;activedescendant&quot; Property</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></p>
<p>As illustrated in the screen cast, the <code>activedescendant</code> property can provide a user experience that is identical to the Roaming TabIndex technique.</p>
<h4>Best Practices for Using the <code>activedescendant</code> Property</h4>
<ul>
<li>Depending on the browser and the attribute&#8217;s value, setting the <code>tabIndex</code> attribute on a widget&#8217;s root element can result in a focus outline being drawn around the widget. For widgets with descendants, having a focus outline surround an entire control is both unfamiliar to the user (not something you&#8217;ll see on the desktop), as well as ugly. So when using the <code>activedescendant</code> property, it is best to suppress the focus outline. This can be accomplished by setting the <a href="http://www.w3.org/TR/CSS21/ui.html#propdef-outline"><code>outline</code></a> CSS property in Firefox and IE 8, and using the <a href="http://msdn.microsoft.com/en-us/library/ms533783(VS.85).aspx"><code>hideFocus</code></a> attribute for IE 6 and 7. Unfortunately it is not possible to suppress the focus outline in the current version of Opera.</li>
<li>Use CSS to render focus for a widget&#8217;s descendants in a way that is consistent with, and/or builds on, the default browser focus, or is consistent within the scope of the site or application.</li>
</ul>
<h3>Choosing a Technique</h3>
<p>Having evaluated both the Roaming TabIndex Technique and the use of the <code>activedescendant</code> property, the Roaming TabIndex Technique is the better choice, because it is a solution that works &#8220;with the grain&#8221;. As such, it is more forward and backward compatible — especially when you are trying to support a <a href="http://developer.yahoo.com/yui/articles/gbs/index.html">wide array of browsers</a> like we are at Yahoo!. Using the <code>activedescendant</code> property requires more effort for less overall benefit and compatibility. Here are the downsides to using the <code>activedescendant</code> property:</p>
<ul>
<li>Requires browser support of the <code>tabIndex</code> attribute on all elements. Currently this not supported in Safari.</li>
<li>Suppressing the default focus outline drawn around a widget&#8217;s containing element is a slight pain in that it requires different techniques for different browsers. It turns into a bigger pain in Opera, where it is not only currently impossible but also exacerbated by Opera&#8217;s egregious focus model, illustrated in the following screen capture: <img id="opera-screen-capture" src="http://yuiblog.com/assets/managing-focus/focus-opera.png" width="157" height="120" alt="Screen capture of the focus menu from the second example running in Opera 9.6"></li>
<li>Loss of the default, familiar focus outline drawn around a widget&#8217;s descendants. The focus outline can be restored via CSS. However, developers get the focus outline for free when using the Roaming TabIndex Technique.</li>
<li>Since descendants aren&#8217;t focusable they cannot be clicked by pressing the enter key or space bar. This requires that developers listen explicitly for these key events and route the code responsible for handling the <code>click</code> event accordingly. When using the Roaming TabIndex technique, developers can simply listen for the <code>click</code> event.</li>
<li>Every descendant needs a unique id.</li>
</ul>
<p>Unlike the <code>activedescendant</code> property, the Roaming TabIndex Technique allows widgets to be both keyboard accessible and screen-reader accessible in browsers that don&#8217;t support ARIA and don&#8217;t support the <code>tabIndex</code> attribute on all elements.  For example, if a widget&#8217;s descendants are built using the set of natively focusable HTML elements, users of screen readers will still perceive them as actionable/clickable elements. Consider the following screen cast of our first example running in IE 7 (a browser without ARIA support) using JAWS 10.</p>
<p><object width="512" height="322"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" /><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" VALUE="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=12051469&#038;vid=4497181&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7381/80252536.jpeg&#038;embed=1" /><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.34" type="application/x-shockwave-flash" width="512" height="322" allowFullScreen="true" AllowScriptAccess="always" bgcolor="#000000" flashVars="id=12051469&#038;vid=4497181&#038;lang=en-us&#038;intl=us&#038;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/7381/80252536.jpeg&#038;embed=1" ></embed></object><br /><a href="http://video.yahoo.com/watch/4497181/12051469">Screen reader accessible Menu Button</a> @ <a href="http://video.yahoo.com" >Yahoo! Video</a></p>
<p>In this example, while the user doesn&#8217;t perceive the button&#8217;s menu as a menu, the screen reader does announce each button in the menu as it is focused — letting the user know that each item is actionable/clickable. Additionally, since the button&#8217;s menu is built using the natively focusable <code>&lt;button&gt;</code> element, this widget will be keyboard accessible to all <a href="http://developer.yahoo.com/yui/articles/gbs/index.html">A-Grade browsers</a>, not just those that support the <code>tabIndex</code> attribute on all elements.</p>
<p>I suspect that the <code>activedescendant</code> property was developed as an alternative to the Roaming TabIndex Technique in part because the <code>focus</code> and <code>blur</code> events don&#8217;t bubble like other DOM events. This was a problem since developers need to listen for these events in order to customize how focus is drawn in a way that works cross browser, and attaching individual <code>focus</code> and <code>blur</code> event handlers to each of a widget&#8217;s focusable descendants has consequences for performance — especially for large composite widgets like trees and menus. That said, since <a href="http://yuiblog.com/blog/2008/10/07/onfocus-onblur/">we now have an easy way of listening for <code>focus</code> and <code>blur</code> in a performance-conscious way</a>, I feel like there are currently more downsides than upsides to using the <code>activedescendant</code> property.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/02/23/managing-focus/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>WebAIM Survey Shines Light on Screen Reader Usage</title>
		<link>http://www.yuiblog.com/blog/2009/02/12/webaim-survey/</link>
		<comments>http://www.yuiblog.com/blog/2009/02/12/webaim-survey/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 01:35:53 +0000</pubDate>
		<dc:creator>Victor Tsaran</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://yuiblog.com/blog/2009/02/12/webaim-survey/</guid>
		<description><![CDATA[&#8220;What you hear is what you see&#8221; For many developers, the screen reader is still a misunderstood assistive technology. Using a screen reader can be compared to looking at a web page through a straw because you need to explore (hear) many items in chunks and then piece them in your memory or imagination. The [...]]]></description>
			<content:encoded><![CDATA[<h3>&#8220;What you hear is what you see&#8221;</h3>
<p>For many developers, the screen reader is still a misunderstood assistive technology. Using a screen reader can be compared to looking at a web page through a straw because you need to explore (hear) many items in chunks and then piece them in your memory or imagination. The user knows that an item is present on the screen only after they&#8217;ve heard their screen reader announce it. A different approach needs to be applied in order to successfully code for this type of technology. We shouldn&#8217;t stop at using visual cues to attract user attention, but visual attributes alone cannot be relied on when communicating important information to the user. The recent <a title="WebAIM screen reader survey" href="http://webaim.org/projects/screenreadersurvey/">WebAIM screen reader survey</a> of 1121 screen reader users is a great step towards understanding how blind, deaf-blind, or visually impaired users *actually* interact with the web.<br />
<h3>Use Headings (&lt;Hn&gt; tags)</h3>
<p>The survey results are pretty clear on this one: <a title="WebAIM survey results for headings usage" href="http://webaim.org/projects/screenreadersurvey/#headings">90% of respondents</a> use headings to navigate web pages &#8220;sometimes&#8221;, &#8220;often&#8221;, or &#8220;whenever they&#8217;re available&#8221;. WebAIM says, &#8220;It is clear that providing a heading structure is important to screen reader users&#8230;.&#8221; Most screen readers provide one or more mechanisms for a user to jump between HTML headings on the page, either through a set of shortcut keys or through a custom list of headings. Because reading with a screen reader happens in a linear fashion, headings provide a way to jump between sections of a web page in a quick and efficient way. This not only enables the user to skip over repetitive navigation menus and unwanted content, but also helps them to learn about the structure and the order of the content on the page. Proper usage of HTML headings is semantic, easy, and most of all indispensible to screen reader users.</p>
<h3>Access Keys</h3>
<p>The access key is an HTML attribute that enables any focusable element on the page to become reachable via a shortcut key. Of survey respondents, <a title="WebAIM survey results for access keys usage" href="http://webaim.org/projects/screenreadersurvey/#accesskeys">88% use access keys</a> &#8220;sometimes&#8221;, &#8220;often&#8221;, or &#8220;whenever they&#8217;re available&#8221;. I&#8217;ve always assumed that access keys are of more use to advanced users, but the survey results actually suggest that beginners will tend to use access keys more often than their advanced counterparts.</p>
<p>Here are a couple of points to keep in mind when implementing access keys:</p>
<ul>
<li>Shortcut keys are not implemented across all browsers consistently: Internet Explorer uses the ALT key as a modifier, Firefox uses ALT+SHIFT, and Safari uses CONTROL.</li>
<li>Access keys may potentially conflict with the particular browser&#8217;s built-in shortcut keys: &#8220;F&#8221; for &#8220;File&#8221; menu, &#8220;E&#8221; for &#8220;Edit&#8221; menu, etc.</li>
<li>Access keys have to be appropriate to the user&#8217;s locale in order to make them intuitive. For example, the first letter for the English word &#8220;Search&#8221; would be different than for the same word in French. And what about languages that use the Cyrilic alphabet?</li>
<li>Using numbers instead of letters for access keys makes them less intuitive because number-based shortcut keys are harder to associate with particular words.</li>
</ul>
<p>This is not to suggest that access keys should not be used at all, rather that they should be used sparingly and thoughtfully. Screen reader applications provide a lot of ways for users to reach various HTML elements on the page, so these types of users may not end up using your access keys if they are too difficult to remember. If you do implement access keys, please take care to account for the different languages of your audience as well as check for possible conflicts with browser built-in keystrokes.</p>
<h3>&#8220;Skip&#8221; links</h3>
<p><a title="WebAIM survey results for skip links usage" href="http://webaim.org/projects/screenreadersurvey/#skipnav">66% of survey respondents</a> say they use &#8220;skip to content&#8221; or &#8220;skip navigation&#8221; links &#8220;sometimes&#8221;, &#8220;often&#8221;, or &#8220;whenever they&#8217;re available&#8221;. These are internal anchor links that point to different content areas. Many screen reader applications provide a native &#8220;skip to text&#8221; feature which attempts to skip navigational links and place focus on the first text string on the page. You can not always rely on this feature because the first text on the page is not necessarily relevant content. Therefore, HTML-based &#8220;skip&#8221; links, that are embedded directly in the page, provide an extremely valuable convenience that links to the place where actual main content or content of interest begins. When deciding to implement &#8220;skip&#8221; links, keep the following points in mind:</p>
<ul>
<li>Implement &#8220;skip&#8221; links because they are quite useful for keyboard users to save excessive tabbing through repetitive menus by providing a way to quickly jump to another part of the page, e.g., the beginning of the main content.</li>
<li>Do not be ashamed of &#8220;skip&#8221; links and do not hide them off-screen. They are useful for people with motor disabilities or repetitive strain injuries, and for keyboard users in general, enabling anyone to quickly skip to the main content using their keyboard.</li>
<li>Name &#8220;skip&#8221; links to clearly indicate where you are sending users when the link is activated. Good examples are &#8220;Skip to main content&#8221; or &#8220;Skip to navigation menus&#8221;.</li>
<li>Please remember to localize &#8220;skip&#8221; links as well; they are now a part of your content.</li>
<li>Last but not least, ensure that the &#8220;skip&#8221; links actually work. (Yes, I have seen a lot of sites where they don&#8217;t.) Tab to the &#8220;skip&#8221; link and activate it, making sure that the focus moves to the intended place on the page.</li>
</ul>
<h3>Know Your Audience</h3>
<p>One of the conclusions of the recently conducted <a href="http://webaim.org/projects/screenreadersurvey/">WebAIM screen reader survey</a> is the fact that there is no one way that screen reader users interact with the web. Too often, developers, product managers, and designers tend to assume the preferences, likes, and dislikes of screen reader users without ever asking them directly for their input.</p>
<p>Screen reader applications are used by blind, deaf-blind, or visually impaired users, as well as developers who test the accessibility of their web sites, teachers who instruct their students with visual impairments, and individuals who want to simply listen to the content on the screen. They are novice and advanced users of the software, who have made many configurations or left the default preferences alone. What they have in common is that they will use known techniques to navigate web pages such as:</p>
<ul>
<li>using headings to move between different parts of the page</li>
<li>reading the whole content of the page before interacting with it</li>
<li>navigating between focusable elements (links, form fields, etc.) on the page with a TAB and SHIFT+TAB key</li>
<li>using the &#8220;find&#8221; feature of the browser or a screen reader to search for particular keywords on the page</li>
</ul>
<p>It is vitally important to know your audience and how they interact with the web in order to write more usable code. Adopting these best practices will go a long way towards making your web pages more accessible for everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yuiblog.com/blog/2009/02/12/webaim-survey/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

