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

getFlattenedTree can crash with <slot> elements without shadowDOM support #965

Closed
WilcoFiers opened this issue Jun 24, 2018 · 3 comments · Fixed by #977
Closed

getFlattenedTree can crash with <slot> elements without shadowDOM support #965

WilcoFiers opened this issue Jun 24, 2018 · 3 comments · Fixed by #977

Comments

@WilcoFiers
Copy link
Contributor

} else if (nodeName === 'slot') {
realArray = Array.from(node.assignedNodes());
if (!realArray.length) {
// fallback content
realArray = getSlotChildren(node);
}
var styl = window.getComputedStyle(node);

Line 93 here throws in Firefox, because assignedNodes isn't defined here. I think L92 should check that that function exists and otherwise just move on. @dylanb WDYT?

@dylanb
Copy link
Contributor

dylanb commented Jun 24, 2018

@WilcoFiers Do you have an example of a page that fails on FF? I would like to validate that what FF is doing is correct before building in this workaround.

@WilcoFiers
Copy link
Contributor Author

WilcoFiers commented Jun 27, 2018

Ran into it while I was working on ESLint. The following throws in FF and Phantom:

fixture.innerHTML = '<button><slot></slot></button>';
axe._tree = axe.utils.getFlattenedTree(fixture);

@WilcoFiers
Copy link
Contributor Author

This probably crashes on everything except Chrome. Updating the name.

@WilcoFiers WilcoFiers changed the title getFlattenedTree can crash in Firefox with <slot> elements getFlattenedTree can crash with <slot> elements without shadowDOM support Jun 27, 2018
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 a pull request may close this issue.

2 participants