Sha256: 2d165586cc260ac68d87292eeccc3b7ecfba9866bb3b63c3b0385c13642f8cbd
Contents?: true
Size: 628 Bytes
Versions: 271
Compression:
Stored size: 628 Bytes
Contents
/* global axe */ const possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ]; /** * Test a node to see if it has a spec-conforming shadow root * * @param {Node} node The HTML DOM node * @return {Boolean} */ axe.utils.isShadowRoot = function isShadowRoot(node) { if (node.shadowRoot) { const nodeName = node.nodeName.toLowerCase(); if ( possibleShadowRoots.includes(nodeName) || /^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(nodeName) ) { return true; } } return false; };
Version data entries
271 entries across 271 versions & 1 rubygems