From eba63ce9abeb1b698cce071cd527a2189a4a969a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 14 Mar 2020 00:13:47 +0000 Subject: [PATCH] Add url tests to Modernizr Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .modernizr.json | 3 +++ src/vector/modernizr.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.modernizr.json b/.modernizr.json index 764a320b2..9b3990345 100644 --- a/.modernizr.json +++ b/.modernizr.json @@ -25,6 +25,9 @@ "test/svg/asimg", "test/svg/filters", + "test/url/parser", + "test/url/urlsearchparams", + "test/cors", "test/iframe/sandbox", "test/json", diff --git a/src/vector/modernizr.js b/src/vector/modernizr.js index 81e218dbc..e4c09d410 100644 --- a/src/vector/modernizr.js +++ b/src/vector/modernizr.js @@ -1,3 +1,3 @@ /*! modernizr 3.8.0 (Custom Build) | MIT * - * https://modernizr.com/download/?-cors-cssanimations-cssfilters-displaytable-es5date-es5function-es5object-es5undefined-es6array-es6collections-es6string-fetch-flexbox-json-localstorage-objectfit-promises-sandbox-svg-svgasimg-svgfilters-setclasses-cssclassprefix:modernizr_ !*/ -!function(e,t,n){function r(e,t){return typeof e===t}function o(e){var t=T.className,n=Modernizr._config.classPrefix||"";if(C&&(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?T.className.baseVal=t:T.className=t)}function i(e,t){return!!~(""+e).indexOf(t)}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):C?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=s(C?"svg":"body"),e.fake=!0),e}function l(e,n,r,o){var i,l,f,u,d="modernizr",p=s("div"),c=a();if(parseInt(r,10))for(;r--;)f=s("div"),f.id=o?o[r]:d+(r+1),p.appendChild(f);return i=s("style"),i.type="text/css",i.id="s"+d,(c.fake?c:p).appendChild(i),c.appendChild(p),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),p.id=d,c.fake&&(c.style.background="",c.style.overflow="hidden",u=T.style.overflow,T.style.overflow="hidden",T.appendChild(c)),l=n(p,e),c.fake?(c.parentNode.removeChild(c),T.style.overflow=u,T.offsetHeight):p.parentNode.removeChild(p),!!l}function f(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function u(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var i=e.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&&t.currentStyle&&t.currentStyle[r];return o}function d(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(f(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+f(t[o])+":"+r+")");return i=i.join(" or "),l("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"===u(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 c(e,t,o,a){function l(){u&&(delete j.style,delete j.modElem)}if(a=!r(a,"undefined")&&a,!r(o,"undefined")){var f=d(e,o);if(!r(f,"undefined"))return f}for(var u,c,y,m,g,v=["modernizr","tspan","samp"];!j.style&&v.length;)u=!0,j.modElem=s(v.shift()),j.style=j.modElem.style;for(y=e.length,c=0;c9)}),Modernizr.addTest("flexbox",v("flexBasis","1px",!0));var z=function(t){var r,o=E.length,i=e.CSSRule;if(void 0===i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),(r=t.replace(/-/g,"_").toUpperCase()+"_RULE")in i)return"@"+t;for(var s=0;s0&&(t+=" "+n+e.join(" "+n)),C?T.className.baseVal=t:T.className=t)}function i(e,t){return!!~(""+e).indexOf(t)}function s(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):C?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=s(C?"svg":"body"),e.fake=!0),e}function l(e,n,r,o){var i,l,f,u,d="modernizr",c=s("div"),p=a();if(parseInt(r,10))for(;r--;)f=s("div"),f.id=o?o[r]:d+(r+1),c.appendChild(f);return i=s("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(t.createTextNode(e)),c.id=d,p.fake&&(p.style.background="",p.style.overflow="hidden",u=T.style.overflow,T.style.overflow="hidden",T.appendChild(p)),l=n(c,e),p.fake?(p.parentNode.removeChild(p),T.style.overflow=u,T.offsetHeight):c.parentNode.removeChild(c),!!l}function f(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function u(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var i=e.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&&t.currentStyle&&t.currentStyle[r];return o}function d(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(f(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+f(t[o])+":"+r+")");return i=i.join(" or "),l("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"===u(e,null,"position")})}return n}function c(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function p(e,t,o,a){function l(){u&&(delete j.style,delete j.modElem)}if(a=!r(a,"undefined")&&a,!r(o,"undefined")){var f=d(e,o);if(!r(f,"undefined"))return f}for(var u,p,y,m,g,h=["modernizr","tspan","samp"];!j.style&&h.length;)u=!0,j.modElem=s(h.shift()),j.style=j.modElem.style;for(y=e.length,p=0;p9)}),Modernizr.addTest("flexbox",h("flexBasis","1px",!0));var N=function(t){var r,o=E.length,i=e.CSSRule;if(void 0===i)return n;if(!t)return!1;if(t=t.replace(/^@/,""),(r=t.replace(/-/g,"_").toUpperCase()+"_RULE")in i)return"@"+t;for(var s=0;s