Permalink
Browse files

fixed problem in IE8

  • Loading branch information...
1 parent efd169a commit 9ed079f5cd287373021f07f007f6208510a43d75 @WebReflection committed Oct 15, 2015
Showing with 9 additions and 9 deletions.
  1. +1 −1 LICENSE.txt
  2. +1 −1 README.md
  3. +2 −2 build/dom4.js
  4. +2 −2 build/dom4.max.js
  5. +1 −1 package.json
  6. +1 −1 src/dom4.js
  7. +1 −1 template/copyright
View
@@ -1,4 +1,4 @@
-Copyright (C) 2013 by WebReflection
+Copyright (C) 2013-2015 by Andrea Giammarchi - @WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -7,7 +7,7 @@ DOM4
Many thanks to [cdnjs](http://www.cdnjs.com) for hosting this script. Following an example on how to include it.
```html
<script
- src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.5.1/dom4.js"
+ src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.5.2/dom4.js"
>/* DOM4 */</script>
```
View
@@ -1,2 +1,2 @@
-/*! (C) WebReflection Mit Style License */
-(function(e){"use strict";function t(){return l.createDocumentFragment()}function n(e){return l.createElement(e)}function r(e){if(e.length===1)return i(e[0]);for(var n=t(),r=I.call(e),s=0;s<e.length;s++)n.appendChild(i(r[s]));return n}function i(e){return typeof e=="string"?l.createTextNode(e):e}for(var s,o,u,a,f,l=e.document,c=Object.defineProperty||function(e,t,n){e.__defineGetter__(t,n.get)},h=[].indexOf||function(t){var n=this.length;while(n--)if(this[n]===t)break;return n},p=function(e){if(!e)throw"SyntaxError";if(y.test(e))throw"InvalidCharacterError";return e},d=function(e){var t=e.className,n=typeof t=="object",r=(n?t.baseVal:t).replace(g,"");r.length&&F.push.apply(this,r.split(y)),this._isSVG=n,this._=e},v={get:function(){return new d(this)},set:function(){}},m="dom4-tmp-".concat(Math.random()*+(new Date)).replace(".","-"),g=/^\s+|\s+$/g,y=/\s+/,b=" ",w="classList",E=function(t,n){if(this.contains(t))n||this.remove(t);else if(n===undefined||n)n=!0,this.add(t);return!!n},S=e.DocumentFragment,x=e.Node,T=x&&x.prototype,N=e.CharacterData||x,C=N&&N.prototype,k=e.DocumentType,L=k&&k.prototype,A=(e.Element||x||e.HTMLElement).prototype,O=e.HTMLSelectElement||n("select").constructor,M=O.prototype.remove,_=e.ShadowRoot,D=e.SVGElement,P=/ /g,H="\\ ",B=function(e){var t=e==="querySelectorAll";return function(n){var r,i,s,o,u,a,f=this.parentNode;if(f){for(s=this.getAttribute("id")||m,o=s===m?s:s.replace(P,H),a=n.split(","),i=0;i<a.length;i++)a[i]="#"+o+" "+a[i];n=a.join(",")}s===m&&this.setAttribute("id",s),u=(f||this)[e](n),s===m&&this.removeAttribute("id");if(t){i=u.length,r=new Array(i);while(i--)r[i]=u[i]}else r=u;return r}},j=function(e){"query"in e||(e.query=A.query),"queryAll"in e||(e.queryAll=A.queryAll)},F=["matches",A.matchesSelector||A.webkitMatchesSelector||A.khtmlMatchesSelector||A.mozMatchesSelector||A.msMatchesSelector||A.oMatchesSelector||function(t){var n=this.parentNode;return!!n&&-1<h.call(n.querySelectorAll(t),this)},"closest",function(t){var n=this,r;while((r=n&&n.matches)&&!n.matches(t))n=n.parentNode;return r?n:null},"prepend",function(){var t=this.firstChild,n=r(arguments);t?this.insertBefore(n,t):this.appendChild(n)},"append",function(){this.appendChild(r(arguments))},"before",function(){var t=this.parentNode;t&&t.insertBefore(r(arguments),this)},"after",function(){var t=this.parentNode,n=this.nextSibling,i=r(arguments);t&&(n?t.insertBefore(i,n):t.appendChild(i))},"replace",function(){this.replaceWith.apply(this,arguments)},"replaceWith",function(){var t=this.parentNode;t&&t.replaceChild(r(arguments),this)},"remove",function(){var t=this.parentNode;t&&t.removeChild(this)},"query",B("querySelector"),"queryAll",B("querySelectorAll")],I=F.slice,q=F.length;q;q-=2)o=F[q-2],o in A||(A[o]=F[q-1]),o==="remove"&&(O.prototype[o]=function(){return 0<arguments.length?M.apply(this,arguments):A.remove.call(this)}),/before|after|replace|remove/.test(o)&&(N&&!(o in C)&&(C[o]=F[q-1]),k&&!(o in L)&&(L[o]=F[q-1]));j(l);if(S)j(S.prototype);else try{j(t().constructor.prototype)}catch(R){}_&&j(_.prototype),n("a").matches("a")||(A[o]=function(e){return function(n){return e.call(this.parentNode?this:t().appendChild(this),n)}}(A[o])),d.prototype={length:0,add:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)||F.push.call(this,o);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},contains:function(e){return function(n){return q=e.call(this,o=p(n)),-1<q}}([].indexOf||function(e){q=this.length;while(q--&&this[q]!==e);return q}),item:function(t){return this[t]||null},remove:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)&&F.splice.call(this,q,1);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},toggle:E,toString:function U(){return F.join.call(this,b)}},D&&!(w in D.prototype)&&c(D.prototype,w,v),w in l.documentElement?(a=n("div")[w],a.add("a","b","a"),"a b"!=a&&(u=a.constructor.prototype,"add"in u||(u=e.TemporaryTokenList.prototype),f=function(e){return function(){var t=0;while(t<arguments.length)e.call(this,arguments[t++])}},u.add=f(u.add),u.remove=f(u.remove),u.toggle=E)):c(A,w,v),"contains"in T||c(T,"contains",{value:function(e){while(e&&e!==this)e=e.parentNode;return this===e}}),"head"in l||c(l,"head",{get:function(){return s||(s=l.getElementsByTagName("head")[0])}}),function(){for(var t,n=e.requestAnimationFrame,r=e.cancelAnimationFrame,i=["o","ms","moz","webkit"],s=i.length;!r&&s--;)n=n||e[i[s]+"RequestAnimationFrame"],r=e[i[s]+"CancelAnimationFrame"]||e[i[s]+"CancelRequestAnimationFrame"];r||(n?(t=n,n=function(e){var n=!0;return t(function(){n&&e.apply(this,arguments)}),function(){n=!1}},r=function(e){e()}):(n=function(e){return setTimeout(e,15,15)},r=function(e){clearTimeout(e)})),e.requestAnimationFrame=n,e.cancelAnimationFrame=r}();try{new e.CustomEvent("?")}catch(R){e.CustomEvent=function(e,t){function n(n,i){var s=l.createEvent(e);if(typeof n!="string")throw new Error("An event name must be provided");return e=="Event"&&(s.initCustomEvent=r),i==null&&(i=t),s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s}function r(e,t,n,r){this.initEvent(e,t,n),this.detail=r}return n}(e.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}})(window);
+/*! (C) Andrea Giammarchi - @WebReflection - Mit Style License */
+(function(e){"use strict";function t(){return l.createDocumentFragment()}function n(e){return l.createElement(e)}function r(e){if(e.length===1)return i(e[0]);for(var n=t(),r=I.call(e),s=0;s<e.length;s++)n.appendChild(i(r[s]));return n}function i(e){return typeof e=="string"?l.createTextNode(e):e}for(var s,o,u,a,f,l=e.document,c=Object.defineProperty||function(e,t,n){e.__defineGetter__(t,n.get)},h=[].indexOf||function(t){var n=this.length;while(n--)if(this[n]===t)break;return n},p=function(e){if(!e)throw"SyntaxError";if(y.test(e))throw"InvalidCharacterError";return e},d=function(e){var t=e.className,n=typeof t=="object",r=(n?t.baseVal:t).replace(g,"");r.length&&F.push.apply(this,r.split(y)),this._isSVG=n,this._=e},v={get:function(){return new d(this)},set:function(){}},m="dom4-tmp-".concat(Math.random()*+(new Date)).replace(".","-"),g=/^\s+|\s+$/g,y=/\s+/,b=" ",w="classList",E=function(t,n){if(this.contains(t))n||this.remove(t);else if(n===undefined||n)n=!0,this.add(t);return!!n},S=e.DocumentFragment,x=e.Node,T=(x||Element).prototype,N=e.CharacterData||x,C=N&&N.prototype,k=e.DocumentType,L=k&&k.prototype,A=(e.Element||x||e.HTMLElement).prototype,O=e.HTMLSelectElement||n("select").constructor,M=O.prototype.remove,_=e.ShadowRoot,D=e.SVGElement,P=/ /g,H="\\ ",B=function(e){var t=e==="querySelectorAll";return function(n){var r,i,s,o,u,a,f=this.parentNode;if(f){for(s=this.getAttribute("id")||m,o=s===m?s:s.replace(P,H),a=n.split(","),i=0;i<a.length;i++)a[i]="#"+o+" "+a[i];n=a.join(",")}s===m&&this.setAttribute("id",s),u=(f||this)[e](n),s===m&&this.removeAttribute("id");if(t){i=u.length,r=new Array(i);while(i--)r[i]=u[i]}else r=u;return r}},j=function(e){"query"in e||(e.query=A.query),"queryAll"in e||(e.queryAll=A.queryAll)},F=["matches",A.matchesSelector||A.webkitMatchesSelector||A.khtmlMatchesSelector||A.mozMatchesSelector||A.msMatchesSelector||A.oMatchesSelector||function(t){var n=this.parentNode;return!!n&&-1<h.call(n.querySelectorAll(t),this)},"closest",function(t){var n=this,r;while((r=n&&n.matches)&&!n.matches(t))n=n.parentNode;return r?n:null},"prepend",function(){var t=this.firstChild,n=r(arguments);t?this.insertBefore(n,t):this.appendChild(n)},"append",function(){this.appendChild(r(arguments))},"before",function(){var t=this.parentNode;t&&t.insertBefore(r(arguments),this)},"after",function(){var t=this.parentNode,n=this.nextSibling,i=r(arguments);t&&(n?t.insertBefore(i,n):t.appendChild(i))},"replace",function(){this.replaceWith.apply(this,arguments)},"replaceWith",function(){var t=this.parentNode;t&&t.replaceChild(r(arguments),this)},"remove",function(){var t=this.parentNode;t&&t.removeChild(this)},"query",B("querySelector"),"queryAll",B("querySelectorAll")],I=F.slice,q=F.length;q;q-=2)o=F[q-2],o in A||(A[o]=F[q-1]),o==="remove"&&(O.prototype[o]=function(){return 0<arguments.length?M.apply(this,arguments):A.remove.call(this)}),/before|after|replace|remove/.test(o)&&(N&&!(o in C)&&(C[o]=F[q-1]),k&&!(o in L)&&(L[o]=F[q-1]));j(l);if(S)j(S.prototype);else try{j(t().constructor.prototype)}catch(R){}_&&j(_.prototype),n("a").matches("a")||(A[o]=function(e){return function(n){return e.call(this.parentNode?this:t().appendChild(this),n)}}(A[o])),d.prototype={length:0,add:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)||F.push.call(this,o);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},contains:function(e){return function(n){return q=e.call(this,o=p(n)),-1<q}}([].indexOf||function(e){q=this.length;while(q--&&this[q]!==e);return q}),item:function(t){return this[t]||null},remove:function(){for(var t=0,n;t<arguments.length;t++)n=arguments[t],this.contains(n)&&F.splice.call(this,q,1);this._isSVG?this._.setAttribute("class",""+this):this._.className=""+this},toggle:E,toString:function U(){return F.join.call(this,b)}},D&&!(w in D.prototype)&&c(D.prototype,w,v),w in l.documentElement?(a=n("div")[w],a.add("a","b","a"),"a b"!=a&&(u=a.constructor.prototype,"add"in u||(u=e.TemporaryTokenList.prototype),f=function(e){return function(){var t=0;while(t<arguments.length)e.call(this,arguments[t++])}},u.add=f(u.add),u.remove=f(u.remove),u.toggle=E)):c(A,w,v),"contains"in T||c(T,"contains",{value:function(e){while(e&&e!==this)e=e.parentNode;return this===e}}),"head"in l||c(l,"head",{get:function(){return s||(s=l.getElementsByTagName("head")[0])}}),function(){for(var t,n=e.requestAnimationFrame,r=e.cancelAnimationFrame,i=["o","ms","moz","webkit"],s=i.length;!r&&s--;)n=n||e[i[s]+"RequestAnimationFrame"],r=e[i[s]+"CancelAnimationFrame"]||e[i[s]+"CancelRequestAnimationFrame"];r||(n?(t=n,n=function(e){var n=!0;return t(function(){n&&e.apply(this,arguments)}),function(){n=!1}},r=function(e){e()}):(n=function(e){return setTimeout(e,15,15)},r=function(e){clearTimeout(e)})),e.requestAnimationFrame=n,e.cancelAnimationFrame=r}();try{new e.CustomEvent("?")}catch(R){e.CustomEvent=function(e,t){function n(n,i){var s=l.createEvent(e);if(typeof n!="string")throw new Error("An event name must be provided");return e=="Event"&&(s.initCustomEvent=r),i==null&&(i=t),s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s}function r(e,t,n,r){this.initEvent(e,t,n),this.detail=r}return n}(e.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}})(window);
View
@@ -1,5 +1,5 @@
/*!
-Copyright (C) 2013 by WebReflection
+Copyright (C) 2013-2015 by Andrea Giammarchi - @WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -118,7 +118,7 @@ THE SOFTWARE.
},
DocumentFragment = window.DocumentFragment,
Node = window.Node,
- NodePrototype = Node && Node.prototype,
+ NodePrototype = (Node || Element).prototype,
CharacterData = window.CharacterData || Node,
CharacterDataPrototype = CharacterData && CharacterData.prototype,
DocumentType = window.DocumentType,
View
@@ -2,7 +2,7 @@
"name": "dom4",
"title": "DOM4",
"description": "a fully tested and covered polyfill for new DOM Level 4 entries",
- "version": "1.5.1",
+ "version": "1.5.2",
"main": "build/dom4.js",
"homepage": "https://github.com/WebReflection/dom4",
"author": {
View
@@ -96,7 +96,7 @@
},
DocumentFragment = window.DocumentFragment,
Node = window.Node,
- NodePrototype = Node && Node.prototype,
+ NodePrototype = (Node || Element).prototype,
CharacterData = window.CharacterData || Node,
CharacterDataPrototype = CharacterData && CharacterData.prototype,
DocumentType = window.DocumentType,
View
@@ -1 +1 @@
-/*! (C) WebReflection Mit Style License */
+/*! (C) Andrea Giammarchi - @WebReflection - Mit Style License */

0 comments on commit 9ed079f

Please sign in to comment.