# Accessibility tests
The tests described here are intended to provide a relatively quick, standard process for checking the conformance of LocalGov Drupal. By necessity it covers a sub-set of WCAG success criteria, and wherever possible testers should avail themselves of the full WAI documentation, including the definitive Understanding (opens new window) and Techniques (opens new window) content.
- M - Manual
- A - Automated
- U - User
# 1. Resize
|Resize text [M]||1.4.4 (opens new window)||AA||Zoom to 200%. Confirm no loss of information or functionality.|
|Reflow [M]||1.4.10 (opens new window)||AA||Confirm no loss of information or functionality, and without scrolling in two dimensions at 320px width equivalent (assuming vertical scrolling content).|
For desktop testing, simulate this with Responsive Design Mode in Mozilla or Device Viewport Mode in Chromium browsers.
|Text spacing [M]||1.4.12 (opens new window)||AA||Increase:|
Embed the following CSS snippet for a proximate test:
# 2. Keyboard
|Keyboard control for all functionality [M]||2.1.1 (opens new window)/2.1.3 (opens new window)||A/AAA||Identify all functionality. Use only the keyboard to access all functions.|
Pay particular attention to mouse-centric functionality such as drag-and-drop, scroll, and zoom, and that mouse event handlers such as click have keyboard support.
|No keyboard trap [M]||2.1.2 (opens new window)||A||Navigate through the entire content using the keyboard. Ensure focus is not trapped in any element. Pay particular attention to embedded elements such as video and maps.|
|Visible focus [M]||2.4.7 (opens new window)||AA||Navgiate the content using the keyboard. Ensure that any elements that accept focus have a clear focus indicator, and that only one element displays a focus indicator at any given time.|
See 2.4.11 (opens new window) for guidance on clearly visible indicators.
|Links to skip blocks where appropriate [M]||2.4.1 (opens new window)||A||Identify blocks which may benefit from skip links. For example a list of recent news items, or navigation blocks. Ensure that there is a link to skip these blocks.|
As a minimum, the first focusable element on all pages should be a link to skip to the main page content.
|Focus order [M]||2.4.3 (opens new window)||A||Navigate the content using only the keyboard. You should encounter information in an order that is consistent with the meaning and structure of the content.|
Pay particular attention to elements where the
See also SC 1.3.2 - Meaningful sequence (opens new window)
|No change of context on focus [M]||3.2.1 (opens new window)||A||Ensure that when an element receives focus, there is no context change including:|
|Change of context on input [M]||3.2.2 (opens new window)||A||Check that entering data or selecting a form control has predictable effects. Where a potentially unpredictable effect will occur, such as focus moving to another form element on input, describe the effect to the user at the beginning of the form or as part of the element label.|
For example, a form control for a credit card may consist of four separate text inputs, with focus moving to the next as soon as the user enters 4 digits in the previous input.
This behaviour should be described to the user before the form control (although in this case the potential user benefit to the behaviour is questionable at best).
# 3. Colour, contrast, animation
Most automated tools including pa11y and FAE will check and report on colour contrast, but may not always correctly identify text sizes or test focus indicators and other non-text contrast.
For testing a single page, use the built-in browser accessibility tools which have excellent colour contrast coverage: Accessibility Inspector (Mozilla) or Lighthouse (Chromium).
When testing specific colour values during development, use an application like Colour Contrast Analyser (opens new window), a browser extension, or WebAIM's web-based contrast checker (opens new window).
|Colour contrast - regular text [M,A]||1.4.3 (opens new window)/1.4.6 (opens new window)||AA/AAA||Check that contrast ratio for regular text (under 18pt, or 14pt if bold) is at least 4.5:1 (AA) or 7:1 (AAA) using the W3C's contrast ratio definition.|
|Colour contrast - large text [M,A]||1.4.3 (opens new window)/1.4.6 (opens new window)||AA/AAA||Check that contrast ratio for large text (at least 18pt, or 14pt if bold) is at least 3:1 (AA) or 4.5:1 (AAA) using the W3C's contrast ratio definition.|
|Colour contrast - focus indicator [M]||1.4.11 (opens new window)||AA/AAA||Ensure the contrast ratio between any focus indicator and its background is at least 4.5:1 (AA) or 7:1 (AAA).|
|Contrast for graphical objects [M]||1.4.11 (opens new window)||AA/AAA||Where an graphical object is used to convey meaning to a user that is not communicated by other means, ensure the object has sufficient contrast in itself and against its background.|
For example, an icon of a telephone with a telephone number beside it must have sufficient contrast, unless the word 'Telephone number' or other meaningful label is also provided.
This is a complex issue - review the WAI Understanding documentation (opens new window) for more information.
|Colour contrast for selection [M,A]||1.4.3 (opens new window)/1.4.6 (opens new window)||AA/AAA||The CSS pseudo-element ::selection allows designers to style text which is selected. Ensure that selected text meets the minimum contrast ratio as per regular and large text above. (Use Cmd / Ctrl A to select all text in the selected browser window.)|
|High-contrast modes||1.4.3 (opens new window)||AA||Check that colour choices do not conflict with default settings for Windows High Contrast Mode and other OS / browser dark modes. This can be a cursory check - it is not possible to account for all user-defined preferences.|
|Meaning is not conveyed through colour alone||1.4.1 (opens new window)||A||Check that colour is not the sole method of communicating information or state. This includes but is not limited to:|
# 4. Links & buttons
To extract a list of all links on a page, along with their link text, try URL Extractor (opens new window). NB: This doesn't reliably determine link text / titles, especially when anchor elements surround multiple child elements such as an image + text.
(The Web Developer Toolbar browser extension used to provide this information, but recent versions only tabulate URLs without link text.)
|Link purpose [M,A]||2.4.4 (opens new window)/2.4.9 (opens new window)||A/AAA||Check that the purpose of each link on the page can be determined from the link text alone, or the link with its context (for example a link in a table cell may have context provided by a table header cell). Where links span multiple elements, for example an icon and text, ensure the text equivalents for non-text content make sense in combination with the link text. In most cases a null alt attribute for images.|
Where the link is to a downloadable resource, include the file size in the link text. This provides users with information that helps them to make a decision about whether to download the resource.
Where multiple versions of a resource are linked to, for example PDF and Word versions of a downloadable document, use consistent link text for the subject and distinguish the links with the format, for example 'Title of document (PDF 1MB)'.
|Link text unique across destinations [M,A]||2.4.4 (opens new window)||A||Check that link text is unique across link destinations. Automated tests can help with this. If links have the same destination, using the same text for them all is recommended (commonly found for things like contact links in a site header and footer).|
|Use the button element for buttons [M]||2.4.4 (opens new window)||A||Button and link elements behave differently in browsers, so use them for their intended purposes. Both are focusable, but buttons are triggered by either the space bar or the Enter key, while links are triggered by the Enter key. If a button is no focussed, the space bar will scroll the current window by a page. This is why you should rarely style links to look like buttons - a user pressing space bar may expect an action to be performed, but will instead have their viewport scrolled downwards.|
Links will be listed by most screen readers in a specific interface for users to browse available navigation options, buttons will not be.
|Link target size [M]||2.5.5 (opens new window)||AAA||Ensure touch targets have a size of at least 44 x 44 CSS pixels. Inline links and links with equivalent targets of sufficient size are not required to meet this minimum, but it is good practice nonetheless.|
# 5. Images
|All images have alt attributes [A]||1.1.1 (opens new window)||A||Test with an automated tool.|
|Populated image alt attributes are appropriate [M]||1.1.1 (opens new window)||A||Check that all images have appropriate alt attributes - null for decorative images, and communicating the purpose of the image otherwise.|
Web Developer Toolbar > Images > Display Alt Attributes shows alt attributes inline on a page.
Outline Images Without Alt Attributes from the same menu highlights images without alt attributes.
(View Image Information from the same menu provides a table of all images used on a page, but includes background images, and does not register null alt attributes.)
If in doubt, use the WAI alt Decision Tree (opens new window).
|Decorative images have a null alt attribute and no title attribute [M]||1.1.1 (opens new window)||A||NB: Although it's also acceptable to use the |
|Images of text have an alt attribute of the text in image unless the text is purely decorative [M]||1.1.1 (opens new window)||A|
|aria-label attributes are used appropriately [M]||1.1.1 (opens new window)||A|
# 6. Video & audio
|A text alternative serving an equivalent purpose should be provided for pre-recorded video and audio [M]||1.1.1/ 1.2 (opens new window)||A-AAA||Provide transcript for audio-only, audio-description for video-only.|
For synchronised media (audio and video) provide synchronised captions, and to achieve AAA provide sign language interpretation.
For live video and audio, only provide a descriptive label.
|Audio does not autoplay [M]||1.4.2 (opens new window)||A||Do not automatically play any sound that last more than 3 seconds. Best-practice is to not auto-play any audio.|
|Media can be controlled with the keyboard [M]||2.1.1 (opens new window)||A||Check that all media can be controlled with the keyboard, and can at least be paused with the space bar when focussed.|
|Assess seizure risk of video [M]||2.3.1 (opens new window)||A||Review video for flashes and blinks that may trigger photosensitive seizures.|
# 7. Forms
The Web Developer Toolbar provides several useful tools for viewing and testing forms:
- Display Form Details will show form element markup inline;
- Outline Form Fields Without Labels does exactly what you'd think;
- Remove Form Validation is useful for submitting incomplete forms which have client-side validation;
- View Form Information provides a tabular view of all form elements including their type and label.
|Form instructions [M]||3.3.2 (opens new window)||A||Provide general instructions to help users understand how to complete the form. These should be provided before the |
|Labels [A,M]||1.3.1 (opens new window)/3.3.2 (opens new window)||A||Ensure all form controls have explicitly associated |
If using the
|Label visibility [M]||-||-||If a label is hidden, use a technique (opens new window) that still makes it accessible to ATs.|
|Required information [M]||1.3.5 (opens new window)||AA||Use aria-required or required attribute on required elements. The latter is preferred since it provides client-side validation in most browsers and is announced by most screen readers.|
Labels for required fields should also contain the word 'required' - do not rely on colour alone to indicate required fields. An asterisk is less accessible, due to variations in screen reader handling, but acceptable if one of the required attributes is also used.
|Autocomplete / input purposes||1.3.5 (opens new window)||AA||Use the autocomplete attribute when appropriate to assist users, for example |
|Group related fields [M]||1.3.1 (opens new window)3.3.2 (opens new window)||A||Group related inputs with either a |
Radio buttons should always be grouped with a
When using ARIA group roles, set the
|Validation [M]||3.3||A-AAA||Use HTML5 input type attributes to support client-side validation and help users to not submit incomplete or invalid information.|
|Error notification [M]||3.3.1 (opens new window)/3.3.3 (opens new window)||A/AAA||If the user submits a form that results in an error or errors, notify the user.|
At a high-level, this should be done via the main heading of the page, generally an
Ideally, all errors should be enumerated and listed at the top of the form page in a container with
If providing error notification as a user inputs data, for example if an invalid character is used in a field, ensure the notification container has the
# 8. Non-HTML documents
- If possible don't use non-HTML formats, or provide HTML alternatives.
- Observe best accessibility practices for the document format: PDF (opens new window), MS Word (opens new window), MS Excel (opens new window), MS Powerpoint (opens new window)
# 9. Tables
|Use for tabular data only [M]||1.3.1 (opens new window)||A||Use the |
|Captions [M]||2.4.6 (opens new window)||AA||All tables should have a |
|thead, tbody, tfoot [M]||1.3.1 (opens new window)||A||Ensure structural elements within the table are used appropriately.|
|th scope defined [A]||1.3.1 (opens new window)||A||Set the |
|headers attribute [M]||1.3.1 (opens new window)||A||For complex tables with multiple or nested headers, use the |
# 10. Semantic, valid HTML
|Valid HTML [A]||4.1.1 (opens new window)||A||Validate the HTML of the page. See HTML Validation for details.|
|ARIA landmarks [A]||4.1.2 (opens new window)||A||Use ARIA landmarks to identify the regions of the page and help users navigate around it.|
Do not define the
|All content in landmark region [A]||1.3.1 (opens new window)||A||Ensure all content resides in a landmark region.|
|Consistent, contiguous headings [A,M]||1.3.1 (opens new window)/2.4.6 (opens new window)||A/AA||Heading elements should be consistent across a site and site sections. Heading ranks (levels) should be contiguous when increasing the heading level, but can skip levels when decreasing (e.g. |
There is an exception for fixed page sections, such as sidebars, which do not have to maintain rank flow from other content areas (source (opens new window)).
|Linear content flow [M]||1.3.2 (opens new window)||A||Content should be ordered in a meaningful sequence, when linearised. For example multi-column content should flow from the top to the bottom of each column, before moving to the top of the next column.|
|Use of most suitable elements [M]||1.3.1 (opens new window)||A||Check that the most suitable semantic elements are used for all content and controls. Common opportunities for improvement are:|
# 11. Document titles
|Unique across site [A]||2.4.2 (opens new window)||A||Check that all page titles are unique across a site. Most easily done with a crawler and post-crawl analysis.|
|Page titles reflect content [M]||2.4.2 (opens new window)||A||Check that page titles are meaningful and reflect the page content.|
# 12. Screen reader
|Communicate important state changes [M]||4.1.3||A||Communicate important state changes to users of AT by setting the |
|ARIA widget attributes [M]||[4.1.2]||A||Define appropriate aria attributes for interface elements. For example |
# 13. Content
|Default human language [AA]||3.1.2 (opens new window)||A||Check the HTML element has the lang attribute set.|
|Unusual words||3.1.3 (opens new window)||AAA||Minimise jargon, provide explanations for specialist language.|
|Abbreviations+ [M]||3.1.4 (opens new window)||AAA||Use appropriate HTML to define abbreviations, initialisms, and acronyms. Always expand abbreviations+ on first use.|
|Use plain language||3.1.5 (opens new window)||AAA||Content should be written as clearly and simply as possible.|
# 14. Progressive enhancement
- Create a baseline experience using HTML and CSS that provides access to the information the page is communicating.
- Use feature detection to check browser supports.