<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>Juicy Studio</title>
	<subtitle>No artificial additives</subtitle>
	<link href="http://juicystudio.com/"/>
	<updated>2013-05-10T15:22:00Z</updated>
	<author>
		<name>Gez Lemon</name>
		<uri>http://juicystudio.com/</uri>
	</author>
	<id>tag:juicystudio.com,2013:1</id>
	<link rel="self" type="application/atom+xml" href="http://juicystudio.com/syndicate/juicyatom.xml"/>
	<rights>Copyright 2013, Juicy Studio</rights>
	<entry>
		<title>The HTML5 outline algorithm and JAWS</title>
		<link href="http://juicystudio.com/article/html5-outline-algorithm-jaws.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-05-10:/html5-outline-algorithm-jaws.php</id>
		<updated>2013-05-10T15:02:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/html5-outline-algorithm-jaws.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
JAWS' implementation of the HTML5 outline algorithm is incorrect with IE and Firefox when the author explicitly specifies the heading levels. Fortunately, there is a relatively simple fix until JAWS finally fixes the bug. 
</p>

<h2>The HTML5 outline algorithm and JAWS</h2>
<p>
The <a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#outlines">HTML5 outline algorithm</a> should automatically expose the correct heading level depending on the structure of sectioning elements. The following section elements influence the outline algorithm:
</p>
<ul>
	<li><a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#the-article-element">article</a></li>
	<li><a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#the-aside-element">aside</a></li>
	<li><a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements">h1-h6 (within a section)</a></li>
	<li><a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#the-nav-element">nav</a></li>
	<li><a href="http://www.w3.org/html/wg/drafts/html/master/sections.html#the-section-element">section</a></li>
</ul>
<p>
The following example is marked up using just level-1 heading elements, and is reported correctly by JAWS using IE and Firefox.
</p>
<figure>
<figcaption>HTML5 Outline using <code>h1</code> elements</figcaption>
<pre><code><span class="highlight">&lt;h1&gt;</span>Main page title<span class="highlight">&lt;/h1&gt;</span>
<span class="highlight">&lt;nav&gt;</span>
  <span class="highlight">&lt;h1&gt;</span>Site navigation<span class="highlight">&lt;/h1&gt;</span>
  &lt;ul&gt;
    &lt;li&gt;Home&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Quality Assurance&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Articles Archive&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
<span class="highlight">&lt;/nav&gt;</span>
<span class="highlight">&lt;section&gt;</span>
  <span class="highlight">&lt;h1&gt;</span>Recent Posts<span class="highlight">&lt;/h1&gt;</span>
  <span class="highlight">&lt;article&gt;</span>
    <span class="highlight">&lt;h1&gt;</span>HTML5 outline algorithm and headings<span class="highlight">&lt;/h1&gt;</span>
    &lt;p&gt;
      How to fix the bug with JAWS and the HTML5
      outline algorithm.
    &lt;/p&gt;
    <span class="highlight">&lt;aside&gt;</span>
      <span class="highlight">&lt;h1&gt;</span>Publish date<span class="highlight">&lt;/h1&gt;</span>
      &lt;time datetime="2013-05-10T14:59Z"&gt;
        Friday, 10th May 2013
      &lt;/time&gt;
    <span class="highlight">&lt;/aside&gt;</span>
  <span class="highlight">&lt;/article&gt;</span>
  <span class="highlight">&lt;article&gt;</span>
    <span class="highlight">&lt;h1&gt;</span>Handling erratic behaviour with AT<span class="highlight">&lt;/h1&gt;</span>
    &lt;p&gt;
      Difficulties testing with erratic AT, 
      such as when outline algorithms go bad.
    &lt;/p&gt;
    <span class="highlight">&lt;aside&gt;</span>
      <span class="highlight">&lt;h1&gt;</span>Views<span class="highlight">&lt;/h1&gt;</span>
      &lt;p&gt;This article has been viewed 3.7 times&lt;/p&gt;
    <span class="highlight">&lt;/aside&gt;</span>
  <span class="highlight">&lt;/article&gt;</span>
<span class="highlight">&lt;/section&gt;</span></code></pre>
</figure>

<p>Using JAWS with IE and Firefox, the heading levels are announced as:</p>
<ul>
    <li>Main page title - heading level 1</li>
    <li>Site navigation - heading level 2</li>
    <li>Recent posts - heading level 2</li>
    <li>HTML5 Outline Algorithm and Headings - heading level 3</li>
    <li>Publish date - heading level 4</li>
    <li>Handling erratic behaviour with AT - heading level 3</li>
    <li>Views - heading level 4</li>
</ul>
<p>
With screen readers that do not yet support the HTML5 outline algorithm, such as NVDA and VoiceOver, all of the headings are announced as level-1 headings. The HTML5 outline algorithm allows authors to explicitly specify the heading levels so that they're supported by older user agents.
</p>

<figure>
<figcaption>Explicitly specifying the heading levels</figcaption>
<pre><code><span class="highlight">&lt;h1&gt;</span>Main page title<span class="highlight">&lt;/h1&gt;</span>
&lt;nav&gt;
  <span class="highlight">&lt;h2&gt;</span>Site navigation<span class="highlight">&lt;/h2&gt;</span>
  &lt;ul&gt;
    &lt;li&gt;Home&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Quality Assurance&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Articles Archive&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/nav&gt;
&lt;section&gt;
  <span class="highlight">&lt;h2&gt;</span>Recent Posts<span class="highlight">&lt;/h2&gt;</span>
  &lt;article&gt;
    <span class="highlight">&lt;h3&gt;</span>HTML5 outline algorithm and headings<span class="highlight">&lt;/h3&gt;</span>
    &lt;p&gt;
      How to fix the bug with JAWS and the HTML5
      outline algorithm.
    &lt;/p&gt;
    &lt;aside&gt;
      <span class="highlight">&lt;h4&gt;</span>Publish date<span class="highlight">&lt;/h4&gt;</span>
      &lt;time datetime="2013-05-10T14:59Z"&gt;
        Friday, 10th May 2013
      &lt;/time&gt;
    &lt;/aside&gt;
  &lt;/article&gt;
  &lt;article&gt;
    <span class="highlight">&lt;h3&gt;</span>Handling erratic behaviour with AT<span class="highlight">&lt;/h3&gt;</span>
    &lt;p&gt;
      Difficulties testing with erratic AT, 
      such as when outline algorithms go bad.
    &lt;/p&gt;
    &lt;aside&gt;
      <span class="highlight">&lt;h4&gt;</span>Views<span class="highlight">&lt;/h4&gt;</span>
      &lt;p&gt;This article has been viewed 3.7 times&lt;/p&gt;
    &lt;/aside&gt;
  &lt;/article&gt;
&lt;/section&gt;</code></pre>
</figure>
<p>
This example now correctly reports the heading levels in screen readers that do not support the HTML5 outline algorithm, but are now reported incorrectly by JAWS. JAWS announces the level implied by the outline added to the explicitly specified level. The headings in this example are now announced by JAWS as:
</p> 

<ul>
    <li>Main page title - heading level 1</li>
    <li>Site navigation - heading level 3</li>
    <li>Recent posts - heading level 3</li>
    <li>HTML5 Outline Algorithm and Headings - heading level 5</li>
    <li>Publish date - heading level 2 (Firefox only; not recognised as a heading in IE)</li>
    <li>Handling erratic behaviour with AT - heading level 5</li>
    <li>Views - heading level 2 (Firefox only; not recognised as a heading in IE)</li>
</ul>

<p>
JAWS calculates all heading levels within a section by adding the explicit heading level to the heading level calculated from the outline. This works if all headings within a section start with a level-1 heading, and then used in order without skipping a level in the section, but breaks if the levels are not reset for each section. If a level-3 heading element is defined in the first section element, JAWS announces it as a level-4 heading:
</p>
<figure>
<figcaption>Level-3 sub-heading reported as level-4</figcaption>
<pre><code>&lt;section&gt;
  &lt;h2&gt;Recent Posts&lt;/h2&gt;
&#8943;
  &lt;h3&gt;Sub-heading&lt;/h3&gt;
&#8943;
&lt;/section&gt;</code></pre>
</figure>

<p>
Similarly, if a level is skipped, JAWS just adds that level to the current outline calculation. So a level-4 element in the first section element would be announced as a level-5 heading:
</p>

<figure>
<figcaption>Skipping a heading level</figcaption>
<pre><code>&lt;section&gt;
  &lt;h2&gt;Recent Posts&lt;/h2&gt;
&#8943;
  &lt;h4&gt;Sub-heading&lt;/h4&gt;
&#8943;
&lt;/section&gt;</code></pre>
</figure>


<h2>Fixing the JAWS bug</h2>
<p>
Fortunately, the problem with JAWS can be solved using <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a> by applying the <a href="http://www.w3.org/TR/wai-aria/roles#heading">heading</a> role and <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-level">aria-level</a> attribute on the heading elements that are reported incorrectly.
</p>

<figure>
<figcaption>Using <code>role="heading"</code> with the <code>aria-level</code> attribute</figcaption>
<pre><code>&lt;h1&gt;Main page title&lt;/h1&gt;
&lt;nav&gt;
  &lt;h2 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="2"</span>&gt;
    Site navigation
  &lt;/h2&gt;
  &lt;ul&gt;
    &lt;li&gt;Home&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Quality Assurance&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="&#8943;"&gt;Articles Archive&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/nav&gt;
