dequelabs / dequelabs/axe-core

mark custom elements missing an open shadow for needs review if it fails a rule

Open
#2,675 5 comments 0 reactions 0 assignees View on GitHub
feat rules
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

If a custom element is picked up by a rule it can fail under two cases which probably shouldn't:

1. the element isn't defined in the `CustomElementRegistry`
1. the element is defined but uses a closed shadow root

It would be nice if axe-core detected these two cases and marked the element as needs review rather than fail it for any rule it fails.

We can easily detect the first case by using `CustomElement.get` to see if the element name has been defined. For the 2nd case, it might be safe enough to assume that if the element is defined but does not have content or an open shadow root, it has a closed shadow root and we should mark it for needs review as we can't tell for certain anything about the node.

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.