diff --git a/lib/checks/navigation/region.js b/lib/checks/navigation/region.js index 2a829f5d7e..f5865a7db5 100644 --- a/lib/checks/navigation/region.js +++ b/lib/checks/navigation/region.js @@ -66,8 +66,13 @@ function findRegionlessElms(virtualNode) { return []; - // Return the node is a content element - } else if (dom.hasContent(node, /* noRecursion: */ true)) { + // Return the node is a content element. Ignore any direct text children + // of body so we don't report body as being outside of a landmark. + // @see https://github.com/dequelabs/axe-core/issues/2049 + } else if ( + node !== document.body && + dom.hasContent(node, /* noRecursion: */ true) + ) { return [virtualNode]; // Recursively look at all child elements diff --git a/test/integration/full/region/region-fail.html b/test/integration/full/region/region-fail.html index bd0c05a8e8..0ea6767796 100644 --- a/test/integration/full/region/region-fail.html +++ b/test/integration/full/region/region-fail.html @@ -37,6 +37,8 @@