&lt;section&gt;
  &lt;h2 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="2"</span>&gt;
    Recent Posts
  &lt;/h2&gt;
  &lt;article&gt;
    &lt;h3 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="3"</span>&gt;
      HTML5 outline algorithm and headings
    &lt;/h3&gt;
    &lt;p&gt;
      How to fix the bug with JAWS and the HTML5
      outline algorithm.
    &lt;/p&gt;
    &lt;aside&gt;
      &lt;h4 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="4"</span>&gt;
        Publish date
      &lt;/h4&gt;
      &lt;time datetime="2013-05-10T14:59Z"&gt;
        Friday, 10th May 2013
      &lt;/time&gt;
    &lt;/aside&gt;
  &lt;/article&gt;
  &lt;article&gt;
    &lt;h3 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="3"</span>&gt;
      Handling erratic behaviour with AT
    &lt;/h3&gt;
    &lt;p&gt;
      Difficulties testing with erratic AT, 
      such as when outline algorithms go bad.
    &lt;/p&gt;
    &lt;aside&gt;
      &lt;h4 <span class="highlight">role="heading"</span> <span class="highlight">aria-level="4"</span>&gt;
        Views
      &lt;/h4&gt;
      &lt;p&gt;This article has been viewed 3.7 times&lt;/p&gt;
    &lt;/aside&gt;
  &lt;/article&gt;
&lt;/section&gt;</code></pre>
</figure>

<p>
The heading elements are now announced correctly by all screen readers, including JAWS.
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>aria-controls - lack of support</title>
		<link href="http://juicystudio.com/article/aria-controls-lack-support.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-04-05:/aria-controls-lack-support.php</id>
		<updated>2013-04-05T14:11:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/aria-controls-lack-support.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-controls">aria-controls</a> attribute is important for composite widgets where one element controls another, such as navigation widgets (links, buttons, or <a href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles#tab">tabs</a> controlling another section), <a href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles#tree">tree views</a>, and similar relationships where one element controls another. The attribute defines the relationship so that assistive technology users can navigate to the content effected by the controlling element; for example, from a tab to the associated tab panel.
</p>
<p>
Considering the importance of being able to define these relatively simple relationships, the <code>aria-controls</code> attribute has surprisingly poor support. The only browser/assistive technology combination that I'm aware of that supports this relationship at the moment is Firefox/JAWS.
</p>

<h2>Simple tab control design pattern</h2>
<p>
A simple tab control design pattern will illustrate this issue, and is fairly common in web applications.
</p>
<p>
As the tabs are a collection of links, they should initially be marked up in an unordered list, but the list roles should be overridden using <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a> roles and use properties to ensure they are understandable to assistive technologies. The unordered list (<code>ul</code>) containing the list of links should have a role of <a href="http://www.w3.org/TR/wai-aria/roles#tablist">tablist</a>. The list items themselves could be put in to the keyboard tab order with the correct roles, or the list items could contain regular anchor elements that have their roles changed to make them understandable to screen readers. If this approach is chosen, the role of the list items should be changed to <a href="http://www.w3.org/TR/wai-aria/roles#presentation">presentation</a> so the semantics of list items are not conveyed to assistive technologies. The rest of this discussion assumes an anchor element will be used within a list item, as that's the best approach for progressive enhancement and seems to be the most common design pattern deployed for tabs.
</p>
<p>
Each anchor element in the list should have a role of <a href="http://www.w3.org/TR/wai-aria/roles#tab">tab</a>, and the following attributes should be set for each anchor element:
</p>
<ul>
	<li><a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-selected">aria-selected</a> - indicates whether this tab is the currently selected tab in the tab list.</li>
	<li><a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-controls">aria-controls</a> - identifies the id attribute value of the panel that is displayed when this tab is selected. This is the relationship that should allow assistive technologies to navigate to the panel.</li>
	<li><a href="http://www.w3.org/TR/wai-aria-practices/#focus_tabindex">tabindex</a> - A value of <code>0</code> means that the element is included in the tab order where it is in the source, and a value of <code>-1</code> means that it is not included in the keyboard tab order, but can receive programmatic focus with JavaScript (<code>objTab.focus();</code>). Only the currently selected item in the tab should have a tabindex attribute value of 0, so the user can skip the group of links pressing <kbd>TAB</kbd>. Using the cursor keys should change the TAB selection (the keyboard keystrokes provided at the end of this section).</li>
</ul>
<p>
The panels that are controlled by the tabs in the tab list should have a role of <a href="http://www.w3.org/TR/wai-aria/roles#tabpanel">tabpanel</a>, and the following attributes should be set on each panel:
</p>
<ul>
	<li><a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-hidden">aria-hidden</a> - Indicates whether the element is visible or not.</li>
	<li><a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-expanded">aria-expanded</a> - Indicates whether the element is currently expanded or collapsed.</li>
	<li><a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby">aria-labelledby</a> - Identifies the tab that labels this panel.</li>
</ul>
<p>
Consider the following example with 4 tabs.
</p>
<figure>
<figcaption>"Review Terms" currently selected tab</figcaption>
<img src="/img/article/tab.gif" alt="Typical tab design with 4 tabs"/>
</figure>

<p>
The following is the markup to produce the 4 tabs so they are exposed correctly to assistive technologies using the design pattern outlined above. In this example, the second tab, "Review Terms", is the currently selected tab.
</p>

<figure>
<figcaption>Design pattern for tabs</figcaption>
<pre><code>&lt;ul <span class="highlight">role="tablist"</span>&gt;
  &lt;li <span class="highlight">role="presentation"</span>&gt;
    &lt;a href="#" 
       <span class="highlight">role="tab"</span> 
       <span class="highlight">aria-controls="panel1"</span> 
       <span class="highlight">aria-selected="false"</span> 
       <span class="highlight">tabindex="-1"</span> 
       <span class="highlight">id="tab1"</span>&gt;Account overview&lt;/a&gt;
  &lt;/li&gt;
  &lt;li <span class="highlight">role="presentation"</span>&gt;
    &lt;a href="#" 
       <span class="highlight">role="tab"</span> 
       <span class="highlight">aria-controls="panel2"</span>
       <span class="highlight">aria-selected="true"</span> 
       <span class="highlight">tabindex="0"</span> 
       <span class="highlight">id="tab2"</span>&gt;Review terms&lt;/a&gt;
  &lt;/li&gt;
  &lt;li <span class="highlight">role="presentation"</span>&gt;
    &lt;a href="#" 
       <span class="highlight">role="tab"</span> 
       <span class="highlight">aria-controls="panel3"</span>
       <span class="highlight">aria-selected="false"</span> 
       <span class="highlight">tabindex="-1"</span> 
       <span class="highlight">id="tab3</span>"&gt;Manage contract&lt;/a&gt;
  &lt;/li&gt;
  &lt;li <span class="highlight">role="presentation"</span>&gt;
    &lt;a href="#" 
       <span class="highlight">role="tab"</span> 
       <span class="highlight">aria-controls="panel4"</span>
       <span class="highlight">aria-selected="false"</span> 
       <span class="highlight">tabindex="-1"</span> 
       <span class="highlight">id="tab4</span>"&gt;View history&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;div id="panel1" 
     <span class="highlight">role="tabpanel"</span>
     <span class="highlight">aria-hidden="true"</span>
     <span class="highlight">aria-expanded="false"</span>
     <span class="highlight">aria-labelledby="tab1"</span>&gt;
  &lt;h2&gt;Account overview&lt;/h2&gt;
  &#8943;
&lt;/div&gt;

&lt;div id="panel2"
     <span class="highlight">role="tabpanel"</span>
     <span class="highlight">aria-hidden="false"</span>
     <span class="highlight">aria-expanded="true"</span>
     <span class="highlight">aria-labelledby="tab2"</span>&gt;
  &lt;h2&gt;Review terms&lt;/h2&gt;
  &#8943;
&lt;/div&gt;

&#8943;

&lt;div id="panel4"
     <span class="highlight">role="tabpanel"</span>
     <span class="highlight">aria-hidden="true"</span>
     <span class="highlight">aria-expanded="false"</span>
     <span class="highlight">aria-labelledby="tab4"</span>&gt;
  &lt;h2&gt;View history&lt;/h2&gt;
  &#8943;
&lt;/div&gt;</code></pre>
</figure>

<p>
The following keystrokes should be supported by the tab control.
</p>

<table>
<caption>Keystrokes for tab controls</caption>
<thead>
<tr>
	<th scope="col">Key</th>
	<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
	<th scope="row"><kbd>TAB</kbd></th>
	<td>The active tab in the tab list should initially receive focus. Pressing TAB again should move focus to the next focusable element outside of the tab list, which might be in the associated tab panel.</td>
</tr>
<tr>
	<th scope="row"><kbd>LEFT ARROW</kbd></th>
	<td>When focus is on a tab in the tab list, focus should move to the previous tab in the list. When the first tab in the list has focus and the <kbd>LEFT ARROW</kbd> is pressed, the last tab in the tab list should receive focus.</td>
</tr>
<tr>
	<th scope="row"><kbd>RIGHT ARROW</kbd></th>
	<td>When focus is on a tab in the tab list, focus should move to the next tab in the list. When the last tab in the list has focus and the <kbd>RIGHT ARROW</kbd> is pressed, the first tab in the tab list should receive focus.</td>
</tr>
<tr>
	<th scope="row"><kbd>UP ARROW</kbd></th>
	<td>When focus is on a tab in the tab list, focus should move to the previous tab in the list. When the first tab in the list has focus and the <kbd>UP ARROW</kbd> is pressed, the last tab in the tab list should receive focus.</td>
</tr>
<tr>
	<th scope="row"><kbd>DOWN ARROW</kbd></th>
	<td>When focus is on a tab in the tab list, focus should move to the next tab in the list. When the last tab in the list has focus and the <kbd>DOWN ARROW</kbd> is pressed, the first tab in the tab list should receive focus.</td>
</tr>
</tbody>
</table>

<p>
To see an implementation of this design pattern, see <a href="https://twitter.com/hanshillen">Hans Hillen's</a> accessible <a href="http://hanshillen.github.com/jqtest/">jQuery components demonstration</a> that uses a tab control for each of the components.
</p>

<h2>Usage issues</h2>
<p>
There must be a way for assistive technology users to navigate from the tabs to the tab panels. Cursor keys are usually used as reading keys, but the cursor keys are being used to control the tabs so are no longer available for this purpose. This is where the <code>aria-controls</code> attribute should help, as the relationship is defined, so there just needs to be a way for the user to navigate to the associated panel. 
</p>
<p>
Firefox with JAWS does this by announcing, "Press JAWS key + ALT + M to move to controlled element". When those keys are pressed, JAWS announces, "Moved to controlled element". The user can then navigate the panel using regular keystrokes. Unfortunately, all other browser/assistive technology combinations I tried did not provide a mechanism to navigate to the controlled element. Chrome/JAWS consistently announces, "Failed to move to controlled element" when using <kbd>JAWS key</kbd> + <kbd>ALT</kbd> + <kbd>M</kbd>, so it could be they plan to implement something soon with JAWS.
</p>
<p>	
There are obviously ways of navigating into the panel, but not acceptable equivalents of certainly knowing that you're at the top of the panel. For example, in JAWS, a user could toggle the virtual cursor on and off to break the cursor navigation with tabs and then navigate to the panel. Or the user could tab to the next focusable interface element (if there is one, which may or may not be in the tab panel), and then navigate backwards to try and find the tab. But these are clumsy recovery techniques that users will have to use if these kinds of widgets are deployed without user agent support. The only solution I can think of now is for developers to designate a keystroke that allows navigation to the panel, and ensure it's documented, until there is better support.
</p>
			</div>
		</content>
	</entry>
	<entry>
		<title>Handling erratic behaviour with AT</title>
		<link href="http://juicystudio.com/article/handling-erratic-behaviour-at.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-03-18:/handling-erratic-behaviour-at.php</id>
		<updated>2013-03-18T15:57:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/handling-erratic-behaviour-at.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
Most of us have come across scenarios where web accessibility testing with assistive technologies produces unexpected results, when we know the underlying structure of the web page is correct. Assistive technologies are complex, so it's not surprising they sometimes go wrong, but we need to know how to recover when they're being unresponsive or providing incorrect information. My colleague, <a href="https://twitter.com/hanshillen">Hans Hillen</a>, sent an email internally at <a href="http://www.paciellogroup.com/">TPG</a> about handling erratic behaviour with <a href="http://www.freedomscientific.com/products/fs/JAWS-product-page.asp">JAWS</a>, and has kindly allowed me to post it here, as this is useful information.
</p>
<p>
What techniques do you use to handle strange behaviour in JAWS and other assistive technologies?
</p>
<h2 id="stdappr">Dealing with JAWS Quirks</h2>
<p>
The following is the standard approach to dealing with JAWS Quirks (follow in order until the issue is fixed):
</p>
<ol>
	<li>Use <kbd>Ins</kbd> + <kbd>Esc</kbd> to refresh the virtual buffer. This sometimes causes JAWS to properly trigger virtual mode.</li>
	<li><kbd>Alt</kbd> + <kbd>Tab</kbd> to a different application and then back to the browser. This sometimes causes JAWS to properly trigger virtual mode.</li>
	<li>Restart the browser. Specifically with Firefox, JAWS support is better if JAWS is already running when Firefox starts up. There was a time where this was required for Firefox to expose accessibility information, but this doesn't always seem to be the case anymore. Even so, in some cases this will fix the issue.</li>
	<li>Restart JAWS. Sometimes JAWS just needs to be restarted for it to behave properly.</li>
</ol>

<h2>Virtual mode stops working</h2>
<p>
The virtual mode has stopped working when the keystrokes to navigate the virtual buffer have stopped working. For example, <kbd>H</kbd> for heading navigation doesn't work anymore. When requesting a virtual list (e.g. a link list), JAWS will announce, "this feature is only available in a virtual document". The website is essentially being navigated in forms/application mode, although JAWS seems to provide less information than usual. When pressing certain virtual navigation keys, JAWS will be quiet, but if you press tab it will announce the keys as if you had typed them into a document (e.g. "H H H"). When tabbing between elements, JAWS may just say "TAB" or it may announce the focused element. Using the arrow keys will scroll the page rather than navigate virtually.
</p>
<h3>Virtual mode solutions</h3>
<ol>
	<li>Ensure that focus has been moved into the actual web page. If your focus is elsewhere in the browser, such as on the address bar, JAWS will consider it a desktop application that does not support virtual mode. Moving focus into the page should fix this (for example, by tabbing, clicking on the page with the mouse, or using the <kbd>Ctrl</kbd> + <kbd>F6</kbd> shortcut).</li>
	<li>Use the standard approach for <a href="#stdappr">dealing with JAWS quirks</a>.</li>
</ol>

<h2>Jaws announces the same element when tabbing through the page</h2>
<p>
Sometimes JAWS gets stuck on a particular element and it will keep announcing it, instead of the elements actually being focused. If you test with an accessibility inspection tool, such as <a href="http://www.paciellogroup.com/resources/aViewer2013">aViewer</a> or Inspect32, the browser does in fact expose the correct information for the focused element, but JAWS still announces something else.
</p>
<h3>Same element solutions</h3>
<ol>
	<li>Press <kbd>INS</kbd> + <kbd>Tab</kbd>. This causes JAWS to announce the focused element again, and sometimes this causes the currently focused element to be announced correctly.</li>
	<li>Turn off virtual mode using <kbd>INS</kbd> + <kbd>Z</kbd> (repeat twice to make the switch stick). This issue seems to be most common when tabbing between elements while virtual mode is active. It seems to increase specifically for elements that trigger auto forms mode. Manually switching to forms mode or application mode causes JAWS to announce the actual exposed accessibility information.</li>
	<li>Use the standard approach for <a href="#stdappr">dealing with JAWS quirks</a>.</li>
</ol>

<h2>Broken table navigation</h2>
<p>
When navigating a data table (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Arrow Keys</kbd>), JAWS will sometimes act like there are no cells in a row or column. When navigating to an adjacent cell, it will announce "beginning/end of row/column", as though the actual cells in the data table do not exist.
</p>
<h3>Broken data table solutions</h3>
<ol>
	<li>Use the standard approach for <a href="#stdappr">dealing with JAWS quirks</a>.</li>
</ol>

<h2>JAWS can't find elements</h2>
<p>
When navigating to tables, headings, lists, and so on, JAWS announces that there are no elements of this type on the page, even though there clearly are.
</p>
<h3>Missing element solutions</h3>
<ol>
	<li>Use <kbd>Ins</kbd> + <kbd>Esc</kbd> to refresh the virtual buffer, sometimes this cases JAWS to properly trigger virtual mode.</li>
	<li>Move (virtual) focus to the start of the page using <kbd>Ctrl</kbd> + <kbd>Home</kbd>. Sometimes JAWS seems to perform a shortcut within a specific scope, which is not always the actual page loaded in the browser. For example, if (virtual) focus is placed near the start of the document, the <kbd>M</kbd> key will list all frames in the loaded page. If you move inside one of those frames though, JAWS will only look inside that frame and it's not possible to find the other frames in the main document (until you move focus back to that scope).</li>
</ol>
<h2>Opening virtual HTML Features list</h2>
<p>
When using the <kbd>INS</kbd> + <kbd>F3</kbd> shortcut for opening the Virtual HTML features list, JAWS will sometimes display the "JAWS virtual find" search dialog instead.
</p>
<h3>Virtual HTML features list solutions</h3>
<ol>
	<li>This also seems to be caused by the scope JAWS is currently in. It seems the (virtual) focus really needs to be inside the web content before you can use <kbd>INS</kbd> + <kbd>F3</kbd> for the virtual HTML Features list. Anywhere else, and you get the Virtual Find dialog.</li>
</ol>

<h2>Other techniques</h2>
<p>
The intention of this article is to gather other recovery techniques for all assistive technologies. What techniques do you use to handle strange behaviour in JAWS and other assistive technologies?
</p>
			</div>
		</content>
	</entry>
	<entry>
		<title>Custom-Built Dialogs</title>
		<link href="http://juicystudio.com/article/custom-built_dialogs.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-02-01:/custom-built_dialogs.php</id>
		<updated>2013-02-01T15:20:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/custom-built_dialogs.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
Custom-built dialogs are common in web-based applications, but many are not accessible. Most of them are not announced to assistive technologies, and so screen reader users are not made aware that a dialog has been launched. Many are also not focused when they are launched, and so keyboard-only users are still focused on elements in the background, and might have to navigate through the content in order to reach the dialog.  
</p>
<p>
The <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a> specification defines roles and attributes that help ensure dialogs are announced correctly to assistive technology users, and provides guidance on ensuring they are keyboard accessible.
</p>

<h2>WAI-ARIA Dialogs</h2>
<p>
WAI-ARIA provides the <a href="http://www.w3.org/TR/wai-aria/roles#dialog">dialog</a> and <a href="http://www.w3.org/TR/wai-aria/roles#alertdialog">alertdialog</a> roles to define dialogs. The <code>dialog</code> role is used when the user is expected to provide data, and the <code>alertdialog</code> role is used to announce the contents of a dialog to the user.
</p>
<p>
The container element for both <code>dialog</code> and <code>alertdialog</code> should use <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby">aria-labelledby</a> to identify the element containing the accessible name for the dialog (usually, the heading). This is announced when the dialog first receives focus, along with the role of dialog so the user understands the context. The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-label">aria-label</a> attribute may be used if there is no heading in the dialog, but all dialogs should contain a visible heading.
</p>

