Sha256: 696c976f2c257cb603f79ab78f7a9c79ff302a32aa234d572ac211fdb6910bcf
Contents?: true
Size: 982 Bytes
Versions: 236
Compression:
Stored size: 982 Bytes
Contents
if (!options || !options.selector || typeof options.selector !== 'string') { throw new TypeError( 'visible-in-page requires options.selector to be a string' ); } // only look at the first node and it's related nodes const key = 'page-no-duplicate;' + options.selector; if (axe._cache.get(key)) { this.data('ignored'); return; } axe._cache.set(key, true); let elms = axe.utils.querySelectorAllFilter( axe._tree[0], options.selector, elm => axe.commons.dom.isVisible(elm.actualNode) ); // Filter elements that, within certain contexts, don't map their role. // e.g. a <footer> inside a <main> is not a banner, but in the <body> context it is if (typeof options.nativeScopeFilter === 'string') { elms = elms.filter(elm => { return ( elm.actualNode.hasAttribute('role') || !axe.commons.dom.findUpVirtual(elm, options.nativeScopeFilter) ); }); } this.relatedNodes( elms.filter(elm => elm !== virtualNode).map(elm => elm.actualNode) ); return elms.length <= 1;
Version data entries
236 entries across 236 versions & 1 rubygems