axe.run
crashes if an iframe's contentDocument
is used
#3864
Milestone
axe.run
crashes if an iframe's contentDocument
is used
#3864
Product
axe-core
Product Version
4.6.2
Latest Version
Issue Description
Expectation
When calling
axe.run
with an iframe'scontentDocument
I expect it to perform the checks on just the iframe's document.Actual
Throws an error:
How to Reproduce
python -m http.server
)Additional context
The
clone
function avoids cloning HTML elements by checking if it is an instance ofwindow.Node
, however because the iframe's context is differentNode
instances from inside the iframe are not instances ofwindow.Node
, they are instances ofiframe.contentWindow.Node
.The solution to this might just be to say "you can't do that, if you want to test an iframe just pass the iframe's element and make sure the iframe option is true", but I figured it might be possible to find an easy fix if the
clone
function can detectNode
instances from iframes.The text was updated successfully, but these errors were encountered: