Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax sugar for selecting nodes in frames and shadow DOM #3799

Closed
WilcoFiers opened this issue Nov 28, 2022 · 0 comments · Fixed by #3798
Closed

Add syntax sugar for selecting nodes in frames and shadow DOM #3799

WilcoFiers opened this issue Nov 28, 2022 · 0 comments · Fixed by #3798
Labels
core Issues in the core code (lib/core) feat New feature or enhancement
Milestone

Comments

@WilcoFiers
Copy link
Contributor

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'] })
@WilcoFiers WilcoFiers added feat New feature or enhancement core Issues in the core code (lib/core) labels Nov 28, 2022
@WilcoFiers WilcoFiers added this to the Axe-core 4.6 milestone Nov 28, 2022
@WilcoFiers WilcoFiers modified the milestones: Axe-core 4.7, axe-core 4.6 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) feat New feature or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant