bypass-matches.js 426 B

1234567891011121314
  1. import isInitiatorMatches from './is-initiator-matches';
  2. function bypassMatches(node, virtualNode, context) {
  3. // the top level window should have an anchor
  4. if (isInitiatorMatches(node, virtualNode, context)) {
  5. return !!node.querySelector('a[href]');
  6. }
  7. // all iframes do not need an anchor but should be checked for bypass
  8. // elements (headings, landmarks, etc.)
  9. return true;
  10. }
  11. export default bypassMatches;