
17
What you need to know if you are a front-end developer
This section includes the profiles responsible for the pages' code, such as layout or
defining behavior.
In the past, assistive products such as screen readers interpreted a web page
directly from its code. Currently, most of them do so through the Accessibility API.
For this reason, WCAG 2.2 has decided that it is no longer required to validate
HTML or CSS code since, if an error affects accessibility, it will already become
known in other criteria. However, it is still a good practice to validate the code to
verify that it correctly follows the standard, as it facilitates not only the
interpretation of the code by different technologies but also by other developers
who analyze that code later.
The primary responsibility of developers is that the code is semantically appropriate
to the information, relationships, sequences, and controls it generates. To do this,
standard controls, such as the WAI-ARIA standard, should be used whenever
possible, to which we dedicate an entire chapter. This standard allows you to add
semantic information to page elements and helps to make dynamic elements (alerts,
drop-down menus, carousels, etc.) accessible.
Developers must help people understand the interface by correctly identifying the
controls and their purpose. This is especially important for links and form fields,
which are traditionally complicated for users of assistive products.
Developers should help fill out forms by clearly and consistently identifying fields,
help instructions, and errors so that they are noticeable, operable, and
understandable to everyone who will fill them out. They must take particular care
with authentication processes not to force people to remember or transcribe
information. Allow them to copy their login details into text fields, and don't include
complicated tests, such as puzzles or math calculations, during the process.
Although it is already widespread to use HTML, CSS, and JavaScript files for
structure, presentation, and functionality respectively, developers must separate the
content from the presentation, not only in the general layout of the pages but also
in the images, avoiding text images, and defining the decorative images in the CSS.
The content creators are responsible for providing many of the images on the
website with a suitable alternative.
Moreover, developers will need to select an accessible media player that supports
the different alternatives available for each video or audio content.
Developers must also ensure a proper reading order in any context, and it is a good
practice that the visual order of the content matches its order in the code or the
DOM.
In addition, fields, links, and other interaction or interface elements, such as modal
windows, must be available to be used by the keyboard in a logical order, identifying
at all times where the focus is and without it being trapped in a component. If
keyboard shortcuts are implemented, developers must ensure that they do not
conflict with those of the browser and that they are not associated with a single key.