Improve a11y metric for captioned tables
tunetheweb opened this issue ยท 2 comments
tunetheweb commented
Copied from HTTPArchive/legacy.httparchive.org#248
The Accessibility Chapter uses this custom metric code to find captioned table:
Lines 47 to 57 in 46b90e8
However some sites (like the Web Almanac itself!) uses <figcaptions>
which are a valid alternative. We should enhance this detection to capture this with the following code:
const tables_with_figcaption = document.querySelectorAll('figure:has(table):has(figcaption)');
I've tested this in Chrome 96 and it works! ๐
But not in WPT as not enabled by default until Chrome 105 - so can't add yet ๐
Twitter thread: https://twitter.com/tunetheweb/status/1462885130318589952?s=20
Adding an issue to remind myself to add once :has()
is fully rolled out in Chrome 105
rviscomi commented
tunetheweb commented
TIL!