unknown.js 767 B

1234567891011121314151617181920212223242526
  1. /*!
  2. {
  3. "name": "Unknown Elements",
  4. "property": "unknownelements",
  5. "tags": ["elem"],
  6. "notes": [{
  7. "name": "The Story of the HTML5 Shiv",
  8. "href": "https://www.paulirish.com/2011/the-history-of-the-html5-shiv/"
  9. }, {
  10. "name": "original implementation of detect code",
  11. "href": "https://github.com/aFarkas/html5shiv/blob/bf4fcc4/src/html5shiv.js#L36"
  12. }],
  13. "polyfills": ["html5shiv"],
  14. "authors": ["Ron Waldon (@jokeyrhyme)"]
  15. }
  16. !*/
  17. /* DOC
  18. Does the browser support HTML with non-standard / new elements?
  19. */
  20. define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
  21. Modernizr.addTest('unknownelements', function() {
  22. var a = createElement('a');
  23. a.innerHTML = '<xyz></xyz>';
  24. return a.childNodes.length === 1;
  25. });
  26. });