Related to #3793
Currently, to include the main element inside an iframe you need to use a nested array syntax like so:
axe.run([['iframe', 'main']])
That the outer array is to allow multiple elements, and the inner one is to target inside frame is difficult to read. This gets worse when we add shadow DOM selectors, which will introduce a third level array:
axe.run([[['#shadow-host', 'main']]])
To make understanding these arrays easier, axe-core should allow labelling what node you're actually trying to grab. Doing this will also make wrapping optional, which further clears up the API. The above examples could then be rewritten like so:
axe.run({ fromFrames: ['iframe', 'main'] })
axe.run({ fromShadowDom: ['#shadow-host', 'main'] })
Related to #3793
Currently, to include the main element inside an iframe you need to use a nested array syntax like so:
That the outer array is to allow multiple elements, and the inner one is to target inside frame is difficult to read. This gets worse when we add shadow DOM selectors, which will introduce a third level array:
To make understanding these arrays easier, axe-core should allow labelling what node you're actually trying to grab. Doing this will also make wrapping optional, which further clears up the API. The above examples could then be rewritten like so: