dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.94k stars 773 forks source link

Proposal: Need for loading external assets in axe-core #906

Closed jeeyyy closed 6 years ago

jeeyyy commented 6 years ago

Load external assets in axe-core:

Requirement:

In order to support both existing rules and upcoming new WCAG2.1 rules (Eg: issue https://github.com/dequelabs/axe-core/issues/851), there is a need to load external assets, in this case external stylesheets.

Having tried a few options as detailed in the issue to get hold of the assets, believe the best way to go ahead would be to introduce ability to load external assets in axe-core,.

Note: The assets can be loaded in parallel when axe is run against rules that are not dependent on external assets.

Considerations:

At this juncture although the need is only for the construction of CSSOM, there may be a need to support pre-fetching of external assets as support for newer rules are incorporated (Eg: AOM).

Suggestions:

Known Catches:

Some Preliminary Work:

Next steps:

WilcoFiers commented 6 years ago

For clarification, there are several rules that we need this for, not just WCAG 2.1 rules. An important feature request was to have Axe test the hover / focus state of rules. We can only do that with access to the CSSOM. This is expected to cut manual audit time quite substantially.

jeeyyy commented 6 years ago

@WilcoFiers - updated proposal based on your comments.

stephenmathieson commented 6 years ago

I think {preload: false} should be an option of axe.run, not of axe.configure.

Just so everyone is on the same page, can you please elaborate on "why" here? It seems like axe.configure() is the logical place to put configuration to me (just based on verbiage alone).

dylanb commented 6 years ago
  1. What is the output/side-effect of a call to preload? i.e. how do I access the CSSOM or the AOM after it is loaded?
  2. Do we only call a check after its dependencies have all loaded?
  3. What happens if there are no dependencies? e.g. there are no external CSS objects (for example we are running inside unit tests). Obviously there is no loading, but how does the dependent check get notified or made aware of this fact?
jeeyyy commented 6 years ago

PR - https://github.com/dequelabs/axe-core/pull/958

jeeyyy commented 6 years ago

PR was merged. Hence closing the issue. An additional issue detailing the requirement for nested CSSOM is here - https://github.com/dequelabs/axe-core/issues/1054