dequelabs / dequelabs/axe-core

Filter partial results based on resultTypes

Open
#4,124 2 comments 1 reaction 0 assignees View on GitHub
performance
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

Axe-core's `resultTypes` run option can tell axe not to return `pass` and `incomplete`. Doing so improve's axe-core's performance a bit. Generating selectors for elements is quite a slow operation. So if axe doesn't need selectors for pass and incomplete results, this saves up some time.

Axe-core generates selectors for elements in three places:

1. in axe.run, as part of the reporter
2. when partial results get sent to the parent frame
3. at the end of runPartial

Currently, `resultTypes` is only used in the reporter (1). This means selectors get generated for nodes that may get filtered by the reporter at a later stage. It also means lots of passes are returned by runPartial, and frameMessenger that later get ignored. This results in a lot of unnecessary data getting sent between frames too.

This can be improved by having `Audit.run` filter its results before passing them back, either to the parent frame or to runPartial. This will have to consider which checks have after methods on them. Passes on checks with after methods can be changed to fails later. But this is a relatively small subset of checks.

## Bonus points

If `incomplete` is turned off by resultTypes then I think all `reviewOnFail` rules should be disabled. There's no reason to run those if incomplete results are just going to get filtered.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.