-
Notifications
You must be signed in to change notification settings - Fork 780
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
Infinite loop in dom.shadowElementsFromPoint #856
Comments
WilcoFiers
added a commit
that referenced
this issue
Apr 24, 2018
WilcoFiers
added a commit
that referenced
this issue
Apr 24, 2018
WilcoFiers
added a commit
that referenced
this issue
Apr 24, 2018
WilcoFiers
pushed a commit
that referenced
this issue
May 19, 2018
* fix(core): Explicitly name the axe module 'axe-core' Avoid the "Mismatched anonymous define() modules" error when the axe script is injected in a page that uses requireJS Closes #849 * fix: Prevent color rules from crashing Chrome 66+ #856 (#861) * chore: Release axe-core 3.0.2 * chore: Enable Greenkeeper for managing dependencies (#847) * chore: add Greenkeeper config file * chore(package): update dependencies * chore(package): update dependencies * chore(package): update dependencies * chore(package): update dependencies * chore(package): update dependencies * chore(package): update dependencies * docs(readme): add Greenkeeper badge * chore: update to use babel-core * chore: update to latest uglify config properties `bracketize` became `braces` and `expect` became `reserved` * chore: add sri-history lifecycle hook to release (#844) * chore: disable growl to prevent errors in testing * chore: Rename Jest example to help greenkeeper (#871) * chore: rename jest example to help greenkeeper plus signs are invalid in filenames/directories Closes #869 * chore: add config to jest_react example Closes #865 * fix(core): Explicitly name the axe module 'axe-core' Avoid the "Mismatched anonymous define() modules" error when the axe script is injected in a page that uses requireJS Closes #849 * test(core): Validate that the axe module is named 'axe-core' Added integration test to check the value of the first argument to define() Closes #849
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code that steps into shadow boundaries to test color contrast is throwing an infinite loop in Chrome 66. If you run the color-contrast check tests in Chrome 65, they work fine. In Chrome 66, they throw an error:
Maximum call stack size exceeded
Here is the relevant code: https://github.com/dequelabs/axe-core/blob/develop/lib/commons/dom/shadow-elements-from-point.js
Perhaps something changed in Chrome since that code was shipped? I'll have to download an older version to know for sure (though I did also ask Rob Dodson if he knows anything). When the code was written,
document.elementsFromPoint
behaved like this (in a simplified way):document.elementsFromPoint(x, y)
returned nodes from the light dom only, e.g.['#container', 'body', 'html']
root.elementsFromPoint(x, y)
would return nodes from the current shadow root only, e.g.['#target']
Now an infinite loop is throwing, something I would have caught in development. I've since tried preventing it by adding various breakers, but I'm still not quite getting it.
I did notice a difference with
elementsFromPoint
once I started doing more experiments:document.elementsFromPoint(x, y)
still returns nodes from the light DOM, e.g.['#container', 'body', 'html']
root.elementsFromPoint(x, y)
now returns shadow and light DOM nodes, e.g.['#target', '#container', 'body', 'html']
It would be good to confirm whether that behavior really did change. Would we have to support both versions?
Furthermore, how exactly is this infinite loop occurring? We still need to run
document.elementsFromPoint
to get the outer stack, step into any shadowRoots and recurse to get the whole stack of elements. I tried storing a top-level variable to filter out multiple calls to the same element or root node, but it still recursed to infinity. I have to put this task down now, but that's what I uncovered so far.The text was updated successfully, but these errors were encountered: