/** * @preserve html5 shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | mit/gpl2 licensed */ ;(function(window, document) { /*jshint evil:true */ /** version */ var version = '3.7.2'; /** preset options */ var options = window.html5 || {}; /** used to skip problem elements */ var reskip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; /** not all elements can be cloned in ie **/ var saveclones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; /** detect whether the browser supports default html5 styles */ var supportshtml5styles; /** name of the expando, to work with multiple documents or to re-shiv one document */ var expando = '_html5shiv'; /** the id for the the documents expando */ var expanid = 0; /** cached data for each document */ var expandodata = {}; /** detect whether the browser supports unknown elements */ var supportsunknownelements; (function() { try { var a = document.createelement('a'); a.innerhtml = ''; //if the hidden property is implemented we can assume, that the browser supports basic html5 styles supportshtml5styles = ('hidden' in a); supportsunknownelements = a.childnodes.length == 1 || (function() { // assign a false positive if unable to shiv (document.createelement)('a'); var frag = document.createdocumentfragment(); return ( typeof frag.clonenode == 'undefined' || typeof frag.createdocumentfragment == 'undefined' || typeof frag.createelement == 'undefined' ); }()); } catch(e) { // assign a false positive if detection fails => unable to shiv supportshtml5styles = true; supportsunknownelements = true; } }()); /*--------------------------------------------------------------------------*/ /** * creates a style sheet with the given css text and adds it to the document. * @private * @param {document} ownerdocument the document. * @param {string} csstext the css text. * @returns {stylesheet} the style element. */ function addstylesheet(ownerdocument, csstext) { var p = ownerdocument.createelement('p'), parent = ownerdocument.getelementsbytagname('head')[0] || ownerdocument.documentelement; p.innerhtml = 'x'; return parent.insertbefore(p.lastchild, parent.firstchild); } /** * returns the value of `html5.elements` as an array. * @private * @returns {array} an array of shived element node names. */ function getelements() { var elements = html5.elements; return typeof elements == 'string' ? elements.split(' ') : elements; } /** * extends the built-in list of html5 elements * @memberof html5 * @param {string|array} newelements whitespace separated list or array of new element names to shiv * @param {document} ownerdocument the context document. */ function addelements(newelements, ownerdocument) { var elements = html5.elements; if(typeof elements != 'string'){ elements = elements.join(' '); } if(typeof newelements != 'string'){ newelements = newelements.join(' '); } html5.elements = elements +' '+ newelements; shivdocument(ownerdocument); } /** * returns the data associated to the given document * @private * @param {document} ownerdocument the document. * @returns {object} an object of data. */ function getexpandodata(ownerdocument) { var data = expandodata[ownerdocument[expando]]; if (!data) { data = {}; expanid++; ownerdocument[expando] = expanid; expandodata[expanid] = data; } return data; } /** * returns a shived element for the given nodename and document * @memberof html5 * @param {string} nodename name of the element * @param {document} ownerdocument the context document. * @returns {object} the shived element. */ function createelement(nodename, ownerdocument, data){ if (!ownerdocument) { ownerdocument = document; } if(supportsunknownelements){ return ownerdocument.createelement(nodename); } if (!data) { data = getexpandodata(ownerdocument); } var node; if (data.cache[nodename]) { node = data.cache[nodename].clonenode(); } else if (saveclones.test(nodename)) { node = (data.cache[nodename] = data.createelem(nodename)).clonenode(); } else { node = data.createelem(nodename); } // avoid adding some elements to fragments in ie < 9 because // * attributes like `name` or `type` cannot be set/changed once an element // is inserted into a document/fragment // * link elements with `src` attributes that are inaccessible, as with // a 403 response, will cause the tab/window to crash // * script elements appended to fragments will execute when their `src` // or `text` property is set return node.canhavechildren && !reskip.test(nodename) && !node.tagurn ? data.frag.appendchild(node) : node; } /** * returns a shived documentfragment for the given document * @memberof html5 * @param {document} ownerdocument the context document. * @returns {object} the shived documentfragment. */ function createdocumentfragment(ownerdocument, data){ if (!ownerdocument) { ownerdocument = document; } if(supportsunknownelements){ return ownerdocument.createdocumentfragment(); } data = data || getexpandodata(ownerdocument); var clone = data.frag.clonenode(), i = 0, elems = getelements(), l = elems.length; for(;i