is-html5.js 345 B

1234567891011121314151617
  1. /**
  2. * Determines if a document node is HTML 5
  3. * @method isHTML5
  4. * @memberof axe.commons.dom
  5. * @instance
  6. * @param {Node} doc
  7. * @return {Boolean}
  8. */
  9. function isHTML5(doc) {
  10. const node = doc.doctype;
  11. if (node === null) {
  12. return false;
  13. }
  14. return node.name === 'html' && !node.publicId && !node.systemId;
  15. }
  16. export default isHTML5;