Cleanup feature detects (#2639)

* Move tests with storage tag into that subdirectory

* Move tests with canvas tag into that subdirectory

* Move tests with image tag into that subdirectory

* Fix error

* Fix typo

* Move audio test into audio subdirectory

* Move battery test into that subdirectory

* Move canvas test into that subdirectory

* Move video test into that subdirectory

* Update dependencies

* Move form and input tests into input subdirectory

* Update dependencies again

* Move webgl, svg and event tests into subdirectories

* Update README
This commit is contained in:
Veeck
2021-03-10 08:18:51 +01:00
committed by GitHub
parent db96bdaff9
commit 08ab91b828
49 changed files with 1103 additions and 13483 deletions

View File

@@ -25,7 +25,19 @@ Modernizr tests which native CSS3 and HTML5 features are available in the curren
- `class` to `es6class` to keep in line with the rest of the es-tests
- These tests got removed:
- Following tests got moved in subdirectories:
- `cookies`, `indexeddb`, `indexedblob`, `quota-management-api`, `userdata` moved into the storage subdirectory
- `audio` moved into the audio subdirectory
- `battery` moved into the battery subdirectory
- `canvas`, `canvastext` moved into the canvas subdirectory
- `customevent`, `eventlistener`, `forcetouch`, `hashchange`, `pointerevents`, `proximity` moved into the event subdirectory
- `exiforientation` moved into the image subdirectory
- `capture`, `fileinput`, `fileinputdirectory`, `formatattribute`, `input`, `inputnumber-l10n`, `inputsearchevent`, `inputtypes`, `placeholder`, `requestautocomplete`, `validation` moved into the input subdirectory
- `svg` moved into the svg subdirectory
- `webgl` moved into the webgl subdirectory
- Following tests got removed:
- `touchevents`: [discussion](https://github.com/Modernizr/Modernizr/pull/2432)
- `unicode`: [discussion](https://github.com/Modernizr/Modernizr/issues/2468)

View File

@@ -10,7 +10,7 @@
/* DOC
Checks for support of the autoplay attribute of the audio element.
*/
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/audio'], function(Modernizr, addTest, docElement, createElement) {
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/audio/audio'], function(Modernizr, addTest, docElement, createElement) {
Modernizr.addAsyncTest(function() {
var timeout;

View File

@@ -10,7 +10,7 @@
/* DOC
Detects if audio can be downloaded in the background before it starts playing in the `<audio>` element
*/
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/audio'], function(Modernizr, addTest, docElement, createElement) {
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/audio/audio'], function(Modernizr, addTest, docElement, createElement) {
Modernizr.addAsyncTest(function() {
var timeout;

View File

@@ -4,7 +4,7 @@
"property": "batteryapi",
"aliases": ["battery-api"],
"builderAliases": ["battery_api"],
"tags": ["device", "media"],
"tags": ["battery", "device", "media"],
"authors": ["Paul Sayre", "Alex Bradley (@abrad1212)"],
"notes": [{
"name": "MDN Docs",

View File

@@ -2,7 +2,7 @@
{
"name": "Low Battery Level",
"property": "lowbattery",
"tags": ["hardware", "mobile"],
"tags": ["battery", "hardware", "mobile"],
"builderAliases": ["battery_level"],
"authors": ["Paul Sayre"],
"notes": [{

View File

@@ -16,7 +16,7 @@
/* DOC
Detects if Photoshop style blending modes are available in canvas.
*/
define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/canvas/canvas'], function(Modernizr, createElement) {
Modernizr.addTest('canvasblending', function() {
if (Modernizr.canvas === false) {
return false;

View File

@@ -10,7 +10,7 @@
/* DOC
Detects support for the text APIs for `<canvas>` elements.
*/
define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/canvas/canvas'], function(Modernizr, createElement) {
Modernizr.addTest('canvastext', function() {
if (Modernizr.canvas === false) {
return false;

View File

@@ -10,7 +10,7 @@
}]
}
!*/
define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/canvas/canvas'], function(Modernizr, createElement) {
var canvas = createElement('canvas');

View File

@@ -12,7 +12,7 @@
/* DOC
Determines if winding rules, which controls if a path can go clockwise or counterclockwise
*/
define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/canvas/canvas'], function(Modernizr, createElement) {
Modernizr.addTest('canvaswinding', function() {
if (Modernizr.canvas === false) {

View File

@@ -7,7 +7,7 @@
/* DOC
Detects support for emoji character sets.
*/
define(['Modernizr', 'createElement', 'test/canvastext'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/canvas/text'], function(Modernizr, createElement) {
Modernizr.addTest('emoji', function() {
if (!Modernizr.canvastext) {
return false;

View File

@@ -1,11 +1,11 @@
/*!
{
{
"name": "Flash",
"property": "flash",
"tags": ["flash"],
"polyfills": ["shumway"]
}
!*/
}
!*/
/* DOC
Detects Flash support as well as Flash-blocking plugins
*/

View File

@@ -15,7 +15,7 @@
/* DOC
Test for animated png support.
*/
define(['Modernizr', 'createElement', 'addTest', 'test/canvas'], function(Modernizr, createElement, addTest) {
define(['Modernizr', 'createElement', 'addTest', 'test/canvas/canvas'], function(Modernizr, createElement, addTest) {
Modernizr.addAsyncTest(function() {
if (!Modernizr.canvas) {
return false;

View File

@@ -2,6 +2,7 @@
{
"name": "Image crossOrigin",
"property": "imgcrossorigin",
"tags": ["image"],
"notes": [{
"name": "Cross Domain Images and the Tainted Canvas",
"href": "https://blog.codepen.io/2013/10/08/cross-domain-images-tainted-canvas/"

View File

@@ -17,7 +17,7 @@
/* DOC
Detects whether input type="number" is capable of receiving and displaying localized numbers, e.g. with comma separator.
*/
define(['Modernizr', 'createElement', 'getBody', 'test/inputtypes', 'test/forms/validation'], function(Modernizr, createElement, getBody) {
define(['Modernizr', 'createElement', 'getBody', 'test/input/inputtypes', 'test/input/validation'], function(Modernizr, createElement, getBody) {
Modernizr.addTest('localizednumber', function() {
/* this extends our testing of input[type=number], so bomb out if that's missing */
if (!Modernizr.inputtypes.number) { return false; }

View File

@@ -1,7 +1,8 @@
/*!
{
"name": "Hover Media Query",
"property": "hovermq"
"property": "hovermq",
"tags": ["mediaquery"]
}
!*/
/* DOC

View File

@@ -1,7 +1,8 @@
/*!
{
"name": "Pointer Media Query",
"property": "pointermq"
"property": "pointermq",
"tags": ["mediaquery"]
}
!*/
/* DOC

View File

@@ -12,7 +12,7 @@
/* DOC
Detects support for the IndexedDB 2.0 client-side storage API.
*/
define(['Modernizr', 'addTest', 'test/indexeddb'], function(Modernizr, addTest) {
define(['Modernizr', 'addTest', 'test/storage/indexeddb'], function(Modernizr, addTest) {
Modernizr.addAsyncTest(function() {
Modernizr.on('indexeddb', function(result) {
if (!result) return;

View File

@@ -1,13 +1,14 @@
/*!
{
"name": "IndexedDB Blob",
"property": "indexeddbblob"
"property": "indexeddbblob",
"tags": ["storage"]
}
!*/
/* DOC
Detects if the browser can save File/Blob objects to IndexedDB
*/
define(['Modernizr', 'addTest', 'prefixed', 'test/indexeddb'], function(Modernizr, addTest, prefixed) {
define(['Modernizr', 'addTest', 'prefixed', 'test/storage/indexeddb'], function(Modernizr, addTest, prefixed) {
// Vendors had inconsistent prefixing with the experimental Indexed DB:
// - Webkit's implementation is accessible through webkitIndexedDB
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB

View File

@@ -11,7 +11,7 @@
/* DOC
Checks for support of the autoplay attribute of the video element.
*/
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/video'], function(Modernizr, addTest, docElement, createElement) {
define(['Modernizr', 'addTest', 'docElement', 'createElement', 'test/video/video'], function(Modernizr, addTest, docElement, createElement) {
Modernizr.addAsyncTest(function() {
var timeout;

View File

@@ -24,7 +24,7 @@ if ('OES_vertex_array_object' in Modernizr.webglextensions) {
}
```
*/
define(['Modernizr', 'createElement', 'test/webgl'], function(Modernizr, createElement) {
define(['Modernizr', 'createElement', 'test/webgl/webgl'], function(Modernizr, createElement) {
// based on code from ilmari heikkinen
// code.google.com/p/graphics-detect/source/browse/js/detect.js

View File

@@ -26,23 +26,22 @@
"a/download",
"ambientlight",
"applicationcache",
"audio",
"audio/audio",
"audio/autoplay",
"audio/loop",
"audio/preload",
"audio/webaudio",
"battery",
"battery/battery",
"battery/lowbattery",
"blob",
"canvas",
"canvas/canvas",
"canvas/blending",
"canvas/todataurl",
"canvas/winding",
"canvastext",
"canvas/text",
"clipboard",
"contenteditable",
"contextmenu",
"cookies",
"cors",
"crypto",
"crypto/getrandomvalues",
@@ -132,7 +131,6 @@
"css/wrapflow",
"custom-elements",
"custom-protocol-handler",
"customevent",
"dart",
"dataview-api",
"dom/classlist",
@@ -184,26 +182,20 @@
"es7/rest-destructuring",
"es7/spread-object",
"es8/object",
"event/customevent",
"event/deviceorientation-motion",
"event/eventlistener",
"event/forcetouch",
"event/hashchange",
"event/oninput",
"eventlistener",
"exif-orientation",
"event/pointerevents",
"event/proximity",
"file/api",
"file/filesystem",
"flash",
"forcetouch",
"forms/capture",
"forms/fileinput",
"forms/fileinputdirectory",
"forms/formattribute",
"forms/inputnumber-l10n",
"forms/placeholder",
"forms/requestautocomplete",
"forms/validation",
"fullscreen-api",
"gamepad",
"geolocation",
"hashchange",
"hiddenscroll",
"history",
"htmlimports",
@@ -214,6 +206,7 @@
"img/apng",
"img/avif",
"img/crossorigin",
"img/exif-orientation",
"img/jpeg2000",
"img/jpegxr",
"img/lazyloading",
@@ -223,16 +216,22 @@
"img/webp-animation",
"img/webp-lossless",
"img/webp",
"indexeddb",
"indexeddbblob",
"input",
"input/capture",
"input/fileinput",
"input/fileinputdirectory",
"input/formaction",
"input/formattribute",
"input/formenctype",
"input/formmethod",
"input/formnovalidate",
"input/formtarget",
"inputsearchevent",
"inputtypes",
"input/input",
"input/inputnumber-l10n",
"input/inputsearchevent",
"input/inputtypes",
"input/placeholder",
"input/requestautocomplete",
"input/validation",
"intl",
"json",
"ligatures",
@@ -257,13 +256,10 @@
"notification",
"pagevisibility-api",
"performance",
"pointerevents",
"pointerlock-api",
"postmessage",
"proximity",
"proxy",
"queryselector",
"quota-management-api",
"link/prefetch",
"requestanimationframe",
"script/async",
@@ -272,12 +268,17 @@
"serviceworker",
"speech/speech-recognition",
"speech/speech-synthesis",
"storage/cookies",
"storage/indexeddb",
"storage/indexeddbblob",
"storage/indexeddb2",
"storage/localstorage",
"storage/quota-management-api",
"storage/sessionstorage",
"storage/userdata",
"storage/websqldatabase",
"style/scoped",
"svg",
"svg/svg",
"svg/asimg",
"svg/clippaths",
"svg/filters",
@@ -292,9 +293,8 @@
"url/data-uri",
"url/parser",
"url/urlsearchparams",
"userdata",
"vibration",
"video",
"video/video",
"video/autoplay",
"video/crossorigin",
"video/loop",
@@ -303,7 +303,7 @@
"web-intents",
"webanimations",
"webauthn/publickeycredential",
"webgl",
"webgl/webgl",
"webgl/extensions",
"webrtc/datachannel",
"webrtc/getusermedia",

14436
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -49,40 +49,40 @@
"dependencies": {
"doctrine": "^3.0.0",
"file": "^0.2.2",
"lodash": "^4.17.20",
"markdown-it": "^12.0.3",
"lodash": "^4.17.21",
"markdown-it": "^12.0.4",
"mkdirp": "1.0.4",
"requirejs": "^2.3.6",
"yargs": "^16.2.0"
},
"devDependencies": {
"@alrra/travis-scripts": "^3.0.1",
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.10",
"@babel/register": "^7.12.10",
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@babel/register": "^7.13.8",
"auto-changelog": "^2.2.1",
"chai": "^4.2.0",
"chai": "^4.3.3",
"codecov": "^3.8.1",
"del": "^6.0.0",
"eslint": "^7.15.0",
"eslint-plugin-jsdoc": "^30.7.8",
"eslint": "^7.21.0",
"eslint-plugin-jsdoc": "^32.2.0",
"find-parent-dir": "^0.3.0",
"fs-extra": "^9.0.1",
"globby": "^11.0.1",
"fs-extra": "^9.1.0",
"globby": "^11.0.2",
"gulp": "^4.0.2",
"gulp-connect": "^5.7.0",
"gulp-eslint": "^6.0.0",
"gulp-pug": "^4.0.1",
"joi": "^17.3.0",
"jquery": "^3.5.1",
"joi": "^17.4.0",
"jquery": "^3.6.0",
"json3": "^3.3.3",
"mocha": "^8.2.1",
"mocha": "^8.3.1",
"mocha-headless-chrome": "^3.1.0",
"nyc": "^15.1.0",
"proxyquire": "^2.1.3",
"serve-static": "^1.14.1",
"sinon": "^9.2.2",
"ua-parser-js": "^0.7.23"
"sinon": "^9.2.4",
"ua-parser-js": "^0.7.24"
},
"scripts": {
"--- DEFAULT SCRIPTS ---": "",