import { findUpVirtual } from '../commons/dom'; function landmarkHasBodyContextMatches(node, virtualNode) { const nativeScopeFilter = 'article, aside, main, nav, section'; // Filter elements that, within certain contexts, don't map their role. // e.g. a
inside a
is not a banner, but in the context it is return ( node.hasAttribute('role') || !findUpVirtual(virtualNode, nativeScopeFilter) ); } export default landmarkHasBodyContextMatches;