dom-accessibility-api
Advanced tools
Changelog
0.5.1
fcc66ae
#394 Thanks @marcosvega91! - Ignore title
attribute if it is empty.
Previously <button title="">Hello, Dave!</button>
would wrongly compute an empty name.
Changelog
0.5.0
9e46c51
#380 Thanks @eps1lon! - BREAKING CHANGE
Ignore ::before
and ::after
by default.
This was necessary to prevent excessive warnings in jsdom@^16.4.0
.
If you use this package in a browser that supports the second argument of window.getComputedStyle
you can set the computedStyleSupportsPseudoElements
option to true:
computeAccessibleName(element, {
computedStyleSupportsPseudoElements: true,
});
computeAccessibleDescription(element, {
computedStyleSupportsPseudoElements: true,
});
If you pass a custom implementation of getComputedStyle
then this option defaults to true
.
The following two calls are equivalent:
computeAccessibleName(element, {
computedStyleSupportsPseudoElements: true,
});
computeAccessibleName(element, {
getComputedStyle: (element, pseudoElement) => {
// custom implementation
},
});
Changelog
0.4.6
f7c1981
#288 Thanks @eps1lon! - Drop node 13 support
We only stopped testing. Probability of breakage should be very low.
New policy:
Only active node versions are supported. Inactive node versions can stop working in a SemVer MINOR release.
fa53c51
#210 Thanks @eps1lon! - Implement accessbile description computation
import { computeAccessibleDescription } from "dom-accessibility-api";
const description = computeAccessibleDescription(element);
Warning: It always considers title
attributes if the description is empty.
Even if the title
attribute was already used for the accessible name.
This is fails a web-platform-test.
The other failing test is due to aria-label
being ignored for the description which is correct by spec.
It's likely an issue with wpt.
The other tests are passing (13/15).
Changelog
0.4.4
737dfae
#234 Thanks @willamzv! - Consider <legend>
for the name of its <fieldset>
element.
<fieldset>
<legend><em>my</em> fieldset</legend>
</fieldset>
Computing the name for this fieldset would've returned an empty string previously. It now correctly computes my fieldset
following the accessible name computation for fieldset
elements
969da7d
#240 Thanks @eps1lon! - Reduce over-transpilation
Switched from
for-of
to .forEach
or a basic for
looparray.push(...otherArray)
to push.apply(array, otherArray)
This removed a bunch of babel junk that wasn't needed.
d578329
#248 Thanks @eps1lon! - Consider <caption>
for the name of its <table>
element.
<table>
<caption>
<em>my</em>
table
</caption>
</table>
Computing the name for this table would've returned an empty string previously. It now correctly computes my table
following the accessible name computation for table
elements