Skip to content

ally.js

JavaScript library to help modern web applications with accessibility concerns by making accessibility simpler

🔗Supports - Browser compatibility

The supports infrastructure is a set of tests determining browser behavior and compatibility at runtime. Because the tests change focus to detect compatibility and load invalid <video> and <audio> sources, results are cached in localStorage. For the tests to run properly, the document needs to have focus during execution. If it does not, e.g. because the browser's DevTools have focus, the cache is voided.

🔗Available compatibility tests

Test NameReturn TypeDescription
css-shadow-piercing-deep-combinatorstring (">>>", "/deep/" "")the browser's support for selecting through Shadow DOM, empty string if not supported
focus-area-img-tabindexbooleantrue if <area> is focusable for <img tabindex="-1" usemap="…">
focus-area-tabindexbooleantrue if <area href="…" tabindex="-1"> is focusable
focus-area-without-hrefbooleantrue if <area tabindex="-1"> is focusable
focus-audio-without-controlsbooleantrue if <audio> is focusable (while only <audio controls> should be)
focus-broken-image-mapbooleantrue if <area> is focusable although the <img> using the <map> is not properly loaded
focus-children-of-focusable-flexboxbooleantrue if <span> in <a href="…" style="display:flex;"><span> is focusable
focus-fieldset-disabledbooleantrue if <fieldset tabindex="0" disabled> is focusable
focus-fieldsetbooleantrue if <fieldset> is focusable
focus-flexbox-containerbooleantrue if <span style="display: flex"> is focusable
focus-form-disabledbooleantrue if <fieldset tabindex="0" disabled> is focusable
focus-img-ismapbooleantrue if <img> in <a href="–"><img ismap src="…"> is focusable
focus-img-usemap-tabindexbooleantrue if <img usemap="#…"> is focusable
focus-invalid-tabindexbooleantrue if <div tabindex="invalid-value"> is focusable
focus-label-tabindexbooleantrue if <label tabindex="-1"> is focusable
focus-object-svgbooleantrue if <object type="image/svg+xml" data="…"> is focusable
focus-object-swfbooleantrue if <object type="application/x-shockwave-flash" data="…"> is focusable
focus-redirect-legendstring ("focusable", "tabbable", "")the browser's query method for identifying the target for passing focus from <legend>
focus-redirect-img-usemapbooleantrue if img.focus() passes focus to the first <area> of the associated element
focus-scroll-bodybooleantrue if the child element of a scrollable area is focusable
focus-scroll-container-without-overflowbooleantrue if a scrollable element is focusable (without being made scrollable using the CSS property overflow )
focus-scroll-containerbooleantrue if a scrollable element is focusable
focus-summarybooleantrue if the browser implements <details> and <summary> is focusable
focus-tabindex-trailing-charactersbooleantrue if <div tabindex="3x"> is focusable
focus-tablebooleantrue if <table>, <tr> and <td> are focusable
focus-video-without-controlsbooleantrue if <video> is focusable (while only <video controls> should be)
focusout-eventbooleantrue if focusout is dispatched synchronously
tabsequence-area-at-img-positionbooleantrue if <area> are tabbed at the DOM position of <img usemap="…">
svg-focus-methodbooleantrue if SVGElement.prototype.focus exists natively

🔗Contributing

Tests go in src/supports and either use the ./detect-focus.js helper like most of the tests, or the ./supports-cache.js API directly, like ./css-shadow-piercing-deep-combinator.js shows.