<h3>Using the <code>alertdialog</code> role</h3>
<p>
Authors should use the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby">aria-describedby</a> attribute to identify the message of an <code>alertdialog</code>. When the dialog is displayed, focus should be placed on an active element within the dialog, such as an OK button.
</p>
<p>
Consider a simple dialog with a list of instructions for shutting down a system.
</p>
<figure>
<figcaption>Shutdown dialog</figcaption>
<img alt="Instructions for shutdown" src="/img/article/dlg.gif"/>
</figure>

<p>
The container for the dialog should have a role of <code>alertdialog</code>, with the <code>aria-labelledby</code> attribute containing a value that matches the <code>id</code> attribute value for the heading, and the <code>aria-describedby</code> attribute containing a value that matches the <code>id</code> attribute value for the description.
</p>

<figure>
<figcaption>Design pattern for an <code>alertdialog</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="alertdialog"</span>
     <span class="highlight">aria-labelledby="dlgtitle"</span>
     <span class="highlight">aria-describedby="instructions"</span>&gt;
  &lt;h1 <span class="highlight">id="dlgtitle"</span>&gt;Shutdown instructions&lt;/h1&gt;
  &lt;ol <span class="highlight">id="instructions"</span>&gt;
    &lt;li&gt;Open timesheet&lt;/li&gt;
    &lt;li&gt;Enter time for today&lt;/li&gt;
    &lt;li&gt;Close all open applications&lt;/li&gt;
    &lt;li&gt;Shut down system&lt;/li&gt;
  &lt;/ol&gt;
  &lt;div&gt;
    &lt;input type="button" value="OK"&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</figure>

<h3>Using the <code>dialog</code> role</h3>
<p>
When a role of <code>dialog</code> is used, screen readers automatically go in to application mode. This shouldn't be a problem, as the dialog role should be used for getting data from the user, and screen readers usually automatically go into forms mode when interacting with form controls. Consider a dialog for the user to signup to a newsletter. As with the <code>alertdialog</code> example, focus should be placed on an active element within the dialog; in this case, the "Email" edit box.
</p>

<figure>
<figcaption>Dialog for user to signup to newsletter</figcaption>
<img alt="Prompt for email address in a dialog" src="/img/article/dlgnews.gif"/>
</figure>

<p>
The container for the dialog should have a role of <code>dialog</code>, with the <code>aria-labelledby</code> attribute containing a value that matches the <code>id</code> attribute value for the heading.
</p>

<figure>
<figcaption>Design pattern for a <code>dialog</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="dialog"</span> <span class="highlight">aria-labelledby="dlgtitle"</span>&gt;
  &lt;h1 <span class="highlight">id="dlgtitle"</span>&gt;Sign up to Newsletter&lt;/h1&gt;
  &lt;div&gt;
    &lt;label for="email"&gt;Email: &lt;/label&gt;
    &lt;input type="text" id="email" name="email"&gt;
    &lt;input type="button" value="Sign up"&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</figure>

<p>
If we add instructions to the newsletter signup dialog, a screen reader user wouldn't be able to use their reading keys to read the instructions, as the dialog is displayed in application mode. For this reason, instructions and cues should be programmatically associated using the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby">aria-describedby</a> attribute.
</p>

<p>
The following example includes instructions, which are programmatically associated to the "Email" edit box using <code>aria-describedby</code>.
</p>

<figure>
<figcaption>Dialog to signup to newsletter with instructions</figcaption>
<img alt="Instructions before email address in a dialog" src="/img/article/dlgnewsins.gif"/>
</figure>

<p>
The email address now requires the <code>aria-describedby</code> attribute containing a value that matches the <code>id</code> attribute value for the description.
</p>

<figure>
<figcaption>Design pattern for a <code>dialog</code> with instructions</figcaption>
<pre><code>&lt;div <span class="highlight">role="dialog"</span> <span class="highlight">aria-labelledby="dlgtitle"</span>&gt;
  &lt;h1 <span class="highlight">id="dlgtitle"</span>&gt;Sign up to Newsletter&lt;/h1&gt;
  &lt;ol <span class="highlight">id="instructions"</span>&gt;
    &lt;li&gt;Enter email address&lt;/li&gt;
    &lt;li&gt;Press the 'Sign up' button&lt;/li&gt;
    &lt;li&gt;You're all signed up!&lt;/li&gt;
  &lt;/ol&gt;
  &lt;div&gt;
    &lt;label for="email"&gt;Email: &lt;/label&gt;
    &lt;input type="text" 
           id="email"
           name="email"
           <span class="highlight">aria-describedby="instructions"</span>&gt;
    &lt;input type="button" value="Sign up"&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</figure>

<p>
There shouldn't really be a scenario where a screen reader user would need to interact with content in a <code>dialog</code> using reading keys, but if there is, the content that requires reading keys should be placed in a container with a role of <a href="http://www.w3.org/TR/wai-aria/roles#document">document</a>. For example, if the dialog contains a data table, then the data table should be in a container with a role of <code>document</code> so that screen reader users can use their table reading keys to interact with the table, although a data table in a dialog is likely a sign that the design of the dialog is incorrect.
</p>

<h2>Modal and non-modal dialogs</h2>
<p>
A modal dialog is a dialog that retains focus until the dialog is closed or dismissed. It should not be possible for keyboard-only users to accidentally tab into the background content when either a modal or non-modal dialog is displayed. With a modal and non-modal dialog, the user should either explicitly dismiss the dialog (for example, selecting "Cancel" or pressing <kbd>ESC</kbd>) or close it by taking a positive action, such as selecting "OK" or "Submit". With a non-modal dialog, the user should also be able to use the <kbd>F6</kbd> key to switch between the dialog and the main content.
</p>

<h2>Further reading</h2>
<ul>
	<li><a href="http://www.w3.org/TR/wai-aria-practices/#dialog_modal">WAI-ARIA Authoring practice design pattern for a modal dialog</a></li>
	<li><a href="http://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal">WAI-ARIA Authoring practice design pattern for a non-modal dialog</a></li>
	<li><a href="http://hanshillen.github.com/jqtest/#goto_dialog">Hans Hillen's dialog widget example</a></li>
</ul>

			</div>
		</content>
	</entry>
	<entry>
		<title>Accessible Data Tables with Static Headers</title>
		<link href="http://juicystudio.com/article/accessible_data_tables_static_headers.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-25:/accessible_data_tables_static_headers.php</id>
		<updated>2013-01-25T16:49:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/accessible_data_tables_static_headers.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
There are several techniques for creating tables with static header rows, but very few of the examples I have come across are accessible or do not work cross-browser. This post looks at some of the current solutions, and outlines a method using <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a> to fix the accessibility issues of the more popular techniques.
</p>

<h2>Current techniques</h2>
<p>
Ideally, this problem should be solved using just CSS by specifying the <code>height</code>, <code>overflow</code>, and <code>display</code> properties on the body of the table (<code>tbody</code>). This works to an extent, but is difficult to get working cross-browser. <a href="http://www.imaputz.com/cssStuff/bigFourVersion.html">Pure CSS Scrollable Table with Fixed Header</a> is an old but good example of a CSS version that works in most browsers and screen readers, but doesn't render properly in IE9.
</p>
<p>
Most solutions use JavaScript, and typically duplicate the header of the table into a separate table. <a href="http://fixedheadertable.com/">jQuery Plugin for Fixed Header Tables</a> is a good example of this technique, but there are plenty of other examples that essentially do the same. This technique is popular, because it's easier to get to work cross-browser. The accessibility of this solution is not so good, as it results in a separate table just for the headers. Most of the solutions that attempt to remain accessible duplicate the headers in the scrolling table and hide them visually so they are still available to screen readers; but there is still a redundant table in the content containing just the headers.
</p>

<h2>WAI-ARIA as a repair technique</h2>
<p>
As having two tables seems to be the most reliable in terms of portability, one solution would be to repair the technique so that it appears as a single table to assistive technologies. Consider a data table that determines calories burned depending on the weight and pace of a runner with the headers in a completely different table so that the main body can be set to scroll, as most approaches appear to use this or a variation on this technique.
</p>

<figure>
<figcaption>Table with static headers</figcaption>
<img src="/img/article/scrolltab.gif" alt="Table scrolled slightly"/>
</figure>

<figure>
<figcaption>Typical markup with two separate data tables</figcaption>   
<pre><code>&lt;table&gt;
&lt;tr&gt;
  &lt;th&gt;Pace&lt;/th&gt;
  &lt;th&gt;59KG&lt;/th&gt;
  &lt;th&gt;74KG&lt;/th&gt;
  &lt;th&gt;86KG&lt;/th&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;table&gt;
&#8943;
&lt;tr&gt;
  &lt;th&gt;12 min/mile&lt;/th&gt;
  &lt;td&gt;472 cal/hour&lt;/td&gt;
  &lt;td&gt;582 cal/hour&lt;/td&gt;
  &lt;td&gt;691 cal/hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;th&gt;11 min/mile&lt;/th&gt;
  &lt;td&gt;532 cal/hour&lt;/td&gt;
  &lt;td&gt;655 cal/hour&lt;/td&gt;
  &lt;td&gt;734 cal/hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;th&gt;10 min/mile&lt;/th&gt;
  &lt;td&gt;591 cal/hour&lt;/td&gt;
  &lt;td&gt;727 cal/hour&lt;/td&gt;
  &lt;td&gt;864 cal/hour&lt;/td&gt;
