{"id":5615,"date":"2020-10-05T13:40:00","date_gmt":"2020-10-05T13:40:00","guid":{"rendered":"https:\/\/azoora.com\/blog\/?p=5615"},"modified":"2020-10-04T13:43:31","modified_gmt":"2020-10-04T13:43:31","slug":"aria-web-standards-html-apps-accessibility","status":"publish","type":"post","link":"https:\/\/azoora.com\/blog\/information\/aria-web-standards-html-apps-accessibility\/","title":{"rendered":"ARIA Web Standards &#038; HTML Apps Accessibility"},"content":{"rendered":"\n<p>A truly open and inclusive web needs technologies that allow disabled users relying on assistive technologies to enjoy dynamic web content and modern web apps. W3C\u2019s accessibility web standards aim to populate the web with&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/\">Accessible Rich Internet Applications (ARIA)<\/a>&nbsp;that users with disabilities can efficiently use.<\/p>\n\n\n\n<p>ARIA is one of the numerous\u00a0<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/WAI\/standards-guidelines\/\">accessibility standards and guidelines<\/a>\u00a0published by the Web Accessibility Initiative (WAI). It provides an additional markup that can be easily inserted into HTML documents. WAI-ARIA is a cross-platform an cross-device solution that\u00a0<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/2014\/03\/aria.html.en\">targets the Open Web Platform<\/a>, so don\u2019t only think about websites, but also about games, digital entertainment, healthcare, mobile, and other kinds of apps.<\/p>\n\n\n\n<p>In this post we will take a look at how you can add accessibility to your HTML documents with the help of WAI-ARIA standards.<\/p>\n\n\n\n<h4>The ARIA Framework<\/h4>\n\n\n\n<p>The syntax of HTML doesn\u2019t always allow developers to describe elements properly, to identify their roles, and specify the relationships between them.<\/p>\n\n\n\n<p>While that\u2019s rarely a problem for visitors who are in full possession of their senses, it can impede assistive technology users from understanding what\u2019s happening on the screen and exploring their options.<\/p>\n\n\n\n<p>This is the point where ARIA comes to our help, as it makes possible to define the purpose of different elements with the help of&nbsp;<strong>landmark roles<\/strong>, and describe their nature with&nbsp;<strong>aria-prefixed attributes<\/strong>.<\/p>\n\n\n\n<p>Aria-prefixed attributes have two types:&nbsp;<strong>properties<\/strong>&nbsp;that describe features that are less likely to change throughout the page life-cycle, and&nbsp;<strong>states<\/strong>&nbsp;that provide information about things that may frequently change due to user interaction.<\/p>\n\n\n\n<h4>Landmark Roles<\/h4>\n\n\n\n<p><strong>Landmark roles<\/strong>&nbsp;are the most well-known forms of ARIA\u2019s Roles Model (others are the Abstract Roles, the Widget Roles, and the Document Structure Roles). Landmark roles enable developers to identify large&nbsp;<strong>perceivable regions<\/strong>&nbsp;on the web page that assistive technology users may want to quickly access.<\/p>\n\n\n\n<p>There are 8 types of ARIA landmark roles, and they need to be added as attributes to the related HTML tags.<\/p>\n\n\n\n<h5>role=\u201dbanner\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#banner\">banner role<\/a>&nbsp;is intended to be used mainly for content that is related to the entire site, not just to individual pages. It\u2019s usually added as an attribute to the main header of the site for the logo and other important site-wide information.<\/p>\n\n\n\n<p>It\u2019s important that you can use the banner role only once within any HTML documents or apps.<\/p>\n\n\n\n<h5>role=\u201dmain\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#main\">main<\/a>&nbsp;landmark role is related to the main content of the document. It can\u2019t be used more than once on any HTML page. It usually follows the&nbsp;<code>&lt;div role=\"main\"&gt;<\/code>&nbsp;syntax, or in HTML5 the more semantic&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"http:\/\/html5doctor.com\/the-main-element\/\"><code>&lt;main role=\"main\"&gt;<\/code><\/a>. The latter was added to the W3C specs with the purpose of mapping the&nbsp;<strong>main<\/strong>&nbsp;ARIA landmark role to a semantic HTML element.<\/p>\n\n\n\n<h5>role=\u201dnavigation\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#navigation\">navigation<\/a>&nbsp;role is meant to be used for indicating an area that contains navigational elements such as links and lists on a site.<\/p>\n\n\n\n<h5>role=\u201dcomplementary\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#complementary\">complementary<\/a>&nbsp;landmark role describes additional content that is related to the main content of the site. It needs to be placed to the similar level in the DOM hierarchy as&nbsp;<code>role=\"main\"<\/code>. Related posts, popular articles, latest comments are typical examples of autonomous complementary content.<\/p>\n\n\n\n<h5>role=\u201dcontentinfo\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#contentinfo\">contentinfo<\/a>&nbsp;role informs user agents about the presence of a region where different kinds of metadata, such as copyright info, legal and privacy statements can be found. It\u2019s typically used for the footer of a site.<\/p>\n\n\n\n<h5>role=\u201dform\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#form\">form<\/a>&nbsp;landmark role indicates a form waiting for user input. For search forms you should use&nbsp;<code>role=\"search\"<\/code>&nbsp;instead.<\/p>\n\n\n\n<h5>role=\u201dsearch\u201d<\/h5>\n\n\n\n<p>The&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#search\">search<\/a>&nbsp;role is pretty self-explanatory, it\u2019s intended to help assistive technologies identify the search functionality of a website.<\/p>\n\n\n\n<h5>role=\u201dapplication\u201d<\/h5>\n\n\n\n<p>You can use the\u00a0<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#application\">application<\/a>\u00a0landmark role for a region that you want to declare as a web app, rather than a web document. It\u2019s not recommended to include it in traditional websites, as it hints to assistive technologies to switch from normal browsing mode to application browsing mode. You should only use this landmark role with great care.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-attachment-id=\"5616\" data-permalink=\"https:\/\/azoora.com\/blog\/information\/aria-web-standards-html-apps-accessibility\/attachment\/landmark-roles-example\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example.jpg\" data-orig-size=\"700,451\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"landmark-roles-example\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example-300x193.jpg\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example.jpg\" loading=\"lazy\" width=\"700\" height=\"451\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example.jpg\" alt=\"\" class=\"wp-image-5616\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example.jpg 700w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/landmark-roles-example-300x193.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<h4>States and Properties<\/h4>\n\n\n\n<p>While roles enable you to define the meaning of HTML tags,&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#dfn-state\">states<\/a>&nbsp;and&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#dfn-property\">properties<\/a>&nbsp;provide the user with extra information on how to interact with them. Both states and properties are marked with&nbsp;<strong>aria-prefixed attributes<\/strong>&nbsp;with the syntax&nbsp;<strong>aria-*<\/strong>.<\/p>\n\n\n\n<p>The most well-known ARIA attributes are probably the&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#requiredState\">aria-required<\/a>&nbsp;property and the aria-checked state. Aria-required is a&nbsp;<strong>property<\/strong>&nbsp;because it\u2019s a permanent feature of an input element (i.e. the user must fill it in), while aria-checked is a&nbsp;<strong>state<\/strong>&nbsp;because a checkbox may frequently change its value due to user interaction.<\/p>\n\n\n\n<h4>The Syntax of Aria-prefixed Attributes<\/h4>\n\n\n\n<p>States and properties sometimes take token values (a limited set of predefined values), for instance the&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-live\">aria-live<\/a>&nbsp;property can have 3 different values:&nbsp;<em>off<\/em>,&nbsp;<em>polite<\/em>,&nbsp;<em>assertive<\/em>. The syntax in this example looks like this:&nbsp;<code>&lt;div id=\"some-id\" class=\"some-class\" aria-live=\"assertive\"&gt;&lt;div&gt;<\/code>.<\/p>\n\n\n\n<p>In other cases the values of aria-prefixed attributes are represented by&nbsp;<em>strings<\/em>,&nbsp;<em>numbers<\/em>,&nbsp;<em>integers<\/em>,&nbsp;<em>ID references<\/em>&nbsp;or&nbsp;<em>true\/false<\/em>&nbsp;values.<\/p>\n\n\n\n<h4>How to Make Use of ARIA States and Properties<\/h4>\n\n\n\n<h5>1. Build Relationships Between Elements With Relationship Attributes<\/h5>\n\n\n\n<p>Use&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/2010\/WD-wai-aria-20100916\/states_and_properties#attrs_relationships\">relationship attributes<\/a>&nbsp;to indicate relationships between different elements on your site, that can\u2019t be otherwise determined from the document structure. For example the&nbsp;<code>aria-labelledby<\/code>&nbsp;property identifies the element that labels the current element.<\/p>\n\n\n\n<p><code>aria-labelledby<\/code>&nbsp;\u2013 among&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Accessibility\/ARIA\/ARIA_Techniques\/Using_the_aria-labelledby_attribute\">many other things<\/a>&nbsp;\u2013 can bind headings to ARIA landmark regions in the following way:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>1234567<\/td><td><code>&lt;<\/code><code>div<\/code> <code>role<\/code><code>=<\/code><code>\"main\"<\/code> <code>aria-labelledby<\/code><code>=<\/code><code>\"some-id\"<\/code><code>&gt;<\/code>&nbsp;<code>&lt;<\/code><code>h1<\/code> <code>id<\/code><code>=<\/code><code>\"some-id\"<\/code><code>&gt;This Is A Heading&lt;\/<\/code><code>h1<\/code><code>&gt;<\/code>&nbsp;<code>Main content...<\/code>&nbsp;<code>&lt;\/<\/code><code>div<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5>2. Synchronize States and Properties With The Element\u2019s Lifecycle<\/h5>\n\n\n\n<p>After you set an ARIA landmark role for a perceivable area on your HTML page, it can help assistive technologies a lot if you change the ARIA-prefixed states and properties of child elements in accordance with events happening on the screen.<\/p>\n\n\n\n<p>This can be crucial where users have to interact with the site, for example filling in a form or running a search query.<\/p>\n\n\n\n<h5>3. Match The Visual and The Accessible Interfaces<\/h5>\n\n\n\n<p>The general rule of thumb of accessibility design is that the current state of the user interface always needs to be perceivable by assistive technologies. For instance if the user chooses an option in a form, it needs to appear selected for assistive technologies too.<\/p>\n\n\n\n<p>This can be easily achieved by utilizing the&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/2010\/WD-wai-aria-20100916\/states_and_properties#aria-selected\">aria-selected<\/a>&nbsp;state with the following syntax:&nbsp;<code>&lt;option aria-selected=\"true\"&gt;&lt;\/option&gt;<\/code>.<\/p>\n\n\n\n<p>W3C\u2019s&nbsp;<a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/www.w3.org\/TR\/2010\/WD-wai-aria-practices-20100916\/\">WAI-ARIA Authoring Practices<\/a>&nbsp;guideline can give you many other great ideas about how to properly harmonize the visual and the accessible interfaces of your site.<\/p>\n\n\n\n<h4>Don\u2019t Overuse ARIA<\/h4>\n\n\n\n<p>Using ARIA roles and attributes sometimes can be redundant. When you use semantic tags of HTML5 such as&nbsp;<code>&lt;button&gt;&lt;\/button&gt;<\/code>&nbsp;or&nbsp;<code>&lt;form&gt;&lt;\/form&gt;<\/code>, modern web browsers add the appropriate ARIA semantics by default. In this case it has no sense to separately set the ARIA landmark roles.<\/p>\n\n\n\n<p>For example it\u2019s unnecessary to use the&nbsp;<strong>form<\/strong>&nbsp;landmark role to define the&nbsp;<code>&lt;form&gt;<\/code>&nbsp;element. Instead of the&nbsp;<code>&lt;form role=\"form\"&gt;&lt;\/form&gt;<\/code>&nbsp;syntax it\u2019s perfectly enough to use just&nbsp;<code>&lt;form&gt;&lt;\/form&gt;<\/code>. It\u2019s also superfluous to use HTML\u2019s native attributes along with the appropriate ARIA attribute.<\/p>\n\n\n\n<p>So if you\u2019ve already added the&nbsp;<strong>hidden<\/strong>&nbsp;HTML attribute to a form input, it\u2019s unnecessary to add the&nbsp;<strong>aria-hidden<\/strong>&nbsp;state, as the browser includes it by default.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A truly open and inclusive web needs technologies that allow disabled users relying on assistive technologies to enjoy dynamic web content and modern web apps. W3C\u2019s accessibility web standards aim to populate the web with&nbsp;Accessible Rich Internet Applications (ARIA)&nbsp;that users with disabilities can efficiently use. ARIA is one of the numerous\u00a0accessibility standards and guidelines\u00a0published by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":5617,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[77],"tags":[73],"jetpack_featured_media_url":"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2020\/10\/open-web-platform.jpg","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p7FQPL-1sz","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/5615"}],"collection":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/comments?post=5615"}],"version-history":[{"count":1,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/5615\/revisions"}],"predecessor-version":[{"id":5618,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/5615\/revisions\/5618"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media\/5617"}],"wp:attachment":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media?parent=5615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/categories?post=5615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/tags?post=5615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}