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

fix(get-ancestry): add nth-child selector for multiple siblings of shadow root #4606

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

straker
Copy link
Contributor

@straker straker commented Oct 10, 2024

Closes: #4563

@straker straker requested a review from a team as a code owner October 10, 2024 16:28
@straker straker merged commit 1cdd6c3 into develop Oct 15, 2024
22 checks passed
@straker straker deleted the shadow-ancestry branch October 15, 2024 16:27
straker added a commit that referenced this pull request Oct 16, 2024
@straker straker mentioned this pull request Oct 16, 2024
WilcoFiers added a commit that referenced this pull request Oct 16, 2024
###
[4.10.1](v4.10.0...v4.10.1)
(2024-10-16)

### Bug Fixes

- **aria-allowed-role:** add form to allowed roles of form element
([#4588](#4588))
([d462d67](d462d67)),
closes
[/github.com/dequelabs/axe-core/blob/develop/lib/standards/html-elms.js#L264](https://github.com/dequelabs//github.com/dequelabs/axe-core/blob/develop/lib/standards/html-elms.js/issues/L264)
- **axe.d.ts:** add typings for preload options object
([#4543](#4543))
([72e269f](72e269f))
- **button-name,input-button-name,input-img-alt:** allow label to give
accessible name
([#4607](#4607))
([364eb72](364eb72)),
closes [#4472](#4472)
[#3696](#3696)
[#3696](#3696)
- **get-ancestry:** add nth-child selector for multiple siblings of
shadow root ([#4606](#4606))
([bdd94a2](bdd94a2)),
closes [#4563](#4563)
- **rules:** Change "alternate text" to "alternative text"
([#4582](#4582))
([31e0f61](31e0f61))
@@ -2,22 +2,24 @@ import getShadowSelector from './get-shadow-selector';

function generateAncestry(node) {
const nodeName = node.nodeName.toLowerCase();
const parent = node.parentElement;
if (!parent) {

Choose a reason for hiding this comment

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

this check has now been removed.
so after this PR (axe-core 4.10.1) we started seeing

TypeError: Cannot read properties of null (reading 'children')
    at generateAncestry (eval at evaluate (:234:30), <anonymous>:7617:70)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh dang. I thought I had added a conditional operator to the children call, but looks like I removed it in a refactor. I'll get a fix in. Thanks for letting us know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amakhrov we're curious under what scenario you're running into this issue. Is there a public test page or a code snippet of where you're seeing the issue that you could share with us? We want to make sure our fix will actually fix the issue.

Copy link

@amakhrov amakhrov Oct 22, 2024

Choose a reason for hiding this comment

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

It happens as a part of an accessibility check in a Playwright test.

It doesn't fail every time though. perhaps it happens during some transition / animation state.

After looking closer at the test in question, looks like we omitted await by mistake there - so the test continues running during the acessibility check. I assume it might be causing the issue in some cases

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.

Ancestry selector of shadow root child not guaranteed unique
3 participants