&lt;/tr&gt;
&#8943;
&lt;/table&gt;</code></pre>
</figure>

<p>
The process to repair and merge the table with WAI-ARIA is outlined below:
</p>

<ul>
	<li>Merge the two tables (headings and main data) in a single container that has a role of <a href="http://www.w3.org/TR/wai-aria/roles#grid">grid</a>.</li>
	<li>Change the role of the two existing data tables to <a href="http://www.w3.org/TR/wai-aria/roles#presentation">presentation</a> so they are ignored by assistive technologies.</li>
	<li>Remove hidden headers from the main data table if they have been provided.</li>
	<li>Use the roles <a href="http://www.w3.org/TR/wai-aria/roles#row">row</a>, <a href="http://www.w3.org/TR/wai-aria/roles#columnheader">columnheader</a>, <a href="http://www.w3.org/TR/wai-aria/roles#rowheader">rowheader</a>, and <a href="http://www.w3.org/TR/wai-aria/roles#gridcell">gridcell</a> to create the structure of a single table.</li>
	<li>Use <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby">aria-labelledby</a> to create an association between the table and the table's header, so that the table is announced with the context of a heading, similar to a native HTML data table having a <code>caption</code>.</li>
	<li>Unless stated otherwise, a grid is considered editable. The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-readonly">aria-readonly</a> attribute should be used to indicate that it's a read-only data table.</li>
</ul>

<p>
The following is the resulting structure:
</p>

<figure>
<figcaption>Using WAI-ARIA to merge two tables to create a single table</figcaption>   
<pre><code>&lt;h2 <span class="highlight">id="calburn"</span>&gt;Calorie burn by pace and weight&lt;/h2&gt;
&lt;div <span class="highlight">role="grid"</span>
     <span class="highlight">aria-labelledby="calburn"</span>
     <span class="highlight">aria-readonly="true"</span>&gt;
  &lt;table <span class="highlight">role="presentation"</span>&gt;
  &lt;tr <span class="highlight">role="row"</span>&gt;
    &lt;th <span class="highlight">role="columnheader"</span>&gt;Pace&lt;/th&gt;
    &lt;th <span class="highlight">role="columnheader"</span>&gt;59KG&lt;/th&gt;
    &lt;th <span class="highlight">role="columnheader"</span>&gt;74KG&lt;/th&gt;
    &lt;th <span class="highlight">role="columnheader"</span>&gt;86KG&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/table&gt;

  &lt;table <span class="highlight">role="presentation"</span>&gt;
&#8943;
  &lt;tr <span class="highlight">role="row"</span>&gt;
    &lt;th <span class="highlight">role="rowheader"</span>&gt;12 min/mile&lt;/th&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;472 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;582 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;691 cal/hour&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr <span class="highlight">role="row"</span>&gt;
    &lt;th <span class="highlight">role="rowheader"</span>&gt;11 min/mile&lt;/th&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;532 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;655 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;734 cal/hour&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr <span class="highlight">role="row"</span>&gt;
    &lt;th <span class="highlight">role="rowheader"</span>&gt;10 min/mile&lt;/th&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;591 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;727 cal/hour&lt;/td&gt;
    &lt;td <span class="highlight">role="gridcell"</span>&gt;864 cal/hour&lt;/td&gt;
  &lt;/tr&gt;
&#8943;
  &lt;/table&gt;
&lt;/div&gt;</code></pre>
</figure>

<p>
Alternatively, the structure could be defined with WAI-ARIA removing the HTML tables completely, as it's far easier to control the <code>div</code> elements with CSS than the tables. 
</p>

<figure>
<figcaption>Using WAI-ARIA alone to define a data table</figcaption>   
<pre><code>&lt;h2 <span class="highlight">id="calburn"</span>&gt;Calorie burn by pace and weight&lt;/h2&gt;
&lt;div <span class="highlight">role="grid"</span>
     <span class="highlight">aria-labelledby="calburn"</span>
     <span class="highlight">aria-readonly="true"</span>&gt;
  &lt;div <span class="highlight">role="row"</span>&gt;
    &lt;span <span class="highlight">role="columnheader"</span>&gt;Pace&lt;/span&gt;
    &lt;span <span class="highlight">role="columnheader"</span>&gt;59KG&lt;/span&gt;
    &lt;span <span class="highlight">role="columnheader"</span>&gt;74KG&lt;/span&gt;
    &lt;span <span class="highlight">role="columnheader"</span>&gt;86KG&lt;/span&gt;
  &lt;/div&gt;
  &lt;div id="scrolling"&gt;
&#8943;
    &lt;div <span class="highlight">role="row"</span>&gt;
      &lt;span <span class="highlight">role="rowheader"</span>&gt;12 min/mile&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;472 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;582 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;691 cal/hour&lt;/span&gt;
    &lt;/div&gt;
    &lt;div <span class="highlight">role="row"</span>&gt;
      &lt;span <span class="highlight">role="rowheader"</span>&gt;11 min/mile&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;532 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;655 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;734 cal/hour&lt;/span&gt;
    &lt;/div&gt;
    &lt;div <span class="highlight">role="row"</span>&gt;
      &lt;span <span class="highlight">role="rowheader"</span>&gt;10 min/mile&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;591 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;727 cal/hour&lt;/span&gt;
      &lt;span <span class="highlight">role="gridcell"</span>&gt;864 cal/hour&lt;/span&gt;
    &lt;/div&gt;
&#8943;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</figure>

<h2>Accessibility of this solution</h2>
<p>
This solution works well using JAWS. Unfortunately, it does not work well with VoiceOver on an iPad iOS6 or on a Mac. VoiceOver recognises the table as a single table, but does not map the <code>columnheader</code> or <code>rowheader</code> roles as column and row headers properly. In iOS6 they're ignored, and on a Mac they're reported incorrectly (thanks to <a href="http://www.html5accessibility.com/">Steve Faulkner</a> for testing these roles on a Mac with VoiceOver). 
</p>
<p>
Further, the <a href="http://validator.w3.org/">W3C validator</a> currently reports an error for <code>columnheader</code> and <code>rowheader</code> roles contained in a <code>row</code>, but <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=20756">a bug has been filed</a> and it is expected that this issue will be resolved shortly.
</p>

<h2>Conclusion</h2>
<p>
The best solution would be to use CSS to scroll the main body while leaving the headers static, but there doesn't appear to be an accessible solution that works cross-browser. If anyone knows of a solution, please post in the comments. As the most popular technique to have static headers in a data table is to put the headers and the table content in two different tables, then this repair technique seems reasonable (or defining the structure with WAI-ARIA alone). It's a shame the WAI-ARIA <code>columnheader</code> and <code>rowheader</code> roles are not better supported in VoiceOver, but support is likely to improve. 
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>Mobile Accessibility Survey</title>
		<link href="http://juicystudio.com/article/mobile_accessibility_survey.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-18:/mobile_accessibility_survey.php</id>
		<updated>2013-01-18T11:27:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/mobile_accessibility_survey.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
The Paciello Group (TPG) is carrying out a <a href="http://www.paciellogroup.com/mobile/">mobile accessibility survey</a>. The survey will be available until the end of the month. If you have not taken or shared the survey, please do soon, as your input is valuable and we do not want to miss it.
</p>

<p>
The survey is a simple 15 question survey that takes just a few moments to complete, and we're looking for input from people with disabilities or people using assistive technologies on a mobile device. The more information we can gather on usage patterns, the better accessibility practitioners will be able to help mobile developers deliver accessible experiences.
</p>
<p>
Tabulated findings will be made public when the survey is complete to help mobile authors and accessibility professionals better serve the mobile accessibility community.
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>WAI-ARIA Live Regions Updated</title>
		<link href="http://juicystudio.com/article/wai-aria_live-regions_updated.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-14:/wai-aria_live-regions_updated.php</id>
		<updated>2013-01-14T16:57:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/wai-aria_live-regions_updated.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
I wrote about the <abbr title="World Wide Web Consortium">W3C</abbr>'s <a href="http://www.w3.org/TR/wai-aria/">Web Accessibility Initiative - Accessible Rich Internet Applications</a> (<abbr>WAI-ARIA</abbr>)'s live region properties 6 years ago, but the WAI-ARIA specification has changed significantly in that time, and the details in that article are now outdated. The examples in the original article used XHTML namespaces, which are irrelevant now that WAI-ARIA is supported in HTML5.
</p>
<p>
The original out-of-date article now redirects to this entry, which provides more information on live regions and how to use them, along with roles that have implied live regions.
</p>

<h2>Rich Internet Applications</h2>
<p>
When developers first built rich internet applications using a combination of <abbr title="HyperText Markup Language">HTML</abbr>, <abbr title="Cascading Style Sheets">CSS</abbr>, and JavaScript, people with disabilities were left behind because those applications failed to provide the semantics required to be understood by assistive technologies. Sadly, not much has changed over the years, but that doesn't need to be the case. WAI-ARIA is capable of providing sufficient semantics to ensure rich internet applications can be understood, and is now relatively well supported.
</p>
<p>
A significant issue that the WAI-ARIA specification addresses is where parts of the page are updated without informing assistive technology users, using live regions.
</p>
<h2>Live Regions</h2>
<p>
Live regions inform assistive technology users of updates in the document without the user losing focus from their current activity. For example, announcing changes in a table that is dynamically updated with stock information. Live regions can also be used to aid the understanding of complex widgets. For example, Hans Hillen uses a hidden live region to announce how many items are returned in his <a href="http://hanshillen.github.com/jqtest/#goto_autocomplete">example of an auto-complete widget</a>, along with instructions to use the cursor keys to navigate through the list, as support for autocomplete isn't that good without this context at the moment. The following properties are used to define a live region.
</p>

<h3>The <code>aria-live</code> property</h3>
<p>
The  <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-live">aria-live</a> property indicates a section within the content that is live and the verbosity in which changes shall be announced. The following values may be used to determine the verbosity.
</p>

<dl>
	<dt><code>aria-live="off"</code></dt>
	<dd>
	The default value that indicates that a region is not live, and changes will not be announced.
	</dd>
	<dt><code>aria-live="polite"</code></dt>
	<dd>
	The update should be announced at the next graceful interval, such as when the user stops typing.
	</dd>
	<dt><code>aria-live="assertive"</code></dt>
	<dd>
	The update is announced to the user immediately. As this is obtrusive, a value of <code>assertive</code> should only be used when the update is important and the user should be informed immediately.
	</dd>
</dl>
<p>
In the following example, text changes or additions to the unordered list, they will be announced to the user.
</p>
<figure>
<figcaption>Using <code>aria-live="polite"</code></figcaption>
<pre><code>&lt;ul <span class="highlight">aria-live="polite"</span>&gt;
  &lt;li&gt;Item 1&lt;/li&gt;
  &lt;li&gt;Item 2&lt;/li&gt;
  &lt;li&gt;item 3&lt;/li&gt;
&lt;/ul&gt;</code></pre>
</figure>

<h3>The <code>aria-atomic</code> property</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-atomic">aria-atomic</a> property is an optional property that can have the values <code>true</code> or <code>false</code> (default). When the region is updated, the atomic property is used to indicate if assistive technologies should present all or part of the changed region to the user, and is influenced by the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-relevant">aria-relevant</a> property. If the <code>aria-atomic</code> property is set to <code>true</code>, assistive technologies should present the entire region as a whole depending on the <code>aria-relevant</code> property; otherwise, the part of the region that changed might be announced on its own.
</p>
<p>
Sometimes, updates make sense on their own, such as a new line arriving in a chat application. Other times, changes in the content may not make sense without the context of other parts of the region. In these cases, <code>aria-atomic="true"</code> should be set on the relevant container so the region is presented as a whole. In the following example, if a change is made anywhere in the <code>div</code> element, the whole content is announced to the user.
</p>

<figure>
<figcaption>Announcing the region as a whole</figcaption>
<pre><code>&lt;div aria-live="polite" 
    <span class="highlight">aria-atomic="true"</span>&gt;
  &lt;h3&gt;Currently playing&lt;/h3&gt;
  &lt;p&gt;Jake Bugg - Lightening Bolt&lt;/p&gt;
&lt;/div&gt;</code></pre>
</figure>

<h3>The <code>aria-relevant</code> property</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-relevant">aria-relevant</a> property is an optional property used to indicate the type of update that should be announced within a region. The <code>aria-relevant</code> property accepts a space separated list of the following property values:
</p>

<dl>
	<dt><code>aria-relevant="additions"</code></dt>
	<dd>Announcements are made when elements are added to the <abbr title="Document Object Model">DOM</abbr> within the region</dd>
	<dt><code>aria-relevant="removals"</code></dt>
	<dd>Announcements are made when elements are removed from the <abbr title="Document Object Model">DOM</abbr> within the region</dd>
	<dt><code>aria-relevant="text"</code></dt>
	<dd>Announcements are made when text is added or removed from the <abbr title="Document Object Model">DOM</abbr></dd>
	<dt><code>aria-relevant="all"</code></dt>
	<dd>All of the above (<code>additions</code>, <code>removals</code>, <code>text</code>) apply to this region</dd>
</dl> 
<p>
In the absence of an explicit <code>aria-relevant</code> property, the default is to assume there are text changes and additions (<code>aria-relevant="text additions"</code>). In the following example, only additions to the unordered list will be announced to the user.
</p>

<figure>
<figcaption>Announce additions to the region</figcaption>
<pre><code>&lt;ul aria-live="polite" 
    <span class="highlight">aria-relevant="additions"</span>&gt;
  &lt;li&gt;Item 1&lt;/li&gt;
  &lt;li&gt;Item 2&lt;/li&gt;
  &lt;li&gt;item 3&lt;/li&gt;
&lt;/ul&gt;</code></pre>
</figure>

<h3>The <code>aria-busy</code> property</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-busy">aria-busy</a> property should be used when the region is busily being updated, and stops updates being announced before they are complete. Setting <code>aria-busy="true"</code> on the region suppresses announcements until the attribute is removed, or the value changed to <code>false</code>. Assistive technologies collate the changes, and announce them when the region is no longer busy. In the following example, nothing is announced while the list items for the unordered list are being gathered. When the developer set <code>aria-busy="false"</code> or removes the <code>aria-busy</code> attribute, the unordered list will be announced.
</p>
<figure>
<figcaption>Temporarily stop updates being announced while busy</figcaption>
<pre><code>&lt;ol aria-live="polite" 
    <span class="highlight">aria-busy="true"</span>&gt;
&#8943;
&lt;/ol&gt;</code></pre>
</figure>

<h2>Roles with live regions</h2>
<p>
WAI-ARIA also defines some roles that have live regions.
</p>
<h3>The <code>alert</code> role</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/roles#alert">alert role</a> is used to provide important information immediately to the user. A role of <code>alert</code> is an assertive live region, meaning the message will be delivered to the user immediately.
</p>
<figure>
<figcaption>Role of <code>alert</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="alert"</span>&gt;
  Maximum amount reached.
&lt;/div&gt;</code></pre>
</figure>

<h3>The <code>status</code> role</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/roles#status">status role</a> is used to provide advisory information to the user that isn't important enough for an alert. A role of <code>status</code> has an implicit <code>aria-live</code> value of <code>polite</code>, but this doesn't necessarily mean it will be announced to the user. Authors can use the <code>aria-live</code> property on the region to override how it's usually handled by assistive technologies.
</p>
<figure>
<figcaption>Role of <code>status</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="status"</span>&gt;
  3 new messages in inbox.
&lt;/div&gt;</code></pre>
</figure>

<h3>The <code>timer</code> role</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/roles#timer">timer role</a> marks a region that contains a counter that represents either elapsed or remaining time that are updated as time changes until the timer is paused or completes the time count. A role of <code>timer</code> is a live region with an implied <code>aria-live</code> value of <code>off</code>.
</p>
<figure>
<figcaption>Role of <code>timer</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="timer"</span>&gt;
  29
&lt;/div&gt;</code></pre>
</figure>

<h3>The <code>marquee</code> role</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/roles#marquee">marquee role</a> is used when non-essential information changes regularly. A role of <code>marquee</code> is a live region with an implied <code>aria-live</code> value of <code>off</code>. If you use marquees, ensure you provide a simple provision to stop it scrolling and updating, as they can be distracting and annoying.
</p>

<figure>
<figcaption>Role of <code>marquee</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="marquee"</span>&gt;
  Marquee text.
&lt;/div&gt;</code></pre>
</figure>

<h3>The <code>log</code> role</h3>
<p>
The <a href="http://www.w3.org/TR/wai-aria/roles#log">log role</a> is used for regions where new messages are added at the end of the log, and older messages may disappear from the log, such as a chat log or messages in an error console. A role of <code>log</code> has an implicit <code>aria-live</code> value of <code>polite</code>. If a text area is used to send updates to the region with a role of <code>log</code>, the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-controls">aria-controls</a> attribute should be used to define the relationship.
</p>
<figure>
<figcaption>Role of <code>log</code></figcaption>
<pre><code>&lt;div <span class="highlight">role="log"</span> <span class="highlight">id="chatarea"</span>&gt;
  &lt;span class="name"&gt;Dave: &lt;/span&gt; What time will you be finished?
&lt;/div&gt;
&#8943;
&lt;div&gt;
  &lt;label for="chat"&gt;Chat: &lt;/label&gt;
  &lt;input <span class="highlight">aria-controls="chatarea"</span>
         type="text" 
         size="40" 
         name="chat" 
         id="chat"&gt;
&lt;/div&gt;</code></pre>
</figure>

<p>
For further information about using WAI-ARIA's live regions, see the authoring practices guide for WAI-ARIA on <a href="http://www.w3.org/WAI/PF/aria-practices/#docmgt">managing dynamic changes</a>.
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>Layout tables and repair techniques</title>
		<link href="http://juicystudio.com/article/layout_tables_repair_techniques.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-07:/layout_tables_repair_techniques.php</id>
		<updated>2013-01-07T15:00:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/layout_tables_repair_techniques.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
Tables shouldn't be used for layout, as they can result in redundant information being announced as the user navigates through the document using a screen reader, such as "table with 3 columns and 4 rows column 1 row 2 &#8943;". When nested tables are used, other redundant information is announced, such as "table nesting level 3 column 2 row 1 &#8943;".
</p>
<p>
If tables are used for layout, then the WAI-ARIA <a href="http://www.w3.org/TR/wai-aria/roles#presentation">presentation role</a> can be used to remove the table semantics so the table information is no longer announced when the user navigates the page.
</p>
<figure>
<figcaption>Supress table semantics with <code>role="presentation"</code></figcaption>
<pre><code>&lt;table <span class="highlight">role="presentation"</span>&gt;
&#8943;
&lt;/table&gt;</code></pre>
</figure>

<p>
When controls are grouped in a <code>fieldset</code> element with a <code>legend</code>, the content of the legend element is announced by screen readers to provide context for the individual controls in the fieldset. This is particularly useful for controls like radio buttons where the group needs a label, as the individual labels for each radio button may not make sense on their own; for example, if the label is just "Yes" or "No". Unfortunately, if the form controls in the fieldset are in a layout table, then the legend is not announced as a label for the group in JAWS, even if the table has <code>role="presentation"</code>.
</p>

<h2>Layout tables</h2>
<p>
Although using <code>role="presentation"</code> stops redundant table information being announced to screen reader users, form controls within a <code>fieldset</code> are not reliably announced by JAWS with the context of the <code>legend</code> element to provide a label for the group. In the following example, when a JAWS user navigates through the radio buttons, they hear something like, "radio button not checked maybe 1 of 3", "radio button not checked yes 2 of 3", and "radio button not checked no 3 of 3" without the context of "Attending" (Firefox with JAWS provides the context when navigating forwards to a radio button in the group, but not when navigating backwards to a radio button in the group. IE with JAWS completely ignores the context provided by the legend element).
</p>

<figure>
<figcaption>The <code>legend</code> element is ignored in JAWS</figcaption>
<pre><code>&lt;fieldset&gt;
&lt;legend&gt;Attending?&lt;/legend&gt;
&lt;table <span class="highlight">role="presentation"</span>&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio" 
           id="att1" 
           name="att" 
           value="maybe"&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att1"&gt;Maybe&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio" 
           id="att2" 
           name="att" 
           value="yes"&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att2"&gt;Yes&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio" 
           id="att3" 
           name="att" 
           value="no"&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att3"&gt;No&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/fieldset&gt;</code></pre>
</figure>

<p>
If the layout table isn't included, a JAWS user hears "Attending" as the context for the radio button in the group that receives focus. Continuing to navigate through the radio buttons in the group only announces the radio button information, as the context has already been provided.
</p>

<h2>Repair techniques</h2>
<p>
When form controls are in a layout table within <code>fieldset</code>/<code>legend</code> elements, the context information is lost in JAWS, even when the table semantics are removed with <code>role="presentation"</code>. The obvious solution is to remove the layout table, but sometimes this option is too costly and developers just want a solution that works. One solution is to use WAI-ARIA's <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby">aria-describedby</a> attribute. To do this, add an <code>id</code> attribute to the <code>legend</code> element, and use <code>aria-describedby</code> on the radio buttons that references the <code>id</code> attribute set on the <code>legend</code> element.
</p>

<figure>
<figcaption>Using <code>aria-describedby</code> for a group label</figcaption>
<pre><code>&lt;fieldset&gt;
&lt;legend <span class="highlight">id="attleg"</span>&gt;Attending?&lt;/legend&gt;
&lt;table role="presentation"&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio" 
           id="att1" 
           name="att" 
           value="maybe" 
           <span class="highlight">aria-describedby="attleg"</span>&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att1"&gt;Maybe&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio" 
           id="att2" 
           name="att" value="yes" 
           <span class="highlight">aria-describedby="attleg"</span>&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att2"&gt;Yes&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &lt;input type="radio"
           id="att3" 
           name="att" 
           value="no" 
           <span class="highlight">aria-describedby="attleg"</span>&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;label for="att3"&gt;No&lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/fieldset&gt;</code></pre>
</figure>

<p>
This technique works with JAWS, but requires using <code>aria-describedby</code> for each element in the fieldset. This approach also has the undesirable effect of announcing the context after the radio button information, rather than before the radio button, as the user would be used to with regular elements within a <code>fieldset</code>/<code>legend</code> section. It also means that screen readers that do announce the group label provided by the legend element also announce the description afterwards, which is overly verbose.
</p>

<table>
<caption><h3>Results using <code>aria-describedby</code> as a repair technique</h3></caption>
<thead>
<tr>
	<th scope="col">User agent</th>
	<th scope="col">Result</th>
</tr>
</thead>
<tbody>
<tr>
	<th scope="row">IE9 and IE10 with JAWS 13</th>
	<td>"Attending?" Announced after the radio button information is announced.</td>
</tr>
<tr>
	<th scope="row">IE9 and IE10 with NVDA</th>
	<td>"Attending?" announced as the label for the group, and announced again as the long description after the radio button information is announced. </td>
</tr>
<tr>
	<th scope="row">Firefox 17 with JAWS 13</th>
	<td>Announced after the radio button information is announced.</td>
</tr>
<tr>
	<th scope="row">Firefox 17 with NVDA</th>
	<td>"Attending?" announced as the label for the group, and announced again as the long description after the radio button information is announced.</td>
</tr>
</tbody>
</table>

<p>
Ideally, we want a group label that is announced just once the first time the group is visited, so a more effective solution would be to use a role of <a href="http://www.w3.org/TR/wai-aria/roles#group">group</a> (or <a href="http://www.w3.org/TR/wai-aria/roles#region">region</a> if the section is significantly important) on the table element instead of the <code>presentation</code> role, and use <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby">aria-labelledby</a> to provide the name for the group. <a href="http://www.html5accessibility.com/">Steve Faulkner</a> pointed out that child element roles are unaffected by a parent role of <code>group</code>, so the table semantics are still present and need overriding with <code>role="presentation"</code>. This should result in the same relationship as <code>fieldset</code>/<code>legend</code> without the layout table.
</p>

<figure>
<figcaption>Using a role of <code>group</code> with a label for the group</figcaption>
<pre><code>&lt;fieldset&gt;
&lt;legend <span class="highlight">id="attleg"</span>&gt;Attending?&lt;/legend&gt;
&lt;table <span class="highlight">role="group"</span> <span class="highlight">aria-labelledby="attleg"</span>&gt;
&lt;tbody <span class="highlight">role="presentation"</span>&gt;
&lt;tr <span class="highlight">role="presentation"</span>&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;input type="radio" 
           id="att1"
           name="att"
           value="maybe"&gt;
  &lt;/td&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;label for="att1"&gt;Maybe&lt;/label&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr <span class="highlight">role="presentation"</span>&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;input type="radio" 
           id="att2" 
           name="att" 
           value="yes"&gt;
  &lt;/td&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;label for="att2"&gt;Yes&lt;/label&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr <span class="highlight">role="presentation"</span>&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;input type="radio" 
           id="att3" 
           name="att" 
           value="no"&gt;
  &lt;/td&gt;
  &lt;td <span class="highlight">role="presentation"</span>&gt;
    &lt;label for="att3"&gt;No&lt;/label&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/fieldset&gt;</code></pre>
</figure>

<p>
This arrangement works in Firefox, and ensures that the context is reliably provided before the radio button information just once when the group is visited forwards or backwards, in the same way as when the layout table isn't present with <code>fieldset</code>/<code>legend</code>. Unfortunately, it is completely ignored in IE with JAWS, and announced twice in browsers that do announce the <code>legend</code> content as a label for the group.
</p>
<table>
<caption><h3><code>role="group"</code> as a repair technique</h3></caption>
<thead>
<tr>
	<th scope="col">User agent</th>
	<th scope="col">Result</th>
</tr>
</thead>
<tbody>
<tr>
	<th scope="row">IE9 and IE10 with JAWS 13</th>
	<td>Group label not announced.</td>
</tr>
<tr>
	<th scope="row">IE9 and IE10 with NVDA</th>
	<td>"Attending?" group label announced twice.</td>
</tr>
<tr>
	<th scope="row">Firefox 17 with JAWS 13</th>
	<td>Group label announced once.</td>
</tr>
<tr>
	<th scope="row">Firefox 17 with NVDA</th>
	<td>"Attending?" group label announced twice.</td>
</tr>
</tbody>
</table>

<p>
As this attempt used lots of <code>role="presentation"</code> markup, I decided to wrap the table in a <code>div</code> element and moved the <code>role="group"</code> and <code>aria-labelledby</code> markup to the containing <code>div</code> element, and put the table role back to <code>role="presentation"</code>. This arrangement didn't work either. After further discussion with Steve Faulkner, he pointed out that IE doesn't suppress the semantics of table cell elements when <code>role="presentation"</code> is used on the <code>table</code> element (it should do). I added <code>role="presentation"</code> to each of the table cells, and it finally worked as expected.
</p>

<figure>
<figcaption>Nesting the table in a role of <code>group</code></figcaption>
<pre><code>&lt;fieldset&gt;
&lt;legend <span class="highlight">id="attleg"</span>&gt;Attending?&lt;/legend&gt;
&lt;div <span class="highlight">role="group"</span> <span class="highlight">aria-labelledby="attleg"</span>&gt;
  &lt;table <span class="highlight">role="presentation"</span>&gt;
  &lt;tr&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;input type="radio" 
             id="att1"
             name="att"
             value="maybe"&gt;
    &lt;/td&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;label for="att1"&gt;Maybe&lt;/label&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;input type="radio" 
             id="att2" 
             name="att" 
             value="yes"&gt;
    &lt;/td&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;label for="att2"&gt;Yes&lt;/label&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;input type="radio" 
             id="att3" 
             name="att" 
             value="no"&gt;
    &lt;/td&gt;
    &lt;td <span class="highlight">role="presentation"</span>&gt;
      &lt;label for="att3"&gt;No&lt;/label&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;/fieldset&gt;</code></pre>
</figure>

<table>
<caption><h3>Using role="presentation" on table cells in a table wrapped in a group element</h3></caption>
<thead>
<tr>
	<th scope="col">User agent</th>
	<th scope="col">Result</th>
</tr>
</thead>
<tbody>
<tr>
	<th scope="row">IE9 and IE10 with JAWS 13</th>
	<td>"Attending?" announced as the group label.</td>
</tr>
<tr>
	<th scope="row">IE9 and IE10 with NVDA</th>
	<td>"Attending?" group label announced twice.</td>
