2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
|
/* HTML5 Shiv vpre3.4 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */
|
||
|
(function(g,i){var k=g.html5||{};var c=/^<|^(?:button|form|map|select|textarea)$/i;var b;var d;(function(){var o,n=i.createElement("a"),m=g.getComputedStyle,p=i.documentElement,l=i.body||(o=p.insertBefore(i.createElement("body"),p.firstChild));l.insertBefore(n,l.firstChild);n.hidden=true;n.innerHTML="<xyz></xyz>";b=(n.currentStyle||m(n,null)).display=="none";d=n.childNodes.length==1||(function(){try{(i.createElement)("a")}catch(q){return true}var r=i.createDocumentFragment();return(typeof r.cloneNode=="undefined"||typeof r.createDocumentFragment=="undefined"||typeof r.createElement=="undefined")}());l.removeChild(n);o&&p.removeChild(o)}());function j(l,n){var o=l.createElement("p"),m=l.getElementsByTagName("head")[0]||l.documentElement;o.innerHTML="x<style>"+n+"</style>";return m.insertBefore(o.lastChild,m.firstChild)}function f(){var l=e.elements;return typeof l=="string"?l.split(" "):l}function h(u){var q,m={},r=u.createElement,o=u.createDocumentFragment,l=f(),s=o(),p=l.length;function t(){var v=s.cloneNode(false);return e.shivMethods?(h(v),v):v}function n(w){var v=(m[w]||(m[w]=r(w))).cloneNode(false);return e.shivMethods&&v.canHaveChildren&&!c.test(w)?s.appendChild(v):v}while(p--){q=l[p];m[q]=r(q);s.createElement(q)}u.createElement=n;u.createDocumentFragment=t}function a(m){var l;if(m.documentShived){return m}if(e.shivCSS&&!b){l=!!j(m,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")}if(e.shivMethods&&!d){l=!h(m)}if(l){m.documentShived=l}return m}var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivCSS:!(k.shivCSS===false),shivMethods:!(k.shivMethods===false),type:"default",shivDocument:a};g.html5=e;a(i)}(this,document));
|