Unverified Commit 6967b53c authored by alexpott's avatar alexpott
Browse files

Issue #3185165 by Spokje, vipin.mittal18, Suresh Prabhu Parkala, lauriii,...

Issue #3185165 by Spokje, vipin.mittal18, Suresh Prabhu Parkala, lauriii, mherchel: Update Modernizr to latest version

(cherry picked from commit 61a07efc)
parent 234f8dd2
For some reason the link in the core file https://modernizr.com/download/?-details-inputtypes-addtest-mq-prefixed-prefixes-setclasses-teststyles
always produces a 3.6.0 version when using the `Build` option.
Browse to the same URL and use the `Command Line Config` option to `Download` the config JSON file `modernizr-config.json`.
Following the instructions here https://modernizr.com/docs
```
sudo npm install -g npm
npm install -g modernizr
modernizr -c modernizr-config.json // This is the file downloaded from http://modernizr.com/download
```
This produces a `modernizr.js` file that should be renamed to `modernizr.min.js` and copied to `core/assets/vendor/modernizr/modernizr.min.js`.
Please also remember to update the version number of Modernizer in `core/core.libraries.yml`.
/*! modernizr 3.8.0 (Custom Build) | MIT *
/*! modernizr 3.11.7 (Custom Build) | MIT *
* https://modernizr.com/download/?-details-inputtypes-addtest-mq-prefixed-prefixes-setclasses-teststyles !*/
!function(e,t,n){function r(e,t){return typeof e===t}function i(e){var t=w.className,n=Modernizr._config.classPrefix||"";if(b&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(e.length>0&&(t+=" "+n+e.join(" "+n)),b?w.className.baseVal=t:w.className=t)}function o(e,t){if("object"==typeof e)for(var n in e)_(e,n)&&o(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),s=Modernizr[r[0]];if(2===r.length&&(s=s[r[1]]),void 0!==s)return Modernizr;t="function"==typeof t?t():t,1===r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),i([(t&&!1!==t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function s(e,t){return!!~(""+e).indexOf(t)}function l(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):b?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function a(){var e=t.body;return e||(e=l(b?"svg":"body"),e.fake=!0),e}function u(e,n,r,i){var o,s,u,f,c="modernizr",d=l("div"),p=a();if(parseInt(r,10))for(;r--;)u=l("div"),u.id=i?i[r]:c+(r+1),d.appendChild(u);return o=l("style"),o.type="text/css",o.id="s"+c,(p.fake?p:d).appendChild(o),p.appendChild(d),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(t.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",f=w.style.overflow,w.style.overflow="hidden",w.appendChild(p)),s=n(d,e),p.fake?(p.parentNode.removeChild(p),w.style.overflow=f,w.offsetHeight):d.parentNode.removeChild(d),!!s}function f(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function c(t,n,r){var i;if("getComputedStyle"in e){i=getComputedStyle.call(e,t,n);var o=e.console;if(null!==i)r&&(i=i.getPropertyValue(r));else if(o){var s=o.error?"error":"log";o[s].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else i=!n&&t.currentStyle&&t.currentStyle[r];return i}function d(t,r){var i=t.length;if("CSS"in e&&"supports"in e.CSS){for(;i--;)if(e.CSS.supports(f(t[i]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var o=[];i--;)o.push("("+f(t[i])+":"+r+")");return o=o.join(" or "),u("@supports ("+o+") { #modernizr { position: absolute; } }",function(e){return"absolute"===c(e,null,"position")})}return n}function p(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function m(e,t,i,o){function a(){f&&(delete z.style,delete z.modElem)}if(o=!r(o,"undefined")&&o,!r(i,"undefined")){var u=d(e,i);if(!r(u,"undefined"))return u}for(var f,c,m,h,y,v=["modernizr","tspan","samp"];!z.style&&v.length;)f=!0,z.modElem=l(v.shift()),z.style=z.modElem.style;for(m=e.length,c=0;c<m;c++)if(h=e[c],y=z.style[h],s(h,"-")&&(h=p(h)),z.style[h]!==n){if(o||r(i,"undefined"))return a(),"pfx"!==t||h;try{z.style[h]=i}catch(e){}if(z.style[h]!==y)return a(),"pfx"!==t||h}return a(),!1}function h(e,t){return function(){return e.apply(t,arguments)}}function y(e,t,n){var i;for(var o in e)if(e[o]in t)return!1===n?e[o]:(i=t[e[o]],r(i,"function")?h(i,n||t):i);return!1}function v(e,t,n,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),l=(e+" "+T.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(l,t,i,o):(l=(e+" "+P.join(s+" ")+s).split(" "),y(l,t,n))}var g=[],C={_version:"3.8.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){g.push({name:e,fn:t,options:n})},addAsyncTest:function(e){g.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var _,S=[],w=t.documentElement,b="svg"===w.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),C._l={},C.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},C._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e;for(e=0;e<n.length;e++)(0,n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){C.addTest=o});var x="Moz O ms Webkit",T=C._config.usePrefixes?x.split(" "):[];C._cssomPrefixes=T;var k={elem:l("modernizr")};Modernizr._q.push(function(){delete k.elem});var z={style:k.elem.style};Modernizr._q.unshift(function(){delete z.style});var P=C._config.usePrefixes?x.toLowerCase().split(" "):[];C._domPrefixes=P,C.testAllProps=v;var E=function(t){var r,i=N.length,o=e.CSSRule;if(void 0===o)return n;if(!t)return!1;if(t=t.replace(/^@/,""),(r=t.replace(/-/g,"_").toUpperCase()+"_RULE")in o)return"@"+t;for(var s=0;s<i;s++){var l=N[s];if(l.toUpperCase()+"_"+r in o)return"@-"+l.toLowerCase()+"-"+t}return!1};C.atRule=E;var j=(C.prefixed=function(e,t,n){return 0===e.indexOf("@")?E(e):(-1!==e.indexOf("-")&&(e=p(e)),t?v(e,t,n):v(e,"pfx"))},C.testStyles=u),L=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return u("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"===(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();C.mq=L;var N=C._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];C._prefixes=N,Modernizr.addTest("details",function(){var e,t=l("details");return"open"in t&&(j("#modernizr details{display:block}",function(n){n.appendChild(t),t.innerHTML="<summary>a</summary>b",e=t.offsetHeight,t.open=!0,e=e!==t.offsetHeight}),e)});var A=l("input");!function(){for(var e,r,i,o=["search","tel","url","email","datetime","date","month","week","time","datetime-local","number","range","color"],s=0;s<o.length;s++)A.setAttribute("type",e=o[s]),i="text"!==A.type&&"style"in A,i&&(A.value="1)",A.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&A.style.WebkitAppearance!==n?(w.appendChild(A),r=t.defaultView,i=r.getComputedStyle&&"textfield"!==r.getComputedStyle(A,null).WebkitAppearance&&0!==A.offsetHeight,w.removeChild(A)):/^(search|tel)$/.test(e)||(i=/^(url|email)$/.test(e)?A.checkValidity&&!1===A.checkValidity():"1)"!==A.value)),Modernizr.addTest("inputtypes."+e,!!i)}(),function(){var e,t,n,i,o,s,l;for(var a in g)if(g.hasOwnProperty(a)){if(e=[],t=g[a],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(i=r(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)s=e[o],l=s.split("."),1===l.length?Modernizr[l[0]]=i:(Modernizr[l[0]]&&(!Modernizr[l[0]]||Modernizr[l[0]]instanceof Boolean)||(Modernizr[l[0]]=new Boolean(Modernizr[l[0]])),Modernizr[l[0]][l[1]]=i),S.push((i?"":"no-")+l.join("-"))}}(),i(S),delete C.addTest,delete C.addAsyncTest;for(var O=0;O<Modernizr._q.length;O++)Modernizr._q[O]();e.Modernizr=Modernizr}(window,document);
!function(e,t,n,r){function i(e,t){return typeof e===t}function o(e){var t=b.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(e.length>0&&(t+=" "+n+e.join(" "+n)),S?b.className.baseVal=t:b.className=t)}function s(e,t){if("object"==typeof e)for(var n in e)T(e,n)&&s(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),i=Modernizr[r[0]];if(2===r.length&&(i=i[r[1]]),void 0!==i)return Modernizr;t="function"==typeof t?t():t,1===r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),o([(t&&!1!==t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function a(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):S?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function l(){var e=n.body;return e||(e=a(S?"svg":"body"),e.fake=!0),e}function u(e,t,r,i){var o,s,u,f,c="modernizr",d=a("div"),p=l();if(parseInt(r,10))for(;r--;)u=a("div"),u.id=i?i[r]:c+(r+1),d.appendChild(u);return o=a("style"),o.type="text/css",o.id="s"+c,(p.fake?p:d).appendChild(o),p.appendChild(d),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(n.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",f=b.style.overflow,b.style.overflow="hidden",b.appendChild(p)),s=t(d,e),p.fake&&p.parentNode?(p.parentNode.removeChild(p),b.style.overflow=f,b.offsetHeight):d.parentNode.removeChild(d),!!s}function f(e,n,r){var i;if("getComputedStyle"in t){i=getComputedStyle.call(t,e,n);var o=t.console;if(null!==i)r&&(i=i.getPropertyValue(r));else if(o){var s=o.error?"error":"log";o[s].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else i=!n&&e.currentStyle&&e.currentStyle[r];return i}function c(e,t){return!!~(""+e).indexOf(t)}function d(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function p(e,n){var i=e.length;if("CSS"in t&&"supports"in t.CSS){for(;i--;)if(t.CSS.supports(d(e[i]),n))return!0;return!1}if("CSSSupportsRule"in t){for(var o=[];i--;)o.push("("+d(e[i])+":"+n+")");return o=o.join(" or "),u("@supports ("+o+") { #modernizr { position: absolute; } }",function(e){return"absolute"===f(e,null,"position")})}return r}function m(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function h(e,t,n,o){function s(){u&&(delete N.style,delete N.modElem)}if(o=!i(o,"undefined")&&o,!i(n,"undefined")){var l=p(e,n);if(!i(l,"undefined"))return l}for(var u,f,d,h,v,y=["modernizr","tspan","samp"];!N.style&&y.length;)u=!0,N.modElem=a(y.shift()),N.style=N.modElem.style;for(d=e.length,f=0;f<d;f++)if(h=e[f],v=N.style[h],c(h,"-")&&(h=m(h)),N.style[h]!==r){if(o||i(n,"undefined"))return s(),"pfx"!==t||h;try{N.style[h]=n}catch(e){}if(N.style[h]!==v)return s(),"pfx"!==t||h}return s(),!1}function v(e,t){return function(){return e.apply(t,arguments)}}function y(e,t,n){var r;for(var o in e)if(e[o]in t)return!1===n?e[o]:(r=t[e[o]],i(r,"function")?v(r,n||t):r);return!1}function g(e,t,n,r,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+P.join(s+" ")+s).split(" ");return i(t,"string")||i(t,"undefined")?h(a,t,r,o):(a=(e+" "+j.join(s+" ")+s).split(" "),y(a,t,n))}var C=[],_={_version:"3.11.7",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){C.push({name:e,fn:t,options:n})},addAsyncTest:function(e){C.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=_,Modernizr=new Modernizr;var w=[],b=n.documentElement,S="svg"===b.nodeName.toLowerCase(),x=_._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];_._prefixes=x;var T;!function(){var e={}.hasOwnProperty;T=i(e,"undefined")||i(e.call,"undefined")?function(e,t){return t in e&&i(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),_._l={},_.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},_._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e;for(e=0;e<n.length;e++)(0,n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){_.addTest=s});var k=function(){var e=t.matchMedia||t.msMatchMedia;return e?function(t){var n=e(t);return n&&n.matches||!1}:function(e){var t=!1;return u("@media "+e+" { #modernizr { position: absolute; } }",function(e){t="absolute"===f(e,null,"position")}),t}}();_.mq=k;var z="Moz O ms Webkit",P=_._config.usePrefixes?z.split(" "):[];_._cssomPrefixes=P;var E={elem:a("modernizr")};Modernizr._q.push(function(){delete E.elem});var N={style:E.elem.style};Modernizr._q.unshift(function(){delete N.style});var j=_._config.usePrefixes?z.toLowerCase().split(" "):[];_._domPrefixes=j,_.testAllProps=g;var L=function(e){var n,i=x.length,o=t.CSSRule;if(void 0===o)return r;if(!e)return!1;if(e=e.replace(/^@/,""),(n=e.replace(/-/g,"_").toUpperCase()+"_RULE")in o)return"@"+e;for(var s=0;s<i;s++){var a=x[s];if(a.toUpperCase()+"_"+n in o)return"@-"+a.toLowerCase()+"-"+e}return!1};_.atRule=L;var A=(_.prefixed=function(e,t,n){return 0===e.indexOf("@")?L(e):(-1!==e.indexOf("-")&&(e=m(e)),t?g(e,t,n):g(e,"pfx"))},_.testStyles=u),O=a("input");!function(){for(var e,t,i,o=["search","tel","url","email","datetime","date","month","week","time","datetime-local","number","range","color"],s=0;s<o.length;s++)O.setAttribute("type",e=o[s]),i="text"!==O.type&&"style"in O,i&&(O.value="1)",O.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&O.style.WebkitAppearance!==r?(b.appendChild(O),t=n.defaultView,i=t.getComputedStyle&&"textfield"!==t.getComputedStyle(O,null).WebkitAppearance&&0!==O.offsetHeight,b.removeChild(O)):/^(search|tel)$/.test(e)||(i=/^(url|email)$/.test(e)?O.checkValidity&&!1===O.checkValidity():"1)"!==O.value)),Modernizr.addTest("inputtypes."+e,!!i)}(),Modernizr.addTest("details",function(){var e,t=a("details");return"open"in t&&(A("#modernizr details{display:block}",function(n){n.appendChild(t),t.innerHTML="<summary>a</summary>b",e=t.offsetHeight,t.open=!0,e=e!==t.offsetHeight}),e)}),function(){var e,t,n,r,o,s,a;for(var l in C)if(C.hasOwnProperty(l)){if(e=[],t=C[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=i(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)s=e[o],a=s.split("."),1===a.length?Modernizr[a[0]]=r:(Modernizr[a[0]]&&(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean)||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=r),w.push((r?"":"no-")+a.join("-"))}}(),o(w),delete _.addTest,delete _.addAsyncTest;for(var q=0;q<Modernizr._q.length;q++)Modernizr._q[q]();e.Modernizr=Modernizr}(window,window,document);
\ No newline at end of file
......@@ -712,7 +712,7 @@ modernizr:
name: MIT
url: https://modernizr.com/license/
gpl-compatible: true
version: "3.8.0"
version: "3.11.7"
js:
assets/vendor/modernizr/modernizr.min.js: { preprocess: 0, weight: -21, minified: true }
misc/modernizr-additional-tests.js: { preprocess: 0, weight: -20 }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment