-
Notifications
You must be signed in to change notification settings - Fork 779
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
Color-contrast does not take into account <slot> elements and the light DOM #3329
Comments
Hey @tmcconechy - thanks for the report, and thanks for including the URL! I can confirm that I'm seeing the same results you are, and that it does appear to be a bug. I will pass thing along to the correct team members to review. |
The issue is being raised as a "needs review" item a.k.a. incomplete, this is expected behavior |
@dylanb - what is the expected behavior here? it seems like maybe using any custom elements is not possible with the tool? I'm also pretty sure this did work? Is there anymore info you need to make it complete? Thanks |
Digging into this issue it appears that our color contrast code doesn't take into account custom elements with <my-group>
<my-paragraph>
Let's have some different text!
</my-paragraph>
</my-group>
<script src="/axe.js"></script>
<script>
customElements.define('my-group',
class extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: 'open'});
shadowRoot.innerHTML = '<div style="position: absolute;"><slot></slot></div>'
}
}
);
customElements.define('my-paragraph',
class extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: 'open'});
shadowRoot.innerHTML = '<p><slot>My default text</slot></p>'
}
}
);
</script> Our code thinks the |
Product: axe-core && axe Extension
Expectation: Correctly Report the Contrast on a Manual Scan
Actual: False Reports of an Issue
Motivation: This was Previously working
To reproduce this issue you can use our test site https://main.wc.design.infor.com/ids-radio/
With Axe Latest version use the extension and Scan the Page.
I can see the page is reporting errors on the label custom element that is almost black on a white background. This previously did work ok (noticed in last week or so). I also wonder how the rules are deployed as we have seen other wierd things like some people seeing it and some not. We see the same thing in our tests which run the puppetteer axe.
I wonder if its because the element is a customElement and the text is linked via a slot.
The text was updated successfully, but these errors were encountered: