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 highlighting for shadowroot elements #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michael-brueggemann
Copy link

No description provided.

@PRGfx
Copy link
Member

PRGfx commented Jul 1, 2024

As far as I can tell, this merely works by coincidence, as you pop the last result, while the previous approach took the first result matching the query-selector.

However, I do think that the previous code was incorrect, as target does not describe options of selectors (as interpreted here by joining the selectors with ,) but rather describes a path in frame-access (or shadow DOM I guess). (Looking at the names of the types UnlabelledFrameSelector = CrossTreeSelector[] etc. and their introduction dequelabs/axe-core@9e1e31b.)

So I think the element would be retrieved by reducing the target something like target.reduce((root, selector) => root ? root.querySelector(selector) : null, document.documentElement) – possibly using some sort of shadow-DOM access. I didn't look into that in too much detail yet though.

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.

None yet

2 participants