customizr 2.0.0 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/testing.yml +29 -0
- package/LICENSE +21 -21
- package/README.md +258 -259
- package/bin/customizr +71 -71
- package/build/modernizr-custom.js +6 -6
- package/build/modernizr-exclude.js +438 -73
- package/build/modernizr-package.js +6 -6
- package/build/modernizr-prefixed.js +9 -10
- package/build/modernizr-select.js +11 -12
- package/cache/options.json +14 -1
- package/package.json +62 -60
- package/src/builder.js +118 -118
- package/src/crawler.js +298 -298
- package/src/index.js +64 -64
- package/src/metadata.js +33 -33
- package/src/settings.json +34 -34
- package/src/utils.js +226 -226
- package/test/css/should-ignore.scss +9 -9
- package/test/css/vanilla.css +174 -161
- package/test/js/amd.js +23 -3
- package/test/js/vanilla.js +23 -3
- package/test/pretest.js +133 -133
- package/test/runner.js +17 -17
- package/test/settings/cache-invalidate.json +9 -9
- package/test/settings/custom.json +8 -8
- package/test/settings/exclude.json +14 -14
- package/test/settings/prefixed.json +10 -10
- package/test/settings/select.json +15 -15
- package/test/tests.js +415 -415
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* modernizr v3.
|
|
3
|
-
* Build https://modernizr.com/download?-
|
|
2
|
+
* modernizr v3.12.0
|
|
3
|
+
* Build https://modernizr.com/download?-adownload-ambientlight-aping-apng-appearance-areaping-arrow-atobbtoa-audio-audioautoplay-audioloop-audiopreload-avif-backdropfilter-backgroundblendmode-backgroundcliptext-backgroundsize-batteryapi-bdi-beacon-bgpositionshorthand-bgpositionxy-bgrepeatspace_bgrepeatround-bgsizecover-blobconstructor-bloburls-blobworkers-borderimage-borderradius-boxdecorationbreak-boxshadow-boxsizing-canvas-canvasblending-canvastext-canvaswinding-capture-checked-classlist-clipboard-connectioneffectivetype-contains-contenteditable-contextmenu-cookies-cors-createelementattrs_createelement_attrs-cryptography-cssall-cssanimations-csscalc-csschunit-csscolumns-cssescape-cssexunit-cssfilters-cssgradients-cssgrid_cssgridlegacy-csshyphens_softhyphens_softhyphensfind-cssinvalid-cssmask-csspointerevents-csspositionsticky-csspseudoanimations-csspseudotransitions-cssreflections-cssremunit-cssresize-cssscrollbar-csstransforms-csstransforms3d-csstransformslevel2-csstransitions-cssvalid-cssvhunit-cssvmaxunit-cssvminunit-cssvwunit-cubicbezierrange-customelements-customevent-customproperties-customprotocolhandler-dart-datachannel-datalistelem-dataset-datauri-dataview-dataworkers-details-devicemotion_deviceorientation-directory-display_runin-displaytable-documentfragment-ellipsis-es5-es5array-es5date-es5function-es5object-es5string-es5syntax-es5undefined-es6array-es6class-es6collections-es6math-es6number-es6object-es6string-es6symbol-es7array-es8object-eventlistener-eventsource-exiforientation-fetch-fileinput-filereader-filesystem-flash-flexbox-flexboxlegacy-flexboxtweener-flexgap-flexwrap-focusvisible-focuswithin-fontdisplay-fontface-forcetouch-formattribute-formvalidation-framed-fullscreen-gamepads-generatedcontent-generators-geolocation-getrandomvalues-getusermedia-hairline-hashchange-hidden-hiddenscroll-history-hovermq-hsla-htmlimports-ie8compat-imgcrossorigin-indexeddb-indexeddb2-indexeddbblob-inlinesvg-input-inputformaction-inputformenctype-inputformmethod-inputformnovalidate-inputformtarget-inputsearchevent-inputtypes-intersectionobserver-intl-jpeg2000-jpegxr-json-lastchild-lazyloading-ligatures-localizednumber-localstorage-lowbandwidth-lowbattery-matchmedia-mathml-mediaqueries-mediarecorder-mediasource-messagechannel-microdata-multiplebgs-mutationobserver-nthchild-objectfit-olreversed-oninput-opacity-outputelem-overflowscrolling-pagevisibility-passiveeventlisteners-peerconnection-performance-picture-placeholder-pointerevents-pointerlock-pointermq-postmessage-prefetch-preserve3d-progressbar_meter-promises-proximity-proxy-publickeycredential-queryselector-quotamanagement-regions-requestanimationframe-requestautocomplete-resizeobserver-restdestructuringarray_restdestructuringobject-restparameters-rgba-ruby-sandbox-scriptasync-scriptdefer-scrollsnappoints-scrolltooptions-seamless-serviceworker-sessionstorage-shadowroot-shadowrootlegacy-shapes-sharedworkers-siblinggeneral-sizes-smil-speechrecognition-speechsynthesis-spreadarray-spreadobject-srcdoc-srcset-strictmode-stringtemplate-stylescoped-subpixelfont-supports-svg-svgasimg-svgclippaths-svgfilters-svgforeignobject-target-template-templatestrings-textalignlast-textareamaxlength-textdecoration-textencoder_textdecoder-textshadow-texttrackapi_track-time-todataurljpeg_todataurlpng_todataurlwebp-touchevents-transferables-typedarrays-unicode-unicoderange-unknownelements-urlparser-urlsearchparams-userdata-userselect-variablefonts-vibrate-video-videoautoplay-videocrossorigin-videoloop-videopreload-vml-webanimations-webaudio-webgl-webglextensions-webintents-webp-webpalpha-webpanimation-webplossless_webp_lossless-websockets-websocketsbinary-websqldatabase-webworkers-willchange-wrapflow-xdomainrequest-xhr2-xhrresponsetype-xhrresponsetypearraybuffer-xhrresponsetypeblob-xhrresponsetypedocument-xhrresponsetypejson-xhrresponsetypetext-addtest-printshiv-setclasses-testprop-dontmin
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c)
|
|
6
6
|
* Faruk Ates
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
* @access public
|
|
36
36
|
*/
|
|
37
37
|
var ModernizrProto = {
|
|
38
|
-
|
|
39
|
-
_version: '3.10.0',
|
|
38
|
+
_version: '3.12.0',
|
|
40
39
|
|
|
41
40
|
// Any settings that don't work as separate modules
|
|
42
41
|
// can go in here as configuration.
|
|
@@ -1157,7 +1156,7 @@
|
|
|
1157
1156
|
|
|
1158
1157
|
ret = callback(div, rule);
|
|
1159
1158
|
// If this is done after page load we don't want to remove the body so check if body exists
|
|
1160
|
-
if (body.fake) {
|
|
1159
|
+
if (body.fake && body.parentNode) {
|
|
1161
1160
|
body.parentNode.removeChild(body);
|
|
1162
1161
|
docElement.style.overflow = docOverflow;
|
|
1163
1162
|
// Trigger layout so kinetic scrolling isn't disabled in iOS6+
|
|
@@ -1173,13 +1172,13 @@
|
|
|
1173
1172
|
;
|
|
1174
1173
|
|
|
1175
1174
|
/**
|
|
1176
|
-
* domToCSS takes a camelCase string and converts it to
|
|
1175
|
+
* domToCSS takes a camelCase string and converts it to hyphen-case
|
|
1177
1176
|
* e.g. boxSizing -> box-sizing
|
|
1178
1177
|
*
|
|
1179
1178
|
* @access private
|
|
1180
1179
|
* @function domToCSS
|
|
1181
1180
|
* @param {string} name - String name of camelCase prop we want to convert
|
|
1182
|
-
* @returns {string} The
|
|
1181
|
+
* @returns {string} The hyphen-case version of the supplied name
|
|
1183
1182
|
*/
|
|
1184
1183
|
function domToCSS(name) {
|
|
1185
1184
|
return name.replace(/([A-Z])/g, function(str, m1) {
|
|
@@ -1268,12 +1267,12 @@
|
|
|
1268
1267
|
;
|
|
1269
1268
|
|
|
1270
1269
|
/**
|
|
1271
|
-
* cssToDOM takes a
|
|
1270
|
+
* cssToDOM takes a hyphen-case string and converts it to camelCase
|
|
1272
1271
|
* e.g. box-sizing -> boxSizing
|
|
1273
1272
|
*
|
|
1274
1273
|
* @access private
|
|
1275
1274
|
* @function cssToDOM
|
|
1276
|
-
* @param {string} name - String name of
|
|
1275
|
+
* @param {string} name - String name of hyphen-case prop we want to convert
|
|
1277
1276
|
* @returns {string} The camelCase version of the supplied name
|
|
1278
1277
|
*/
|
|
1279
1278
|
function cssToDOM(name) {
|
|
@@ -1295,7 +1294,7 @@
|
|
|
1295
1294
|
// on our modernizr element, but instead just testing undefined vs
|
|
1296
1295
|
// empty string.
|
|
1297
1296
|
|
|
1298
|
-
// Property names can be provided in either camelCase or
|
|
1297
|
+
// Property names can be provided in either camelCase or hyphen-case.
|
|
1299
1298
|
|
|
1300
1299
|
function testProps(props, prefixed, value, skipValueTest) {
|
|
1301
1300
|
skipValueTest = is(skipValueTest, 'undefined') ? false : skipValueTest;
|
|
@@ -1380,7 +1379,7 @@
|
|
|
1380
1379
|
|
|
1381
1380
|
/**
|
|
1382
1381
|
* testProp() investigates whether a given style property is recognized
|
|
1383
|
-
* Property names can be provided in either camelCase or
|
|
1382
|
+
* Property names can be provided in either camelCase or hyphen-case.
|
|
1384
1383
|
*
|
|
1385
1384
|
* @memberOf Modernizr
|
|
1386
1385
|
* @name Modernizr.testProp
|
|
@@ -1493,6 +1492,7 @@
|
|
|
1493
1492
|
{
|
|
1494
1493
|
"name": "Ambient Light Events",
|
|
1495
1494
|
"property": "ambientlight",
|
|
1495
|
+
"caniuse": "ambient-light",
|
|
1496
1496
|
"notes": [{
|
|
1497
1497
|
"name": "W3C Spec",
|
|
1498
1498
|
"href": "https://www.w3.org/TR/ambient-light/"
|
|
@@ -1509,6 +1509,7 @@ Detects support for the API that provides information about the ambient light le
|
|
|
1509
1509
|
{
|
|
1510
1510
|
"name": "HTML5 Audio Element",
|
|
1511
1511
|
"property": "audio",
|
|
1512
|
+
"caniuse": "audio",
|
|
1512
1513
|
"tags": ["html5", "audio", "media"],
|
|
1513
1514
|
"notes": [{
|
|
1514
1515
|
"name": "MDN Docs",
|
|
@@ -1596,7 +1597,7 @@ Modernizr.audio.ogg // 'probably'
|
|
|
1596
1597
|
* @example
|
|
1597
1598
|
*
|
|
1598
1599
|
* Modernizr._domPrefixes is exactly the same as [_prefixes](#modernizr-_prefixes), but rather
|
|
1599
|
-
* than
|
|
1600
|
+
* than hyphen-case properties, all properties are their Capitalized variant
|
|
1600
1601
|
*
|
|
1601
1602
|
* ```js
|
|
1602
1603
|
* Modernizr._domPrefixes === [ "Moz", "O", "ms", "Webkit" ];
|
|
@@ -1784,7 +1785,7 @@ Modernizr.audio.ogg // 'probably'
|
|
|
1784
1785
|
* @example
|
|
1785
1786
|
*
|
|
1786
1787
|
* Modernizr.prefixed takes a string css value in the DOM style camelCase (as
|
|
1787
|
-
* opposed to the css style
|
|
1788
|
+
* opposed to the css style hyphen-case) form and returns the (possibly prefixed)
|
|
1788
1789
|
* version of that property that the browser actually supports.
|
|
1789
1790
|
*
|
|
1790
1791
|
* For example, in older Firefox...
|
|
@@ -1829,7 +1830,7 @@ Modernizr.audio.ogg // 'probably'
|
|
|
1829
1830
|
* var transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
|
|
1830
1831
|
* ```
|
|
1831
1832
|
*
|
|
1832
|
-
* If you want a similar lookup, but in
|
|
1833
|
+
* If you want a similar lookup, but in hyphen-case, you can use [prefixedCSS](#modernizr-prefixedcss).
|
|
1833
1834
|
*/
|
|
1834
1835
|
var prefixed = ModernizrProto.prefixed = function(prop, obj, elem) {
|
|
1835
1836
|
if (prop.indexOf('@') === 0) {
|
|
@@ -1837,7 +1838,7 @@ Modernizr.audio.ogg // 'probably'
|
|
|
1837
1838
|
}
|
|
1838
1839
|
|
|
1839
1840
|
if (prop.indexOf('-') !== -1) {
|
|
1840
|
-
// Convert
|
|
1841
|
+
// Convert hyphen-case to camelCase
|
|
1841
1842
|
prop = cssToDOM(prop);
|
|
1842
1843
|
}
|
|
1843
1844
|
if (!obj) {
|
|
@@ -1938,6 +1939,52 @@ Detects support for the text APIs for `<canvas>` elements.
|
|
|
1938
1939
|
return typeof createElement('canvas').getContext('2d').fillText === 'function';
|
|
1939
1940
|
});
|
|
1940
1941
|
|
|
1942
|
+
/*!
|
|
1943
|
+
{
|
|
1944
|
+
"name": "Clipboard API",
|
|
1945
|
+
"property": "clipboard",
|
|
1946
|
+
"tags": ["clipboard"],
|
|
1947
|
+
"authors": ["Markel Ferro (@MarkelFe)"],
|
|
1948
|
+
"async": true,
|
|
1949
|
+
"warnings": ["It may return false in non-HTTPS connections as the API is only available in secure contexts"],
|
|
1950
|
+
"notes": [{
|
|
1951
|
+
"name": "MDN Docs Clipboard Object",
|
|
1952
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/Clipboard"
|
|
1953
|
+
}, {
|
|
1954
|
+
"name": "MDN Docs Clipboard API",
|
|
1955
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API"
|
|
1956
|
+
}]
|
|
1957
|
+
}
|
|
1958
|
+
!*/
|
|
1959
|
+
/* DOC
|
|
1960
|
+
It tests for the whole clipboard API. The sub-properties `read`, `readText`, `write` and `writeText` are supported. Note: This test does not detect the [clipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent).
|
|
1961
|
+
|
|
1962
|
+
```javascript
|
|
1963
|
+
Modernizr.clipboard // Supports the clipboard API
|
|
1964
|
+
Modernizr.clipboard.read // Supports the read sub-property
|
|
1965
|
+
```
|
|
1966
|
+
*/
|
|
1967
|
+
|
|
1968
|
+
Modernizr.addAsyncTest(function() {
|
|
1969
|
+
var result;
|
|
1970
|
+
var props = ['read', 'readText', 'write', 'writeText'];
|
|
1971
|
+
if (navigator.clipboard) {
|
|
1972
|
+
addTest('clipboard', true);
|
|
1973
|
+
// The sub-modules checked only if API is available to avoid Edge crashes
|
|
1974
|
+
for (var i = 0; i < props.length; i++) {
|
|
1975
|
+
if (navigator.clipboard[props[i]]) {
|
|
1976
|
+
result = true;
|
|
1977
|
+
} else {
|
|
1978
|
+
result = false;
|
|
1979
|
+
}
|
|
1980
|
+
addTest('clipboard.' + props[i].toLowerCase(), result);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
else {
|
|
1984
|
+
addTest('clipboard', false);
|
|
1985
|
+
}
|
|
1986
|
+
});
|
|
1987
|
+
|
|
1941
1988
|
/*!
|
|
1942
1989
|
{
|
|
1943
1990
|
"name": "Content Editable",
|
|
@@ -2073,6 +2120,7 @@ Detects support for the cryptographic functionality available under window.crypt
|
|
|
2073
2120
|
{
|
|
2074
2121
|
"name": "Custom Elements API",
|
|
2075
2122
|
"property": "customelements",
|
|
2123
|
+
"caniuse": "custom-elementsv1",
|
|
2076
2124
|
"tags": ["customelements"],
|
|
2077
2125
|
"polyfills": ["customelements"],
|
|
2078
2126
|
"notes": [{
|
|
@@ -2187,6 +2235,7 @@ Detects support for the DataView interface for reading data from an ArrayBuffer
|
|
|
2187
2235
|
{
|
|
2188
2236
|
"name": "Event Listener",
|
|
2189
2237
|
"property": "eventlistener",
|
|
2238
|
+
"caniuse": "addeventlistener",
|
|
2190
2239
|
"authors": ["Andrew Betts (@triblondon)"],
|
|
2191
2240
|
"notes": [{
|
|
2192
2241
|
"name": "W3C Spec",
|
|
@@ -2415,6 +2464,7 @@ Detects support for the ability to make the current website take over the user's
|
|
|
2415
2464
|
{
|
|
2416
2465
|
"name": "GamePad API",
|
|
2417
2466
|
"property": "gamepads",
|
|
2467
|
+
"caniuse": "gamepad",
|
|
2418
2468
|
"authors": ["Eric Bidelman"],
|
|
2419
2469
|
"tags": ["media"],
|
|
2420
2470
|
"notes": [{
|
|
@@ -3002,6 +3052,7 @@ Modernizr.inputtypes.week
|
|
|
3002
3052
|
{
|
|
3003
3053
|
"name": "Internationalization API",
|
|
3004
3054
|
"property": "intl",
|
|
3055
|
+
"caniuse": "internationalization",
|
|
3005
3056
|
"notes": [{
|
|
3006
3057
|
"name": "MDN Docs",
|
|
3007
3058
|
"href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl"
|
|
@@ -3049,7 +3100,7 @@ Detects native support for JSON handling functions.
|
|
|
3049
3100
|
* @optionProp testAllProps
|
|
3050
3101
|
* @access public
|
|
3051
3102
|
* @function testAllProps
|
|
3052
|
-
* @param {string} prop - String naming the property to test (either camelCase or
|
|
3103
|
+
* @param {string} prop - String naming the property to test (either camelCase or hyphen-case)
|
|
3053
3104
|
* @param {string} [value] - String of the value to test
|
|
3054
3105
|
* @param {boolean} [skipValueTest=false] - Whether to skip testing that the value is supported when using non-native detection
|
|
3055
3106
|
* @returns {string|boolean} returns the string version of the property, or `false` if it is unsupported
|
|
@@ -3264,6 +3315,7 @@ Detects support for the Navigation Timing API, for measuring browser and connect
|
|
|
3264
3315
|
{
|
|
3265
3316
|
"name": "DOM Pointer Events API",
|
|
3266
3317
|
"property": "pointerevents",
|
|
3318
|
+
"caniuse": "pointer",
|
|
3267
3319
|
"tags": ["input"],
|
|
3268
3320
|
"authors": ["Stu Cox"],
|
|
3269
3321
|
"notes": [{
|
|
@@ -3405,7 +3457,7 @@ Detects support for an API that allows users to get proximity related informatio
|
|
|
3405
3457
|
/*!
|
|
3406
3458
|
{
|
|
3407
3459
|
"name": "Proxy Object",
|
|
3408
|
-
"property": "
|
|
3460
|
+
"property": "proxy",
|
|
3409
3461
|
"caniuse": "proxy",
|
|
3410
3462
|
"authors": ["Brock Beaudry"],
|
|
3411
3463
|
"notes": [{
|
|
@@ -3487,10 +3539,45 @@ Detects support for the `window.requestAnimationFrame` API, for offloading anima
|
|
|
3487
3539
|
|
|
3488
3540
|
Modernizr.addTest('requestanimationframe', !!prefixed('requestAnimationFrame', window), {aliases: ['raf']});
|
|
3489
3541
|
|
|
3542
|
+
/*!
|
|
3543
|
+
{
|
|
3544
|
+
"name": "scrollToOptions dictionary",
|
|
3545
|
+
"property": "scrolltooptions",
|
|
3546
|
+
"caniuse": "mdn-api_scrolltooptions",
|
|
3547
|
+
"notes": [{
|
|
3548
|
+
"name": "MDN docs",
|
|
3549
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo"
|
|
3550
|
+
}],
|
|
3551
|
+
"authors": ["Oliver Tušla (@asmarcz)", "Chris Smith (@chris13524)"]
|
|
3552
|
+
}
|
|
3553
|
+
!*/
|
|
3554
|
+
|
|
3555
|
+
Modernizr.addTest('scrolltooptions', function () {
|
|
3556
|
+
var body = getBody();
|
|
3557
|
+
var returnTo = window.pageYOffset;
|
|
3558
|
+
var needsFill = body.clientHeight <= window.innerHeight;
|
|
3559
|
+
if (needsFill) {
|
|
3560
|
+
var div = createElement('div');
|
|
3561
|
+
div.style.height = (window.innerHeight - body.clientHeight + 1) + 'px';
|
|
3562
|
+
div.style.display = 'block';
|
|
3563
|
+
body.appendChild(div);
|
|
3564
|
+
}
|
|
3565
|
+
window.scrollTo({
|
|
3566
|
+
top: 1
|
|
3567
|
+
});
|
|
3568
|
+
var result = window.pageYOffset !== 0;
|
|
3569
|
+
if (needsFill) {
|
|
3570
|
+
body.removeChild(div);
|
|
3571
|
+
}
|
|
3572
|
+
window.scrollTo(0, returnTo);
|
|
3573
|
+
return result;
|
|
3574
|
+
});
|
|
3575
|
+
|
|
3490
3576
|
/*!
|
|
3491
3577
|
{
|
|
3492
3578
|
"name": "ServiceWorker API",
|
|
3493
3579
|
"property": "serviceworker",
|
|
3580
|
+
"caniuse": "serviceworkers",
|
|
3494
3581
|
"notes": [{
|
|
3495
3582
|
"name": "ServiceWorkers Explained",
|
|
3496
3583
|
"href": "https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md"
|
|
@@ -3554,6 +3641,25 @@ Template strings are string literals allowing embedded expressions.
|
|
|
3554
3641
|
return !!supports;
|
|
3555
3642
|
});
|
|
3556
3643
|
|
|
3644
|
+
/*!
|
|
3645
|
+
{
|
|
3646
|
+
"name": "Text Encoding/Decoding",
|
|
3647
|
+
"property": ["textencoder", "textdecoder"],
|
|
3648
|
+
"caniuse" : "textencoder",
|
|
3649
|
+
"notes": [{
|
|
3650
|
+
"name": "MDN TextEncoder Doc",
|
|
3651
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder"
|
|
3652
|
+
}, {
|
|
3653
|
+
"name": "MDN TextDecoder Doc",
|
|
3654
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder"
|
|
3655
|
+
}],
|
|
3656
|
+
"authors": ["dabretin"]
|
|
3657
|
+
}
|
|
3658
|
+
!*/
|
|
3659
|
+
|
|
3660
|
+
Modernizr.addTest('textencoder', !!(window.TextEncoder && window.TextEncoder.prototype.encode));
|
|
3661
|
+
Modernizr.addTest('textdecoder', !!(window.TextDecoder && window.TextDecoder.prototype.decode));
|
|
3662
|
+
|
|
3557
3663
|
|
|
3558
3664
|
/**
|
|
3559
3665
|
* List of property values to set for css tests. See ticket #21
|
|
@@ -3568,7 +3674,7 @@ Template strings are string literals allowing embedded expressions.
|
|
|
3568
3674
|
*
|
|
3569
3675
|
* Modernizr._prefixes is the internal list of prefixes that we test against
|
|
3570
3676
|
* inside of things like [prefixed](#modernizr-prefixed) and [prefixedCSS](#-code-modernizr-prefixedcss). It is simply
|
|
3571
|
-
* an array of
|
|
3677
|
+
* an array of hyphen-case vendor prefixes you can use within your code.
|
|
3572
3678
|
*
|
|
3573
3679
|
* Some common use cases include
|
|
3574
3680
|
*
|
|
@@ -3653,9 +3759,7 @@ Template strings are string literals allowing embedded expressions.
|
|
|
3653
3759
|
var bool = false;
|
|
3654
3760
|
|
|
3655
3761
|
injectElementWithStyles('@media ' + mq + ' { #modernizr { position: absolute; } }', function(node) {
|
|
3656
|
-
bool = (
|
|
3657
|
-
window.getComputedStyle(node, null) :
|
|
3658
|
-
node.currentStyle).position === 'absolute';
|
|
3762
|
+
bool = computedStyle(node, null, 'position') === 'absolute';
|
|
3659
3763
|
});
|
|
3660
3764
|
|
|
3661
3765
|
return bool;
|
|
@@ -3851,6 +3955,7 @@ Detects support for IE userData for persisting data, an API similar to localStor
|
|
|
3851
3955
|
{
|
|
3852
3956
|
"name": "Vibration API",
|
|
3853
3957
|
"property": "vibrate",
|
|
3958
|
+
"caniuse": "vibration",
|
|
3854
3959
|
"notes": [{
|
|
3855
3960
|
"name": "MDN Docs",
|
|
3856
3961
|
"href": "https://developer.mozilla.org/en/DOM/window.navigator.mozVibrate"
|
|
@@ -3886,7 +3991,7 @@ Detects support for the API that provides access to the vibration mechanism of t
|
|
|
3886
3991
|
/* DOC
|
|
3887
3992
|
Detects support for the video element, as well as testing what types of content it supports.
|
|
3888
3993
|
|
|
3889
|
-
Subproperties are provided to describe support for `ogg`, `h264` and `
|
|
3994
|
+
Subproperties are provided to describe support for `ogg`, `h264`, `h265`, `webm`, `vp9`, `hls` and `av1` formats, e.g.:
|
|
3890
3995
|
|
|
3891
3996
|
```javascript
|
|
3892
3997
|
Modernizr.video // true
|
|
@@ -3922,9 +4027,11 @@ Modernizr.video.ogg // 'probably'
|
|
|
3922
4027
|
|
|
3923
4028
|
// Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
|
|
3924
4029
|
Modernizr.addTest('video.h264', elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ''));
|
|
4030
|
+
Modernizr.addTest('video.h265', elem.canPlayType('video/mp4; codecs="hev1"').replace(/^no$/, ''));
|
|
3925
4031
|
Modernizr.addTest('video.webm', elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, ''));
|
|
3926
4032
|
Modernizr.addTest('video.vp9', elem.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, ''));
|
|
3927
4033
|
Modernizr.addTest('video.hls', elem.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, ''));
|
|
4034
|
+
Modernizr.addTest('video.av1', elem.canPlayType('video/mp4; codecs="av01"').replace(/^no$/, ''));
|
|
3928
4035
|
}
|
|
3929
4036
|
} catch (e) {}
|
|
3930
4037
|
})();
|
|
@@ -4071,6 +4178,46 @@ Detects support for XDomainRequest in IE9 & IE8
|
|
|
4071
4178
|
|
|
4072
4179
|
Modernizr.addTest('xdomainrequest', 'XDomainRequest' in window);
|
|
4073
4180
|
|
|
4181
|
+
/*!
|
|
4182
|
+
{
|
|
4183
|
+
"name": "a[ping] Attribute",
|
|
4184
|
+
"property": "aping",
|
|
4185
|
+
"caniuse": "ping",
|
|
4186
|
+
"tags": ["media", "attribute"],
|
|
4187
|
+
"builderAliases": ["a_ping"],
|
|
4188
|
+
"authors": ["Hélio Correia (@heliocorreia)"],
|
|
4189
|
+
"notes": [{
|
|
4190
|
+
"name": "WHATWG Spec",
|
|
4191
|
+
"href": "https://html.spec.whatwg.org/dev/links.html#ping"
|
|
4192
|
+
}]
|
|
4193
|
+
}
|
|
4194
|
+
!*/
|
|
4195
|
+
/* DOC
|
|
4196
|
+
The ping attribute, if present, gives the URLs of the resources that are interested in being notified if the user follows the hyperlink.
|
|
4197
|
+
*/
|
|
4198
|
+
|
|
4199
|
+
Modernizr.addTest('aping', !window.externalHost && 'ping' in createElement('a'));
|
|
4200
|
+
|
|
4201
|
+
/*!
|
|
4202
|
+
{
|
|
4203
|
+
"name": "area[ping] Attribute",
|
|
4204
|
+
"property": "areaping",
|
|
4205
|
+
"caniuse": "ping",
|
|
4206
|
+
"tags": ["media", "attribute"],
|
|
4207
|
+
"builderAliases": ["area_ping"],
|
|
4208
|
+
"authors": ["Hélio Correia (@heliocorreia)"],
|
|
4209
|
+
"notes": [{
|
|
4210
|
+
"name": "WHATWG Spec",
|
|
4211
|
+
"href": "https://html.spec.whatwg.org/dev/links.html#ping"
|
|
4212
|
+
}]
|
|
4213
|
+
}
|
|
4214
|
+
!*/
|
|
4215
|
+
/* DOC
|
|
4216
|
+
The ping attribute, if present, gives the URLs of the resources that are interested in being notified if the user follows the hyperlink.
|
|
4217
|
+
*/
|
|
4218
|
+
|
|
4219
|
+
Modernizr.addTest('areaping', !window.externalHost && 'ping' in createElement('area'));
|
|
4220
|
+
|
|
4074
4221
|
/*!
|
|
4075
4222
|
{
|
|
4076
4223
|
"name": "a[download] Attribute",
|
|
@@ -4366,10 +4513,24 @@ Detects if Photoshop style blending modes are available in canvas.
|
|
|
4366
4513
|
var canvas = createElement('canvas');
|
|
4367
4514
|
|
|
4368
4515
|
Modernizr.addTest('todataurljpeg', function() {
|
|
4369
|
-
|
|
4516
|
+
var supports = false;
|
|
4517
|
+
|
|
4518
|
+
// AVG secure browser with 'Anti-Fingerprinting' turned on throws an exception when using an "invalid" toDataUrl
|
|
4519
|
+
try {
|
|
4520
|
+
supports = !!Modernizr.canvas && canvas.toDataURL('image/jpeg').indexOf('data:image/jpeg') === 0;
|
|
4521
|
+
} catch (e) {}
|
|
4522
|
+
|
|
4523
|
+
return supports;
|
|
4370
4524
|
});
|
|
4371
4525
|
Modernizr.addTest('todataurlpng', function() {
|
|
4372
|
-
|
|
4526
|
+
var supports = false;
|
|
4527
|
+
|
|
4528
|
+
// AVG secure browser with 'Anti-Fingerprinting' turned on throws an exception when using an "invalid" toDataUrl
|
|
4529
|
+
try {
|
|
4530
|
+
supports = !!Modernizr.canvas && canvas.toDataURL('image/png').indexOf('data:image/png') === 0;
|
|
4531
|
+
} catch (e) {}
|
|
4532
|
+
|
|
4533
|
+
return supports;
|
|
4373
4534
|
});
|
|
4374
4535
|
Modernizr.addTest('todataurlwebp', function() {
|
|
4375
4536
|
var supports = false;
|
|
@@ -4578,6 +4739,7 @@ extends beyond its border in CSS
|
|
|
4578
4739
|
{
|
|
4579
4740
|
"name": "Background Position Shorthand",
|
|
4580
4741
|
"property": "bgpositionshorthand",
|
|
4742
|
+
"caniuse": "css-background-offsets",
|
|
4581
4743
|
"tags": ["css"],
|
|
4582
4744
|
"builderAliases": ["css_backgroundposition_shorthand"],
|
|
4583
4745
|
"notes": [{
|
|
@@ -4832,6 +4994,7 @@ Method of allowing calculated values for length units. For example:
|
|
|
4832
4994
|
"name": "CSS Font ch Units",
|
|
4833
4995
|
"authors": ["Ron Waldon (@jokeyrhyme)"],
|
|
4834
4996
|
"property": "csschunit",
|
|
4997
|
+
"caniuse": "ch-unit",
|
|
4835
4998
|
"tags": ["css"],
|
|
4836
4999
|
"notes": [{
|
|
4837
5000
|
"name": "W3C Spec",
|
|
@@ -5034,6 +5197,7 @@ Tests for `CSS.escape()` support.
|
|
|
5034
5197
|
"name": "CSS Font ex Units",
|
|
5035
5198
|
"authors": ["Ron Waldon (@jokeyrhyme)"],
|
|
5036
5199
|
"property": "cssexunit",
|
|
5200
|
+
"caniuse": "mdn-css_types_length_ex",
|
|
5037
5201
|
"tags": ["css"],
|
|
5038
5202
|
"notes": [{
|
|
5039
5203
|
"name": "W3C Spec",
|
|
@@ -5224,8 +5388,27 @@ else {
|
|
|
5224
5388
|
|
|
5225
5389
|
/*!
|
|
5226
5390
|
{
|
|
5227
|
-
"name": "CSS :focus-
|
|
5391
|
+
"name": "CSS :focus-visible pseudo-selector",
|
|
5228
5392
|
"caniuse": "css-focus-visible",
|
|
5393
|
+
"property": "focusvisible",
|
|
5394
|
+
"authors": ["@esaborit4code"],
|
|
5395
|
+
"tags": ["css"]
|
|
5396
|
+
}
|
|
5397
|
+
!*/
|
|
5398
|
+
|
|
5399
|
+
Modernizr.addTest('focusvisible', function() {
|
|
5400
|
+
try {
|
|
5401
|
+
document.querySelector(':focus-visible');
|
|
5402
|
+
} catch (error) {
|
|
5403
|
+
return false;
|
|
5404
|
+
}
|
|
5405
|
+
return true;
|
|
5406
|
+
});
|
|
5407
|
+
|
|
5408
|
+
/*!
|
|
5409
|
+
{
|
|
5410
|
+
"name": "CSS :focus-within pseudo-selector",
|
|
5411
|
+
"caniuse": "css-focus-within",
|
|
5229
5412
|
"property": "focuswithin",
|
|
5230
5413
|
"tags": ["css"]
|
|
5231
5414
|
}
|
|
@@ -5290,13 +5473,13 @@ Detects support for the `font-display` descriptor, which defines how font files
|
|
|
5290
5473
|
}
|
|
5291
5474
|
!*/
|
|
5292
5475
|
|
|
5293
|
-
var
|
|
5476
|
+
var unsupportedUserAgent = (function() {
|
|
5294
5477
|
var ua = navigator.userAgent;
|
|
5295
5478
|
var webos = ua.match(/w(eb)?osbrowser/gi);
|
|
5296
5479
|
var wppre8 = ua.match(/windows phone/gi) && ua.match(/iemobile\/([0-9])+/gi) && parseFloat(RegExp.$1) >= 9;
|
|
5297
5480
|
return webos || wppre8;
|
|
5298
5481
|
}());
|
|
5299
|
-
if (
|
|
5482
|
+
if (unsupportedUserAgent) {
|
|
5300
5483
|
Modernizr.addTest('fontface', false);
|
|
5301
5484
|
} else {
|
|
5302
5485
|
testStyles('@font-face {font-family:"font";src:url("https://")}', function(node, rule) {
|
|
@@ -5555,11 +5738,11 @@ Detects support for hidpi/retina hairlines, which are CSS borders with less than
|
|
|
5555
5738
|
// testing if in-browser Find functionality will work on hyphenated text
|
|
5556
5739
|
function test_hyphens_find(delimiter) {
|
|
5557
5740
|
try {
|
|
5558
|
-
/* create a
|
|
5741
|
+
/* create a sample input for resetting selection location, and a div container
|
|
5559
5742
|
* these have to be appended to document.body, otherwise some browsers can give false negative
|
|
5560
5743
|
* div container gets the doubled testword, separated by the delimiter
|
|
5561
5744
|
* Note: giving a width to div gives false positive in iOS Safari */
|
|
5562
|
-
var
|
|
5745
|
+
var sampleInput = createElement('input');
|
|
5563
5746
|
var div = createElement('div');
|
|
5564
5747
|
var testword = 'lebowski';
|
|
5565
5748
|
var result = false;
|
|
@@ -5567,21 +5750,21 @@ Detects support for hidpi/retina hairlines, which are CSS borders with less than
|
|
|
5567
5750
|
var firstChild = document.body.firstElementChild || document.body.firstChild;
|
|
5568
5751
|
|
|
5569
5752
|
/* Make the elements fixed to prevent that the browser's viewport will jump to the top */
|
|
5570
|
-
|
|
5753
|
+
sampleInput.style.cssText = 'position:fixed;top:0;';
|
|
5571
5754
|
div.style.cssText = 'position:fixed;top:0;';
|
|
5572
5755
|
|
|
5573
5756
|
div.innerHTML = testword + delimiter + testword;
|
|
5574
5757
|
|
|
5575
5758
|
document.body.insertBefore(div, firstChild);
|
|
5576
|
-
document.body.insertBefore(
|
|
5759
|
+
document.body.insertBefore(sampleInput, div);
|
|
5577
5760
|
|
|
5578
|
-
/* reset the selection to the
|
|
5761
|
+
/* reset the selection to the sample input element, i.e. BEFORE the div container
|
|
5579
5762
|
* stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area */
|
|
5580
|
-
if (
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
} else if (
|
|
5584
|
-
textrange =
|
|
5763
|
+
if (sampleInput.setSelectionRange) {
|
|
5764
|
+
sampleInput.focus();
|
|
5765
|
+
sampleInput.setSelectionRange(0, 0);
|
|
5766
|
+
} else if (sampleInput.createTextRange) {
|
|
5767
|
+
textrange = sampleInput.createTextRange();
|
|
5585
5768
|
textrange.collapse(true);
|
|
5586
5769
|
textrange.moveEnd('character', 0);
|
|
5587
5770
|
textrange.moveStart('character', 0);
|
|
@@ -5601,7 +5784,7 @@ Detects support for hidpi/retina hairlines, which are CSS borders with less than
|
|
|
5601
5784
|
}
|
|
5602
5785
|
|
|
5603
5786
|
document.body.removeChild(div);
|
|
5604
|
-
document.body.removeChild(
|
|
5787
|
+
document.body.removeChild(sampleInput);
|
|
5605
5788
|
|
|
5606
5789
|
return result;
|
|
5607
5790
|
} catch (e) {
|
|
@@ -5902,7 +6085,7 @@ Detects support for the ':nth-child()' CSS pseudo-selector.
|
|
|
5902
6085
|
Modernizr.addTest('csspseudoanimations', function() {
|
|
5903
6086
|
var result = false;
|
|
5904
6087
|
|
|
5905
|
-
if (!Modernizr.cssanimations
|
|
6088
|
+
if (!Modernizr.cssanimations) {
|
|
5906
6089
|
return result;
|
|
5907
6090
|
}
|
|
5908
6091
|
|
|
@@ -5914,7 +6097,7 @@ Detects support for the ':nth-child()' CSS pseudo-selector.
|
|
|
5914
6097
|
].join('');
|
|
5915
6098
|
|
|
5916
6099
|
testStyles(styles, function(elem) {
|
|
5917
|
-
result =
|
|
6100
|
+
result = computedStyle(elem, ':before', 'font-size') === '10px';
|
|
5918
6101
|
});
|
|
5919
6102
|
|
|
5920
6103
|
return result;
|
|
@@ -5942,7 +6125,7 @@ Detects support for the ':nth-child()' CSS pseudo-selector.
|
|
|
5942
6125
|
Modernizr.addTest('csspseudotransitions', function() {
|
|
5943
6126
|
var result = false;
|
|
5944
6127
|
|
|
5945
|
-
if (!Modernizr.csstransitions
|
|
6128
|
+
if (!Modernizr.csstransitions) {
|
|
5946
6129
|
return result;
|
|
5947
6130
|
}
|
|
5948
6131
|
|
|
@@ -5952,9 +6135,9 @@ Detects support for the ':nth-child()' CSS pseudo-selector.
|
|
|
5952
6135
|
|
|
5953
6136
|
testStyles(styles, function(elem) {
|
|
5954
6137
|
// Force rendering of the element's styles so that the transition will trigger
|
|
5955
|
-
|
|
6138
|
+
computedStyle(elem, ':before', 'font-size');
|
|
5956
6139
|
elem.className += 'trigger';
|
|
5957
|
-
result =
|
|
6140
|
+
result = computedStyle(elem, ':before', 'font-size') === '5px';
|
|
5958
6141
|
});
|
|
5959
6142
|
|
|
5960
6143
|
return result;
|
|
@@ -6159,6 +6342,7 @@ Test for CSS 3 UI "resize" property
|
|
|
6159
6342
|
{
|
|
6160
6343
|
"name": "Scroll Snap Points",
|
|
6161
6344
|
"property": "scrollsnappoints",
|
|
6345
|
+
"caniuse": "css-snappoints",
|
|
6162
6346
|
"notes": [{
|
|
6163
6347
|
"name": "Setting native-like scrolling offsets in CSS with Scrolling Snap Points",
|
|
6164
6348
|
"href": "http://generatedcontent.org/post/66817675443/setting-native-like-scrolling-offsets-in-css-with"
|
|
@@ -6236,9 +6420,7 @@ Detects support for CSS Snap Points
|
|
|
6236
6420
|
function(elem) {
|
|
6237
6421
|
var subpixel = elem.firstChild;
|
|
6238
6422
|
subpixel.innerHTML = 'This is a text written in Arial';
|
|
6239
|
-
Modernizr.addTest('subpixelfont',
|
|
6240
|
-
window.getComputedStyle(subpixel, null).getPropertyValue('width') !== '44px'
|
|
6241
|
-
: false);
|
|
6423
|
+
Modernizr.addTest('subpixelfont', computedStyle(subpixel, null, 'width') !== '44px');
|
|
6242
6424
|
}, 1, ['subpixel']);
|
|
6243
6425
|
|
|
6244
6426
|
/*!
|
|
@@ -6278,6 +6460,7 @@ Detects support for the ':target' CSS pseudo-class.
|
|
|
6278
6460
|
{
|
|
6279
6461
|
"name": "CSS text-align-last",
|
|
6280
6462
|
"property": "textalignlast",
|
|
6463
|
+
"caniuse": "css-text-align-last",
|
|
6281
6464
|
"tags": ["css"],
|
|
6282
6465
|
"knownBugs": ["IE does not support the 'start' or 'end' values."],
|
|
6283
6466
|
"notes": [{
|
|
@@ -6355,7 +6538,7 @@ Detects support for the ':target' CSS pseudo-class.
|
|
|
6355
6538
|
!*/
|
|
6356
6539
|
|
|
6357
6540
|
Modernizr.addTest('csstransforms', function() {
|
|
6358
|
-
// Android < 3.0 is buggy, so we sniff and
|
|
6541
|
+
// Android < 3.0 is buggy, so we sniff and reject it
|
|
6359
6542
|
// https://github.com/Modernizr/Modernizr/issues/903
|
|
6360
6543
|
return navigator.userAgent.indexOf('Android 2.') === -1 &&
|
|
6361
6544
|
testAllProps('transform', 'scale(1)', true);
|
|
@@ -6623,6 +6806,7 @@ Detects support for `transform-style: preserve-3d`, for getting a proper 3D pers
|
|
|
6623
6806
|
{
|
|
6624
6807
|
"name": "will-change",
|
|
6625
6808
|
"property": "willchange",
|
|
6809
|
+
"caniuse": "will-change",
|
|
6626
6810
|
"notes": [{
|
|
6627
6811
|
"name": "W3C Spec",
|
|
6628
6812
|
"href": "https://drafts.csswg.org/css-will-change/"
|
|
@@ -6855,6 +7039,7 @@ Determines if DOM4 MutationObserver support is available.
|
|
|
6855
7039
|
/*!
|
|
6856
7040
|
{
|
|
6857
7041
|
"property": "passiveeventlisteners",
|
|
7042
|
+
"caniuse": "passive-event-listener",
|
|
6858
7043
|
"tags": ["dom"],
|
|
6859
7044
|
"authors": ["Rick Byers"],
|
|
6860
7045
|
"name": "Passive event listeners",
|
|
@@ -7085,19 +7270,16 @@ Detect support for the bdi element, a way to have text that is isolated from its
|
|
|
7085
7270
|
var ruby = createElement('ruby');
|
|
7086
7271
|
var rt = createElement('rt');
|
|
7087
7272
|
var rp = createElement('rp');
|
|
7088
|
-
var displayStyleProperty = 'display';
|
|
7089
|
-
// 'fontSize' - because it`s only used for IE6 and IE7
|
|
7090
|
-
var fontSizeStyleProperty = 'fontSize';
|
|
7091
7273
|
|
|
7092
7274
|
ruby.appendChild(rp);
|
|
7093
7275
|
ruby.appendChild(rt);
|
|
7094
7276
|
docElement.appendChild(ruby);
|
|
7095
7277
|
|
|
7096
7278
|
// browsers that support <ruby> hide the <rp> via "display:none"
|
|
7097
|
-
if (
|
|
7279
|
+
if (computedStyle(rp, null, 'display') === 'none' || // for non-IE browsers
|
|
7098
7280
|
// but in IE browsers <rp> has "display:inline" so, the test needs other conditions:
|
|
7099
|
-
|
|
7100
|
-
|
|
7281
|
+
computedStyle(ruby, null, 'display') === 'ruby' && computedStyle(rt, null, 'display') === 'ruby-text' || // for IE8+
|
|
7282
|
+
computedStyle(rp, null, 'fontSize') === '6pt' && computedStyle(rt, null, 'fontSize') === '6pt') { // for IE6 & IE7
|
|
7101
7283
|
|
|
7102
7284
|
cleanUp();
|
|
7103
7285
|
return true;
|
|
@@ -7107,18 +7289,6 @@ Detect support for the bdi element, a way to have text that is isolated from its
|
|
|
7107
7289
|
return false;
|
|
7108
7290
|
}
|
|
7109
7291
|
|
|
7110
|
-
function getStyle(element, styleProperty) {
|
|
7111
|
-
var result;
|
|
7112
|
-
|
|
7113
|
-
if (window.getComputedStyle) { // for non-IE browsers
|
|
7114
|
-
result = document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProperty);
|
|
7115
|
-
} else if (element.currentStyle) { // for IE
|
|
7116
|
-
result = element.currentStyle[styleProperty];
|
|
7117
|
-
}
|
|
7118
|
-
|
|
7119
|
-
return result;
|
|
7120
|
-
}
|
|
7121
|
-
|
|
7122
7292
|
function cleanUp() {
|
|
7123
7293
|
docElement.removeChild(ruby);
|
|
7124
7294
|
// the removed child node still exists in memory, so ...
|
|
@@ -7126,14 +7296,13 @@ Detect support for the bdi element, a way to have text that is isolated from its
|
|
|
7126
7296
|
rt = null;
|
|
7127
7297
|
rp = null;
|
|
7128
7298
|
}
|
|
7129
|
-
|
|
7130
7299
|
});
|
|
7131
7300
|
|
|
7132
|
-
|
|
7133
7301
|
/*!
|
|
7134
7302
|
{
|
|
7135
7303
|
"name": "Template Tag",
|
|
7136
7304
|
"property": "template",
|
|
7305
|
+
"caniuse": "template",
|
|
7137
7306
|
"tags": ["elem"],
|
|
7138
7307
|
"notes": [{
|
|
7139
7308
|
"name": "HTML5Rocks Article",
|
|
@@ -7527,6 +7696,33 @@ Check if browser implements ECMAScript 6 Arrow Functions per specification.
|
|
|
7527
7696
|
return true;
|
|
7528
7697
|
});
|
|
7529
7698
|
|
|
7699
|
+
/*!
|
|
7700
|
+
{
|
|
7701
|
+
"name": "ES6 Class",
|
|
7702
|
+
"property": "es6class",
|
|
7703
|
+
"notes": [{
|
|
7704
|
+
"name": "ECMAScript 6 language specification",
|
|
7705
|
+
"href": "https://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions"
|
|
7706
|
+
}],
|
|
7707
|
+
"caniuse": "es6-class",
|
|
7708
|
+
"authors": ["dabretin"],
|
|
7709
|
+
"tags": ["es6"]
|
|
7710
|
+
}
|
|
7711
|
+
!*/
|
|
7712
|
+
/* DOC
|
|
7713
|
+
Check if browser implements ECMAScript 6 class.
|
|
7714
|
+
*/
|
|
7715
|
+
|
|
7716
|
+
Modernizr.addTest('class', function() {
|
|
7717
|
+
try {
|
|
7718
|
+
// eslint-disable-next-line
|
|
7719
|
+
eval('class A{}');
|
|
7720
|
+
} catch (e) {
|
|
7721
|
+
return false;
|
|
7722
|
+
}
|
|
7723
|
+
return true;
|
|
7724
|
+
});
|
|
7725
|
+
|
|
7530
7726
|
/*!
|
|
7531
7727
|
{
|
|
7532
7728
|
"name": "ES6 Collections",
|
|
@@ -7844,8 +8040,8 @@ Check if browser implements ECMAScript 6 String per specification.
|
|
|
7844
8040
|
Check if browser implements ECMAScript 6 Symbol per specification.
|
|
7845
8041
|
*/
|
|
7846
8042
|
|
|
7847
|
-
Modernizr.addTest('es6symbol', !!(Symbol &&
|
|
7848
|
-
Symbol
|
|
8043
|
+
Modernizr.addTest('es6symbol', !!(typeof(Symbol)==="function" &&
|
|
8044
|
+
Symbol['for'] &&
|
|
7849
8045
|
Symbol.hasInstance &&
|
|
7850
8046
|
Symbol.isConcatSpreadable &&
|
|
7851
8047
|
Symbol.iterator &&
|
|
@@ -7883,7 +8079,7 @@ Check if browser implements ECMAScript 7 Array per specification.
|
|
|
7883
8079
|
/*!
|
|
7884
8080
|
{
|
|
7885
8081
|
"name": "ES7 Rest destructuring",
|
|
7886
|
-
"property": [
|
|
8082
|
+
"property": ["restdestructuringarray", "restdestructuringobject"],
|
|
7887
8083
|
"caniuse" : "destructuring%20assignment",
|
|
7888
8084
|
"notes": [{
|
|
7889
8085
|
"name": "official ECMAScript 7 Destructuring Assignment draft specification",
|
|
@@ -7944,6 +8140,30 @@ Check if browser implements ECMAScript 7 object spread syntax
|
|
|
7944
8140
|
return true;
|
|
7945
8141
|
});
|
|
7946
8142
|
|
|
8143
|
+
/*!
|
|
8144
|
+
{
|
|
8145
|
+
"name": "ES8 Object",
|
|
8146
|
+
"property": "es8object",
|
|
8147
|
+
"notes": [{
|
|
8148
|
+
"name": "ECMAScript 8 draft specification: Object.entries",
|
|
8149
|
+
"href": "https://www.ecma-international.org/ecma-262/8.0/#sec-object.entries"
|
|
8150
|
+
}, {
|
|
8151
|
+
"name": "ECMAScript 8 draft specification: Object.values",
|
|
8152
|
+
"href": "https://www.ecma-international.org/ecma-262/8.0/#sec-object.values"
|
|
8153
|
+
}],
|
|
8154
|
+
"caniuse": "object-entries,object-values",
|
|
8155
|
+
"authors": ["dabretin"],
|
|
8156
|
+
"warnings": ["ECMAScript 8 is still a only a draft, so this detect may not match the final specification or implementations."],
|
|
8157
|
+
"tags": ["es8"]
|
|
8158
|
+
}
|
|
8159
|
+
!*/
|
|
8160
|
+
/* DOC
|
|
8161
|
+
Check if browser implements ECMAScript 8 Object.
|
|
8162
|
+
*/
|
|
8163
|
+
|
|
8164
|
+
Modernizr.addTest('es8object', !!(Object.entries &&
|
|
8165
|
+
Object.values));
|
|
8166
|
+
|
|
7947
8167
|
/*!
|
|
7948
8168
|
{
|
|
7949
8169
|
"name": "Orientation and Motion Events",
|
|
@@ -8304,7 +8524,7 @@ Detects whether input type="number" is capable of receiving and displaying local
|
|
|
8304
8524
|
|
|
8305
8525
|
/* cleanup */
|
|
8306
8526
|
body.removeChild(div);
|
|
8307
|
-
if (body.fake) {
|
|
8527
|
+
if (body.fake && body.parentNode) {
|
|
8308
8528
|
body.parentNode.removeChild(body);
|
|
8309
8529
|
}
|
|
8310
8530
|
|
|
@@ -8348,6 +8568,7 @@ checkout flows (payments specific for now).
|
|
|
8348
8568
|
{
|
|
8349
8569
|
"name": "iframe[sandbox] Attribute",
|
|
8350
8570
|
"property": "sandbox",
|
|
8571
|
+
"caniuse": "iframe-sandbox",
|
|
8351
8572
|
"tags": ["iframe"],
|
|
8352
8573
|
"builderAliases": ["iframe_sandbox"],
|
|
8353
8574
|
"notes": [
|
|
@@ -8386,6 +8607,7 @@ Test for `seamless` attribute in iframes.
|
|
|
8386
8607
|
{
|
|
8387
8608
|
"name": "iframe[srcdoc] Attribute",
|
|
8388
8609
|
"property": "srcdoc",
|
|
8610
|
+
"caniuse": "iframe-srcdoc",
|
|
8389
8611
|
"tags": ["iframe"],
|
|
8390
8612
|
"builderAliases": ["iframe_srcdoc"],
|
|
8391
8613
|
"notes": [{
|
|
@@ -8405,6 +8627,7 @@ Test for `srcdoc` attribute in iframes.
|
|
|
8405
8627
|
"name": "Animated PNG",
|
|
8406
8628
|
"async": true,
|
|
8407
8629
|
"property": "apng",
|
|
8630
|
+
"caniuse": "apng",
|
|
8408
8631
|
"tags": ["image"],
|
|
8409
8632
|
"builderAliases": ["img_apng"],
|
|
8410
8633
|
"notes": [{
|
|
@@ -8441,6 +8664,36 @@ Test for animated png support.
|
|
|
8441
8664
|
image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==';
|
|
8442
8665
|
});
|
|
8443
8666
|
|
|
8667
|
+
/*!
|
|
8668
|
+
{
|
|
8669
|
+
"name": "AVIF",
|
|
8670
|
+
"async": true,
|
|
8671
|
+
"property": "avif",
|
|
8672
|
+
"caniuse": "avif",
|
|
8673
|
+
"tags": ["image"],
|
|
8674
|
+
"authors": ["Markel Ferro (@MarkelFe)"],
|
|
8675
|
+
"polyfills": ["avifjs"],
|
|
8676
|
+
"notes": [{
|
|
8677
|
+
"name": "Avif Spec",
|
|
8678
|
+
"href": "https://aomediacodec.github.io/av1-avif/"
|
|
8679
|
+
}]
|
|
8680
|
+
}
|
|
8681
|
+
!*/
|
|
8682
|
+
/* DOC
|
|
8683
|
+
Test for AVIF support
|
|
8684
|
+
*/
|
|
8685
|
+
|
|
8686
|
+
|
|
8687
|
+
Modernizr.addAsyncTest(function() {
|
|
8688
|
+
var image = new Image();
|
|
8689
|
+
|
|
8690
|
+
image.onload = image.onerror = function() {
|
|
8691
|
+
addTest('avif', image.width === 1);
|
|
8692
|
+
};
|
|
8693
|
+
|
|
8694
|
+
image.src = 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAEcbWV0YQAAAAAAAABIaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGNhdmlmIC0gaHR0cHM6Ly9naXRodWIuY29tL2xpbmstdS9jYXZpZgAAAAAeaWxvYwAAAAAEQAABAAEAAAAAAUQAAQAAABcAAAAqaWluZgEAAAAAAAABAAAAGmluZmUCAAAAAAEAAGF2MDFJbWFnZQAAAAAOcGl0bQAAAAAAAQAAAHJpcHJwAAAAUmlwY28AAAAQcGFzcAAAAAEAAAABAAAAFGlzcGUAAAAAAAAAAQAAAAEAAAAQcGl4aQAAAAADCAgIAAAAFmF2MUOBAAwACggYAAYICGgIIAAAABhpcG1hAAAAAAAAAAEAAQUBAoMDhAAAAB9tZGF0CggYAAYICGgIIBoFHiAAAEQiBACwDoA=';
|
|
8695
|
+
});
|
|
8696
|
+
|
|
8444
8697
|
/*!
|
|
8445
8698
|
{
|
|
8446
8699
|
"name": "Image crossOrigin",
|
|
@@ -8463,6 +8716,7 @@ Detects support for the crossOrigin attribute on images, which allow for cross d
|
|
|
8463
8716
|
"async": true,
|
|
8464
8717
|
"aliases": ["jpeg-2000", "jpg2"],
|
|
8465
8718
|
"property": "jpeg2000",
|
|
8719
|
+
"caniuse": "jpeg2000",
|
|
8466
8720
|
"tags": ["image"],
|
|
8467
8721
|
"authors": ["@eric_wvgg"],
|
|
8468
8722
|
"notes": [{
|
|
@@ -8712,6 +8966,7 @@ Tests for non-alpha lossless webp support.
|
|
|
8712
8966
|
"name": "Webp",
|
|
8713
8967
|
"async": true,
|
|
8714
8968
|
"property": "webp",
|
|
8969
|
+
"caniuse": "webp",
|
|
8715
8970
|
"tags": ["image"],
|
|
8716
8971
|
"builderAliases": ["img_webp"],
|
|
8717
8972
|
"authors": ["Krister Kari", "@amandeep", "Rich Bradshaw", "Ryan Seddon", "Paul Irish"],
|
|
@@ -8906,6 +9161,39 @@ Detect support for the formtarget attribute on form inputs, which overrides the
|
|
|
8906
9161
|
|
|
8907
9162
|
Modernizr.addTest('inputformtarget', !!('formTarget' in createElement('input')), {aliases: ['input-formtarget']});
|
|
8908
9163
|
|
|
9164
|
+
/*!
|
|
9165
|
+
{
|
|
9166
|
+
"name": "rel=prefetch",
|
|
9167
|
+
"property": "prefetch",
|
|
9168
|
+
"caniuse": "link-rel-prefetch",
|
|
9169
|
+
"notes": [{
|
|
9170
|
+
"name": "W3C Spec",
|
|
9171
|
+
"href": "https://www.w3.org/TR/resource-hints/#prefetch"
|
|
9172
|
+
}, {
|
|
9173
|
+
"name": "Related Github Issue",
|
|
9174
|
+
"href": "https://github.com/Modernizr/Modernizr/issues/2536"
|
|
9175
|
+
}]
|
|
9176
|
+
}
|
|
9177
|
+
!*/
|
|
9178
|
+
/* DOC
|
|
9179
|
+
Test for resource hints: prefetch.
|
|
9180
|
+
*/
|
|
9181
|
+
|
|
9182
|
+
Modernizr.addTest("prefetch", function() {
|
|
9183
|
+
if (document.documentMode === 11) {
|
|
9184
|
+
// Need to check specifically for IE11 as it supports prefetch, but not relList
|
|
9185
|
+
// https://github.com/Modernizr/Modernizr/pull/2610#issuecomment-709717161
|
|
9186
|
+
return true;
|
|
9187
|
+
}
|
|
9188
|
+
|
|
9189
|
+
var relList = createElement("link").relList;
|
|
9190
|
+
if (!relList || !relList.supports) {
|
|
9191
|
+
return false;
|
|
9192
|
+
}
|
|
9193
|
+
|
|
9194
|
+
return relList.supports("prefetch");
|
|
9195
|
+
});
|
|
9196
|
+
|
|
8909
9197
|
/*!
|
|
8910
9198
|
{
|
|
8911
9199
|
"name": "Hover Media Query",
|
|
@@ -8941,6 +9229,7 @@ Detect support for Pointer based media queries
|
|
|
8941
9229
|
"href": "https://w3c.github.io/beacon/"
|
|
8942
9230
|
}],
|
|
8943
9231
|
"property": "beacon",
|
|
9232
|
+
"caniuse": "beacon",
|
|
8944
9233
|
"tags": ["beacon", "network"],
|
|
8945
9234
|
"authors": ["Cătălin Mariș"]
|
|
8946
9235
|
}
|
|
@@ -9192,6 +9481,7 @@ Tests for XMLHttpRequest xhr.responseType.
|
|
|
9192
9481
|
{
|
|
9193
9482
|
"name": "XML HTTP Request Level 2 XHR2",
|
|
9194
9483
|
"property": "xhr2",
|
|
9484
|
+
"caniuse": "xhr2",
|
|
9195
9485
|
"tags": ["network"],
|
|
9196
9486
|
"builderAliases": ["network_xhr2"],
|
|
9197
9487
|
"notes": [{
|
|
@@ -9249,6 +9539,7 @@ Detects support for the `defer` attribute on the `<script>` element.
|
|
|
9249
9539
|
/*!
|
|
9250
9540
|
{
|
|
9251
9541
|
"property": "speechrecognition",
|
|
9542
|
+
"caniuse": "speech-recognition",
|
|
9252
9543
|
"tags": ["input", "speech"],
|
|
9253
9544
|
"authors": ["Cătălin Mariș"],
|
|
9254
9545
|
"name": "Speech Recognition API",
|
|
@@ -9273,6 +9564,7 @@ Detects support for the `defer` attribute on the `<script>` element.
|
|
|
9273
9564
|
/*!
|
|
9274
9565
|
{
|
|
9275
9566
|
"property": "speechsynthesis",
|
|
9567
|
+
"caniuse": "speech-synthesis",
|
|
9276
9568
|
"tags": ["input", "speech"],
|
|
9277
9569
|
"authors": ["Cătălin Mariș"],
|
|
9278
9570
|
"name": "Speech Synthesis API",
|
|
@@ -9291,6 +9583,28 @@ Detects support for the `defer` attribute on the `<script>` element.
|
|
|
9291
9583
|
}
|
|
9292
9584
|
});
|
|
9293
9585
|
|
|
9586
|
+
/*!
|
|
9587
|
+
{
|
|
9588
|
+
"name": "IndexedDB 2.0",
|
|
9589
|
+
"property": "indexeddb2",
|
|
9590
|
+
"tags": ["storage"],
|
|
9591
|
+
"caniuse": "indexeddb2",
|
|
9592
|
+
"authors": ["Tan Zhen Yong (@Xenonym)"],
|
|
9593
|
+
"polyfills": ["indexeddb"],
|
|
9594
|
+
"async": true
|
|
9595
|
+
}
|
|
9596
|
+
!*/
|
|
9597
|
+
/* DOC
|
|
9598
|
+
Detects support for the IndexedDB 2.0 client-side storage API.
|
|
9599
|
+
*/
|
|
9600
|
+
|
|
9601
|
+
Modernizr.addAsyncTest(function() {
|
|
9602
|
+
Modernizr.on('indexeddb', function(result) {
|
|
9603
|
+
if (!result) return;
|
|
9604
|
+
addTest('indexeddb2', 'getAll' in IDBIndex.prototype);
|
|
9605
|
+
});
|
|
9606
|
+
});
|
|
9607
|
+
|
|
9294
9608
|
/*!
|
|
9295
9609
|
{
|
|
9296
9610
|
"name": "Local Storage",
|
|
@@ -9617,7 +9931,7 @@ Modernizr.datauri.over32kb // false in IE8
|
|
|
9617
9931
|
Modernizr.addAsyncTest(function() {
|
|
9618
9932
|
|
|
9619
9933
|
// IE7 throw a mixed content warning on HTTPS for this test, so we'll
|
|
9620
|
-
// just
|
|
9934
|
+
// just reject it (we know it doesn't support data URIs anyway)
|
|
9621
9935
|
// https://github.com/Modernizr/Modernizr/issues/362
|
|
9622
9936
|
if (navigator.userAgent.indexOf('MSIE 7.') !== -1) {
|
|
9623
9937
|
// Keep the test async
|
|
@@ -9696,6 +10010,7 @@ Check if browser implements the URL constructor for parsing URLs.
|
|
|
9696
10010
|
/*!
|
|
9697
10011
|
{
|
|
9698
10012
|
"property": "urlsearchparams",
|
|
10013
|
+
"caniuse": "urlsearchparams",
|
|
9699
10014
|
"tags": ["querystring", "url"],
|
|
9700
10015
|
"authors": ["Cătălin Mariș"],
|
|
9701
10016
|
"name": "URLSearchParams API",
|
|
@@ -9850,7 +10165,7 @@ Detects support for the crossOrigin attribute on video tag
|
|
|
9850
10165
|
"href": "https://developers.google.com/web/updates/2018/03/webauthn-credential-management#the_solution"
|
|
9851
10166
|
}
|
|
9852
10167
|
],
|
|
9853
|
-
"property": "
|
|
10168
|
+
"property": "publickeycredential",
|
|
9854
10169
|
"tags": ["webauthn", "web authentication"],
|
|
9855
10170
|
"authors": ["Eric Delia"]
|
|
9856
10171
|
}
|
|
@@ -9936,6 +10251,7 @@ if ('OES_vertex_array_object' in Modernizr.webglextensions) {
|
|
|
9936
10251
|
{
|
|
9937
10252
|
"name": "RTC Peer Connection",
|
|
9938
10253
|
"property": "peerconnection",
|
|
10254
|
+
"caniuse": "rtcpeerconnection",
|
|
9939
10255
|
"tags": ["webrtc"],
|
|
9940
10256
|
"authors": ["Ankur Oberoi"],
|
|
9941
10257
|
"notes": [{
|
|
@@ -9969,6 +10285,7 @@ Detect for the RTCDataChannel API that allows for transfer data directly from on
|
|
|
9969
10285
|
var PeerConnectionConstructor = window[domPrefixesAll[i] + 'RTCPeerConnection'];
|
|
9970
10286
|
if (PeerConnectionConstructor) {
|
|
9971
10287
|
var peerConnection = new PeerConnectionConstructor(null);
|
|
10288
|
+
peerConnection.close();
|
|
9972
10289
|
return 'createDataChannel' in peerConnection;
|
|
9973
10290
|
}
|
|
9974
10291
|
}
|
|
@@ -9994,6 +10311,25 @@ Detects support for the new Promise-based `getUserMedia` API.
|
|
|
9994
10311
|
|
|
9995
10312
|
Modernizr.addTest('getUserMedia', 'mediaDevices' in navigator && 'getUserMedia' in navigator.mediaDevices);
|
|
9996
10313
|
|
|
10314
|
+
/*!
|
|
10315
|
+
{
|
|
10316
|
+
"name": "MediaStream Recording API",
|
|
10317
|
+
"property": "mediarecorder",
|
|
10318
|
+
"caniuse": "mediarecorder",
|
|
10319
|
+
"tags": ["mediarecorder", "media"],
|
|
10320
|
+
"authors": ["Onkar Dahale"],
|
|
10321
|
+
"notes": [{
|
|
10322
|
+
"name": "MDN Docs",
|
|
10323
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API"
|
|
10324
|
+
}]
|
|
10325
|
+
}
|
|
10326
|
+
!*/
|
|
10327
|
+
/* DOC
|
|
10328
|
+
Detects support for the MediaStream Recording API.
|
|
10329
|
+
*/
|
|
10330
|
+
|
|
10331
|
+
Modernizr.addTest('mediastream', typeof MediaRecorder !== "undefined" );
|
|
10332
|
+
|
|
9997
10333
|
/*!
|
|
9998
10334
|
{
|
|
9999
10335
|
"name": "Binary WebSockets",
|
|
@@ -10087,6 +10423,35 @@ Detects support for matchMedia.
|
|
|
10087
10423
|
|
|
10088
10424
|
Modernizr.addTest('matchmedia', !!prefixed('matchMedia', window));
|
|
10089
10425
|
|
|
10426
|
+
/*!
|
|
10427
|
+
{
|
|
10428
|
+
"name": "ResizeObserver",
|
|
10429
|
+
"property": "resizeobserver",
|
|
10430
|
+
"caniuse": "resizeobserver",
|
|
10431
|
+
"tags": ["ResizeObserver"],
|
|
10432
|
+
"authors": ["Christian Andersson"],
|
|
10433
|
+
"notes": [{
|
|
10434
|
+
"name": "W3C Spec",
|
|
10435
|
+
"href": "https://www.w3.org/TR/resize-observer/"
|
|
10436
|
+
}, {
|
|
10437
|
+
"name": "MDN Docs",
|
|
10438
|
+
"href": "https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver"
|
|
10439
|
+
}, {
|
|
10440
|
+
"name": "Web.dev Article",
|
|
10441
|
+
"href": "https://web.dev/resize-observer/"
|
|
10442
|
+
}, {
|
|
10443
|
+
"name": "Digital Ocean tutorial",
|
|
10444
|
+
"href": "https://www.digitalocean.com/community/tutorials/js-resize-observer"
|
|
10445
|
+
}]
|
|
10446
|
+
}
|
|
10447
|
+
!*/
|
|
10448
|
+
|
|
10449
|
+
/* DOC
|
|
10450
|
+
Detects support for ResizeObserver.
|
|
10451
|
+
*/
|
|
10452
|
+
|
|
10453
|
+
Modernizr.addTest('resizeobserver', 'ResizeObserver' in window);
|
|
10454
|
+
|
|
10090
10455
|
/*!
|
|
10091
10456
|
{
|
|
10092
10457
|
"name": "Workers from Blob URIs",
|