getElmScrollRecursive fails on SVG in some browsers
See original GitHub issueWhen recursing through the DOM to calculate the scroll position here: https://github.com/dequelabs/axe-core/blob/83daaa53023c8ad5ea927244617cf7807bf1fd37/lib/core/utils/scroll-state.js#L32-L40
If the code encounters an SVG it essentially runs, document.querySelector('svg').children
. This doesn’t always return an HTMLCollection object which in turn causes Array.from
to error.
JS fiddle demonstrating issue: https://jsfiddle.net/uvftjtre/2/ (version 3.0.0.alpha.4)
Running the above example in EDGE:
Array.from: argument is not an Object
Running in IE11 will return:
TypeError: Array.from requires an array-like object - not null or undefined
This error surfaced when running automated tests through Phantom JS 1.9.7
More context: https://stackoverflow.com/questions/7935689/what-is-the-difference-between-children-and-childnodes-in-javascript#7935719
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Firefox error rendering an SVG image to HTML5 canvas with ...
It is working in all browsers except Firefox, which throws an error "NS_ERROR_NOT_AVAILABLE". var img = new Image(); img.src = "icon.svg"; img.
Read more >Unable to view SVG image, any help? | Firefox Support Forum
The links on the webpages work, but the images fail to display. Attached is an example of an SVG file that fails to...
Read more >SVG (basic support) | Can I use... Support tables for ... - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >5 Most Common Problems Faced by SVG Users - Vecta.io
C. You're using SVG Fonts - only supported by certain browsers · svg · defs · font · font-face · font-face · font...
Read more >A Complete Guide to SVG Fallbacks - CSS-Tricks
Some tech-oriented web sites (like this one) can afford to say that they only support modern web browsers. But for most sites, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you expect the changes be to add fallback for childNodes like:
or are the scroll position of SVG children necessary to worry about?
@WilcoFiers This issue causes our accessibility tests to fail on any page that contains an SVG element. Looks like this is scheduled to be fixed in axe-core 3.4. Do you have a timeframe when 3.4 is scheduled to be released?