From 629630a08653bf0d8f2f20198b23fce52a76a6b1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 9 Jul 2021 11:49:07 +0100 Subject: [PATCH] Update Modernizr and stop it from polluting classes on the html tag --- .modernizr.json | 5 +---- package.json | 2 +- src/vector/modernizr.js | 6 +++--- yarn.lock | 12 ++++++------ 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.modernizr.json b/.modernizr.json index e6fde5a968..fcfd7124f3 100644 --- a/.modernizr.json +++ b/.modernizr.json @@ -1,9 +1,6 @@ { "minify": true, - "classPrefix": "modernizr_", - "options": [ - "setClasses" - ], + "enableClasses": false, "feature-detects": [ "test/css/animations", "test/css/displaytable", diff --git a/package.json b/package.json index 0a8abf9f6e..12e7be0697 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "mini-css-extract-plugin": "^0.12.0", "minimist": "^1.2.5", "mkdirp": "^1.0.4", - "modernizr": "^3.11.4", + "modernizr": "^3.11.7", "node-fetch": "^2.6.1", "optimize-css-assets-webpack-plugin": "^5.0.4", "postcss-easings": "^2.0.0", diff --git a/src/vector/modernizr.js b/src/vector/modernizr.js index 19bfb14391..b451e2486b 100644 --- a/src/vector/modernizr.js +++ b/src/vector/modernizr.js @@ -1,3 +1,3 @@ -/*! modernizr 3.10.0 (Custom Build) | MIT * - * https://modernizr.com/download/?-cors-cryptography-cssanimations-cssfilters-displaytable-es5date-es5function-es5object-es5undefined-es6array-es6collections-es6string-fetch-flexbox-json-localstorage-objectfit-promises-sandbox-svg-svgasimg-svgfilters-urlparser-urlsearchparams-setclasses-cssclassprefix:modernizr_ !*/ -!function(e,t,n,r){function o(e,t){return typeof e===t}function i(e){var t=C.className,n=Modernizr._config.classPrefix||"";if(_&&(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)),_?C.className.baseVal=t:C.className=t)}function s(e,t){return!!~(""+e).indexOf(t)}function a(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):_?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(_?"svg":"body"),e.fake=!0),e}function f(e,t,r,o){var i,s,f,u,d="modernizr",c=a("div"),p=l();if(parseInt(r,10))for(;r--;)f=a("div"),f.id=o?o[r]:d+(r+1),c.appendChild(f);return i=a("style"),i.type="text/css",i.id="s"+d,(p.fake?p:c).appendChild(i),p.appendChild(c),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(n.createTextNode(e)),c.id=d,p.fake&&(p.style.background="",p.style.overflow="hidden",u=C.style.overflow,C.style.overflow="hidden",C.appendChild(p)),s=t(c,e),p.fake?(p.parentNode.removeChild(p),C.style.overflow=u,C.offsetHeight):c.parentNode.removeChild(c),!!s}function u(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function d(e,n,r){var o;if("getComputedStyle"in t){o=getComputedStyle.call(t,e,n);var i=t.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(i){var s=i.error?"error":"log";i[s].call(i,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&e.currentStyle&&e.currentStyle[r];return o}function c(e,n){var o=e.length;if("CSS"in t&&"supports"in t.CSS){for(;o--;)if(t.CSS.supports(u(e[o]),n))return!0;return!1}if("CSSSupportsRule"in t){for(var i=[];o--;)i.push("("+u(e[o])+":"+n+")");return i=i.join(" or "),f("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"===d(e,null,"position")})}return r}function p(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function y(e,t,n,i){function l(){u&&(delete P.style,delete P.modElem)}if(i=!o(i,"undefined")&&i,!o(n,"undefined")){var f=c(e,n);if(!o(f,"undefined"))return f}for(var u,d,y,m,g,h=["modernizr","tspan","samp"];!P.style&&h.length;)u=!0,P.modElem=a(h.shift()),P.style=P.modElem.style;for(y=e.length,d=0;d9)}),Modernizr.addTest("flexbox",v("flexBasis","1px",!0));var L=function(e){var n,o=A.length,i=t.CSSRule;if(void 0===i)return r;if(!e)return!1;if(e=e.replace(/^@/,""),(n=e.replace(/-/g,"_").toUpperCase()+"_RULE")in i)return"@"+e;for(var s=0;s0&&(t+=" "+n+e.join(" "+n)),O?x.className.baseVal=t:x.className=t)}function S(e,t){if("object"==typeof e)for(var n in e)k(e,n)&&S(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2===r.length&&(o=o[r[1]]),void 0!==o)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),v([(t&&!1!==t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}var b=[],w={_version:"3.11.7",_config:{classPrefix:"",enableClasses:!1,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=w,Modernizr=new Modernizr;var T=[],C="Moz O ms Webkit",_=w._config.usePrefixes?C.split(" "):[];w._cssomPrefixes=_;var x=n.documentElement,O="svg"===x.nodeName.toLowerCase(),j={elem:s("modernizr")};Modernizr._q.push(function(){delete j.elem});var P={style:j.elem.style};Modernizr._q.unshift(function(){delete P.style});var E=w._config.usePrefixes?C.toLowerCase().split(" "):[];w._domPrefixes=E,w.testAllProps=g,w.testAllProps=h,Modernizr.addTest("cssanimations",h("animationName","a",!0)),(w.testStyles=l)("#modernizr{display: table; direction: ltr}#modernizr div{display: table-cell; padding: 10px}",function(e){var t,n=e.childNodes;t=n[0].offsetLeft9)}),Modernizr.addTest("flexbox",h("flexBasis","1px",!0));var L=function(e){var n,o=A.length,i=t.CSSRule;if(void 0===i)return r;if(!e)return!1;if(e=e.replace(/^@/,""),(n=e.replace(/-/g,"_").toUpperCase()+"_RULE")in i)return"@"+e;for(var s=0;s