AccessLint / accesslint.js

Keep accessibility errors in check.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

accesslint.js can grind interaction to a halt on a page with many DOM mutations

wyattdanger opened this issue · comments

I'm trying to get accesslint running on a React page with a lot of DOM mutations happening. What I've noticed is that tons of mutations get registered, then a bunch of axe checks complete, and sometimes the nodes axe is reporting aren't even in the page any more by the time the violations are printed to the console. It also brings the UI to a grinding slow pace.

I am thinking it could be beneficial to have a throttled audit function which only runs on the full document no more than once per second, rather than on every individual mutation. Thoughts on that? I'm happy to prep a PR

@wyattdanger the DOM mutation functionality is useful for end-to-end tests that trigger page interactions. For instance, if I've loaded the library via https://github.com/accesslint/accesslint-rails and I run a feature spec that toggles a menu, I'd want to auditor to run immediately. The other scenario in mind is infinite scroll in the browser. Throttling in the way you described, I think, might swallow some of these interactions. Am I missing something in your description?

These are good points. I'm trying to get accesslint running in my development environment, rather than in CI. On the web app I'm working on, there are at times many many cascading DOM mutations as a result of react component updates. For my purposes, it may be better to fork the library and throttle the auditing.