Skip to content

fix(color-contrast): correctly compute color contrast of <slot> elements#3847

Merged
WilcoFiers merged 2 commits intodevelopfrom
color-contrast-slot
Jan 6, 2023
Merged

fix(color-contrast): correctly compute color contrast of <slot> elements#3847
WilcoFiers merged 2 commits intodevelopfrom
color-contrast-slot

Conversation

@straker
Copy link
Copy Markdown
Contributor

@straker straker commented Jan 5, 2023

Closes: #3329

@straker straker requested a review from a team as a code owner January 5, 2023 17:05
);

(shadowSupported ? it : xit)('handles <slot> elements', () => {
fixture.innerHTML =
Copy link
Copy Markdown
Contributor Author

@straker straker Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't use shadowCheckSetup because I needed the final node to be the paragraph, but trying to have the paragraph in the first parameter had the code add the shadow dom to it rather than the container element.

const shadowContainer = shadow.querySelector('#shadowContainer');
axe.testUtils.flatTreeSetup(fixture);

const target = fixture.querySelector('#target');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't use axe.utils.querySelector since the element is in the shadow dom in the virtual tree, so would need to select the shadow element and query selector from there.

Copy link
Copy Markdown
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully understand the problem. Would like to get on a call to discuss.

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
@WilcoFiers WilcoFiers merged commit 4c3a00c into develop Jan 6, 2023
@WilcoFiers WilcoFiers deleted the color-contrast-slot branch January 6, 2023 15:56
straker added a commit that referenced this pull request Jan 23, 2023
…nts (#3847)

* fix(color-contrast): correctly compute color contrast of <slot> elements

* Update lib/commons/dom/create-grid.js

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color-contrast does not take into account <slot> elements and the light DOM

2 participants