</tr>
<tr>
	<th scope="row">Firefox 17 with JAWS 13</th>
	<td>"Attending?" announced as group label twice when navigating forwards, and one when navigating backwards in to the group.</td>
</tr>
<tr>
	<th scope="row">Firefox 17 with NVDA</th>
	<td>"Attending?" group label announced twice.</td>
</tr>
</tbody>
</table>

<h2>Conclusion</h2>
<p>
The table element should only be used for describing data tables, rather than using tables for layout purposes. If layout tables absolutely cannot be avoided, then using <code>role="presentation"</code> is effective at ensuring that redundant table information isn't announced to screen reader users. However, this can't be relied on alone when form controls within <code>fieldset</code>/<code>legend</code> elements are in layout tables for JAWS users.
</p>
<p>
If it's impossible to avoid layout tables for the whole website, at least avoid using tables for layout within <code>fieldset</code>/<code>legend</code> elements. If this isn't possible, then the repair technique is to wrap the table in an element with <code>role="group"</code> and an <code>aria-labelledby</code> attribute that identifies the group label (the <code>legend</code>), and the <code>table</code> element and each table cell must be overridden with <code>role="presentation"</code>.
</p>
<p>
The repair technique for ensuring that form controls in a layout table within <code>fieldset</code>/<code>legend</code> elements is probably more complicated than not using layout tables in the first place, and duplicates the group label for assistive technologies that correctly ignore layout tables with <code>role="presentation"</code>. Sometimes, it's difficult to find a repair technique that works in all situations, but using the most semantically appropriate elements will always result in a more accessible experience.
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>Accessible Browser Validation in HTML5</title>
		<link href="http://juicystudio.com/article/accessible_browser_validation_html5.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-04:/accessible_browser_validation_html5.php</id>
		<updated>2013-01-04T17:44:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/accessible_browser_validation_html5.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
HTML5 allows you to specify <a href="http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-input-type">several useful input types</a>, such as <code>email</code>, <code>url</code>, and so on. When I updated Juicy Studio, I implemented the <code>email</code> and <code>url</code> input types along with the <code>required</code> attribute for the comment section. The <code>email</code> and <code>url</code> input types and <code>required</code> attribute are implemented in the latest versions of Firefox, Chrome, and Opera, but only the Firefox implementation is completely accessible. 
</p>

<p>
Thanks to <a href="http://www.webhostinghub.com/support/edu" hreflang="es">Maria Ramos</a> for providing a <a href="http://www.webhostinghub.com/support/es/misc/validacion-de-navegador" hreflang="es">Spanish translation</a> of this article.
</p>

<h2>Basic browser validation with HTML5</h2>
<p>
Using the <code>email</code>, <code>url</code> input types and the <code>required</code> attribute is very useful for developers, as the validation is done by the browser without the developer having to do anything. For example, the developer adds the required attribute to an input element, and the browser checks there is a value before submitting the form.
</p>

<figure>
<figcaption>Indicating a required field</figcaption>
<pre><code>&lt;label for="contactname"&gt;Name: &lt;/label&gt;
&lt;input <span class="highlight">required</span> id="contactname" &#8943;&gt;</code></pre>
</figure>
<p>
If the user attempts to submit the form, an error message is displayed.
</p>
<figure>
<figcaption>Error message for required field</figcaption>
<p>
<img src="/img/article/required.gif" alt="Firefox alert: please fill in this field"/>
</p>
</figure>

<p>
When an input with <code>type="url"</code> or <code>type="email"</code> is used, the browser validates the field to ensure the value is a valid email or URL if provided. The following example would check for a valid URL.
</p>

<figure>
<figcaption>Indicating input type of URL</figcaption>
<pre><code>&lt;label for="url"&gt;URL: &lt;/label&gt;
&lt;input <span class="highlight">type="url"</span> size="30" name="url" id="url"&gt;</code></pre>
</figure>

<p>
If the user doesn't provide a valid URL, an error message is displayed.
</p>
<figure>
<figcaption>Error message for invalid URL</figcaption>
<p>
<img src="/img/article/validurl.gif" alt="Firefox alert: please enter a url"/>
</p>
</figure>

<p>
The actual validation is a bit hit and miss. Firefox and Chrome both reject anything that doesn't start with http:// (just http: is all that's required for Firefox), and Opera will accept anything providing some text has been entered.
</p>
<p>
Validation for an email is also very simple, and just requires text around an @ symbol, so entries such as b@t are accepted as valid email addresses.
</p>
<figure>
<figcaption>Indicating input type of email</figcaption>
<pre><code>&lt;label for="email"&gt;Email: &lt;/label&gt;
&lt;input <span class="highlight">type="email"</span> size="30" name="email" id="email"&gt;</code></pre>
</figure>

<figure>
<figcaption>Error message for invalid email</figcaption>
<p>
<img src="/img/article/validemail.gif" alt="Firefox alert: please enter an email address"/>
</p>
</figure>

<h2>Browser validation accessibility</h2>
<p>
Firefox has implemented these attributes accessibly. All browsers that have implemented validation for these attributes do so before the form is submitted, and focus is placed on the first field that doesn't conform to the validation rules with a tooltip indicating the error. If a user submits a form where a required field has no value, focus is placed on the field and an error message is displayed. For the "Name" field used in this example, JAWS with Firefox announces, "Alert please fill in this field, Name edit required invalid entry".
</p>
<p>
Unfortunately, these attributes are not supported at all in IE9, and are not accessible in IE10, Chrome or Opera. The solution for now is to use the attributes, but also add the accessible information using <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a>. In browsers that support these attributes, the validation is performed before the <code>onsubmit</code> event is fired, so the simplest solution is to unobtrusively validate the fields when they lose focus. Unobtrusively indicating errors is preferable to forcing the user back to a field, or announcing that the field is in error, as the user should be able to navigate unhindered through the page.
</p>
<p>
For a required field, the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-invalid">aria-invalid</a> and <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-required">aria-required</a> attributes should be used to programmatically indicate the field is required and in error. If the user does submit the form without providing the information, focus on the field (or the browser will focus on it if it's supported), and the information is programmatically available for assistive technology users. CSS can be used to target the error so there is also a visual indication of an error. The following uses an attribute selector, but you could use a class if you want to support older browsers.
</p>

<figure>
<figcaption>Using CSS to provide a visual indication of an error</figcaption>
<pre><code>[aria-invalid=true]
{
    outline: 2px solid #c66;
}</code></pre>
</figure>

<p>
For emails and URLs, it's a good idea to supplement the error with a message. The safest method of ensuring that the message is conveyed to the user is to append the error to the existing <code>label</code> element. Alternatively, you could use the <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby">aria-describedby</a> attribute to associate the error message if it's not included in the <code>label</code> element.
</p>

<figure>
<figcaption>Using <code>aria-describedby</code> to programmatically associate error message</figcaption>
<pre><code>&lt;label for="url"&gt;URL: &lt;/label&gt;
&lt;input type="url"
       <span class="highlight">aria-invalid="true"</span>
       <span class="highlight">aria-describedby="urltip"</span>
       id="url"
       name="url"&gt;
&lt;div <span class="highlight">id="urltip"</span>&gt;Please enter a valid email URL&lt;/div&gt;</code></pre>
</figure>

<h2>Conclusion</h2>
<p>
Firefox's implementation of HTML5 <code>email</code>, <code>url</code> input types and the <code>required</code> attribute is completely accessible and works well with screen readers. The attributes are useful and save developers time, but until the attributes are supported accessibly in all the main browsers, developers should use WAI-ARIA and the techniques outlined in this article to provide the missing accessibility information.
</p>

			</div>
		</content>
	</entry>
	<entry>
		<title>HTML5 caption element and headings</title>
		<link href="http://juicystudio.com/article/HTML5_caption_element_headings.php" rel="alternate"/>
		<id>tag:juicystudio.com,2013-01-03:/HTML5_caption_element_headings.php</id>
		<updated>2013-01-03T17:18:00Z</updated>
		<content type="xhtml" xml:lang="en-gb" xml:base="http://juicystudio.com/article/HTML5_caption_element_headings.php">
			<div xmlns="http://www.w3.org/1999/xhtml">
<p>
Last year, I had an interesting conversation with my colleague Hans Hillen, who suggested using regular HTML heading elements within the data table's caption element.  This technique is legal in HTML5, and ensures that not only is there an accessible name for the data table, but that screen reader users can also navigate using headings.
</p>

<p>
In previous versions of HTML, it was invalid to have a heading element within the caption element. When a data table followed a regular heading, developers were reluctant to use the caption element because of the redundancy, yet using the caption element provides an accessible name for the table. Having an accessible name for the data table means that when a screen reader user navigates to a data table, they hear a title for the data table, rather than have to navigate through data cells to determine its purpose, or navigate to the previous heading element and hope that it's the correct heading for this data table.
</p>
<p>
As headings are now allowed in the caption element, providing the heading within the caption element ensures that not only can users benefit from heading navigation, the data tables also have an accessible name is announced when the user first navigates to the table. The name also appears in JAWS' table list using the keystroke: <kbd>CONTROL</kbd> + <kbd>INSERT</kbd> + <kbd>T</kbd>.
</p>

<figure>
<figcaption>Heading within the <code>caption</code> element</figcaption>
<pre><code>&lt;table&gt;
<span class="highlight">&lt;caption&gt;</span>
  <span class="highlight">&lt;h2&gt;</span>Account transactions for current account<span class="highlight">&lt;/h2&gt;</span>
<span class="highlight">&lt;/caption&gt;</span>
&#8943;
&lt;/table&gt;</code></pre>
</figure>
			</div>
		</content>
	</entry>
</feed>
