The Code4Lib Journal – A Practical Starter Guide on Developing Accessible Websites Mission Editorial Committee Process and Structure Code4Lib Issue 37, 2017-07-18 A Practical Starter Guide on Developing Accessible Websites There is growing concern about the accessibility of the online content and services provided by libraries and public institutions. While many articles cover legislation, general benefits, and common opportunities to improve web accessibility on the surface (e.g., alt tags), few articles discuss web accessibility in more depth, and when they do, they are typically not specific to library web services. This article is meant to fill in this vacuum and will provide practical best practices and code. by Cynthia Ng and Michael Schofield Web accessibility is increasingly important. One reason is legal: in the US the federal government recently updated their regulation on accessibility of digital content, Section 508, incorporating the W3C’s Web Content Accessibility Guidelines 2.0 as well as harmonizing the guidelines with the EU’s information and technology communications rules (United States Access Board, 2017). While Section 508 only explicitly applies to federal departments, based on wording in other sections, such as Section 504, any federally funded program can also be held accountable in following the same guidelines. Another reason is to ensure the site can be used by as broad a community as possible. Web accessibility generally refers to making digital services and tools understandable to assistive technology (AT) used primarily by those with disabilities. Being web accessible also improves access for older people, mobile users, new users, low bandwidth or older technology users, and people with low literacy or familiarity with the language (Henry & Arch, 2012). Meeting accessibility guidelines does not automatically make a web service usable, useful, or valuable. Although there are certain considerations specific to assistive technology users, consider using the universal design approach in making web services usable and accessible to as many people as possible including those with disabilities. Figure 1. User Experience Honeycomb showing the different facets of user experience. This article is meant to go beyond the low hanging fruit of creating accessible web content (as is often covered in accessibility articles) and focuses on the role of developers to make sites, tools, or services accessible. As such, the article assumes a basic knowledge of HTML, CSS, and website structure, and will not rehash guidelines generally meant for content creators, such as proper document structure, links, images and alt text, providing text alternatives to media, and document creation. The article will instead cover areas that are controlled at the system or template/theme level, emphasizing semantic markup, skip links, forms, media, fonts, roles and attributes of Web Accessibility Initiative Accessible Rich Internet Applications (WAI-ARIA), performance, and use of JavaScript. The article begins with an explanation of ARIA as it can be difficult to discuss different aspects of developing for web accessibility without referring to how ARIA may have an effect, especially in regards to early considerations. ARIA The WAI-ARIA (Web Accessibility Initiative Accessible Rich Internet Applications) specification allows roles to be assigned to specific (HTML) elements that signal the kind of content, possible interactions, and state of the application to compatible AT. ARIA represents an optional developmental layer that Devon Persing conceptualized as “the accessibility stack” (2016). Figure 2. Persing’s Accessibility Stack. This is a useful way to understand this toolset. Well-written HTML without frills is sufficiently accessible. As Barry T. Smith (2015) scolds us, Websites aren’t broken by default, they are functional, high-performing, and accessible. You break them. CSS’s various show/hide declarations — display: block; display: none; visibility: hidden; etc. — alter AT’s access to DOM elements. With care, CSS alone provides enough of a toolset to create screenreader-only instructions, skip links, and the like. Simple websites relying only on HTML and CSS might find that ARIA attributes are overkill. However, when JavaScript interacts with the DOM or responds to user behavior (such as a touch event), AT’s ability to communicate these changes is diminished. Thus, ARIA acts as a structural support that anticipates and better responds to change. ARIA has two features that aid AT tools: Roles and Attributes. ARIA Roles We use the ‘role’ attribute in an HTML element to essentially communicate its purpose. There are many values for the ‘role’ attribute, but the most common are the eight navigational landmark roles that define regions of the page. They are application banner complementary contentinfo form main navigation search The exception is for role=”application”, which tells AT that the page is an application rather than a document. These roles help the assistive device communicate the relationship of one piece of content to another. For instance,
describes the header of the page, whereas role=”complementary” designates sections that are complementary to the main content (role=”main”), such as a list of related articles. They can also guide complex interactions, for which in many cases semantic markup alone is not enough. These are typically for building complex, custom tools and applications (such as browser-based document editors), not for typical websites and content (see W3C, 2016b, and Fischer, 2010 for more information). Sometimes, adding a role attribute to certain elements seems redundant, such as