visible.js 743 B

123456789101112131415161718
  1. import visibleVirtual from './visible-virtual';
  2. import { getNodeFromTree } from '../../core/utils';
  3. /**
  4. * Finds virtual node and calls visibleVirtual()
  5. * IMPORTANT: This method requires the composed tree at axe._tree
  6. * @param {Element} element
  7. * @param {Boolean} screenReader When provided, will evaluate visibility from the perspective of a screen reader
  8. * @param {Boolean} noRecursing When False, the result will contain text from the element and it's children.
  9. * When True, the result will only contain text from the element
  10. * @return {String}
  11. */
  12. function visible(element, screenReader, noRecursing) {
  13. element = getNodeFromTree(element);
  14. return visibleVirtual(element, screenReader, noRecursing);
  15. }
  16. export default visible;