Full support for HTML in Canvas
I've been looking at how axe-core stacks up to HTML in canvas, which Google has been pushing. Most things already seem to work reasonably well. There are a few cases that I came across that we'll want to fix:
Axe-core incorrectly considers
<canvas>fallback content as visible on screen. Curiously, these elements make it to the accessibility tree, and are even focusable. Because of this, most things we need axe-core to do to support HTML in canvas already exists. What's missing is a way to check if an element is rendered through HTML in Canvas. I don't know a direct way to detect if an element is painted. There might be one, but if not we can checklayoutsubtree, that at least tells us if an element can't be on screen.The
subtreeTextfunction incorrectly considers canvas to be empty because ofcontentTypes?.includes('embedded'). That doesn't seem to matter, even withoutlayoutsubtree.
Source: dequelabs/axe-core