find-up.js 679 B

1234567891011121314151617181920
  1. import findUpVirtual from './find-up-virtual';
  2. import { getNodeFromTree } from '../../core/utils';
  3. /**
  4. * Find the virtual node and call dom.fundUpVirtual
  5. *
  6. * **WARNING:** this should be used sparingly, as it's not even close to being performant
  7. * @method findUp
  8. * @memberof axe.commons.dom
  9. * @instance
  10. * @deprecated use axe.utils.closest
  11. * @param {HTMLElement} element The starting HTMLElement
  12. * @param {String} target The selector for the HTMLElement
  13. * @return {HTMLElement|null} Either the matching HTMLElement or `null` if there was no match
  14. */
  15. function findUp(element, target) {
  16. return findUpVirtual(getNodeFromTree(element), target);
  17. }
  18. export default findUp;