Update computedStyle usage (#2528)

* Fix getComputedStyle eslint rule

* Add TODO for ruby

* Use computed style in ruby test

* Use 3rd parameter in computedStyle

* Fix computedStyle usage

* Remove useless checks

* Update dependencies
This commit is contained in:
Veeck
2020-04-26 22:29:14 +02:00
committed by GitHub
parent 1baf805e9e
commit 1e8f100f20
8 changed files with 183 additions and 163 deletions

View File

@@ -26,7 +26,7 @@
"no-prototype-builtins": "off",
"no-restricted-syntax": ["error",
{
"selector": "CallExpression[callee.name='getComputedStyle']",
"selector": "CallExpression[callee.object.name='window'][callee.property.name='getComputedStyle']",
"message": "Do not use `getComputedStyle`, import and use the `computedStyle` helper"
}
],

View File

@@ -5,11 +5,11 @@
"tags": ["css"]
}
!*/
define(['Modernizr', 'testStyles', 'prefixes', 'test/css/animations'], function(Modernizr, testStyles, prefixes) {
define(['Modernizr', 'testStyles', 'prefixes', 'test/css/animations', 'computedStyle'], function(Modernizr, testStyles, prefixes, computedStyle) {
Modernizr.addTest('csspseudoanimations', function() {
var result = false;
if (!Modernizr.cssanimations || !window.getComputedStyle) {
if (!Modernizr.cssanimations) {
return result;
}
@@ -21,7 +21,7 @@ define(['Modernizr', 'testStyles', 'prefixes', 'test/css/animations'], function(
].join('');
testStyles(styles, function(elem) {
result = window.getComputedStyle(elem, ':before').getPropertyValue('font-size') === '10px';
result = computedStyle(elem, ':before', 'font-size') === '10px';
});
return result;

View File

@@ -5,11 +5,11 @@
"tags": ["css"]
}
!*/
define(['Modernizr', 'testStyles', 'prefixes', 'test/css/transitions'], function(Modernizr, testStyles, prefixes) {
define(['Modernizr', 'testStyles', 'prefixes', 'test/css/transitions', 'computedStyle'], function(Modernizr, testStyles, prefixes, computedStyle) {
Modernizr.addTest('csspseudotransitions', function() {
var result = false;
if (!Modernizr.csstransitions || !window.getComputedStyle) {
if (!Modernizr.csstransitions) {
return result;
}
@@ -19,9 +19,9 @@ define(['Modernizr', 'testStyles', 'prefixes', 'test/css/transitions'], function
testStyles(styles, function(elem) {
// Force rendering of the element's styles so that the transition will trigger
window.getComputedStyle(elem, ':before').getPropertyValue('font-size');
computedStyle(elem, ':before', 'font-size');
elem.className += 'trigger';
result = window.getComputedStyle(elem, ':before').getPropertyValue('font-size') === '5px';
result = computedStyle(elem, ':before', 'font-size') === '5px';
});
return result;

View File

@@ -11,7 +11,7 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
define(['Modernizr', 'testStyles', 'computedStyle'], function(Modernizr, testStyles, computedStyle) {
/*
* (to infer if GDI or DirectWrite is used on Windows)
*/
@@ -20,8 +20,6 @@ define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
function(elem) {
var subpixel = elem.firstChild;
subpixel.innerHTML = 'This is a text written in Arial';
Modernizr.addTest('subpixelfont', window.getComputedStyle ?
window.getComputedStyle(subpixel, null).getPropertyValue('width') !== '44px'
: false);
Modernizr.addTest('subpixelfont', computedStyle(subpixel, null, 'width') !== '44px');
}, 1, ['subpixel']);
});

View File

@@ -12,25 +12,22 @@
}]
}
!*/
define(['Modernizr', 'createElement', 'docElement'], function(Modernizr, createElement, docElement) {
define(['Modernizr', 'createElement', 'docElement', 'computedStyle'], function(Modernizr, createElement, docElement, computedStyle) {
Modernizr.addTest('ruby', function() {
var ruby = createElement('ruby');
var rt = createElement('rt');
var rp = createElement('rp');
var displayStyleProperty = 'display';
// 'fontSize' - because it`s only used for IE6 and IE7
var fontSizeStyleProperty = 'fontSize';
ruby.appendChild(rp);
ruby.appendChild(rt);
docElement.appendChild(ruby);
// browsers that support <ruby> hide the <rp> via "display:none"
if (getStyle(rp, displayStyleProperty) === 'none' || // for non-IE browsers
if (computedStyle(rp, null, 'display') === 'none' || // for non-IE browsers
// but in IE browsers <rp> has "display:inline" so, the test needs other conditions:
getStyle(ruby, displayStyleProperty) === 'ruby' && getStyle(rt, displayStyleProperty) === 'ruby-text' || // for IE8+
getStyle(rp, fontSizeStyleProperty) === '6pt' && getStyle(rt, fontSizeStyleProperty) === '6pt') { // for IE6 & IE7
computedStyle(ruby, null, 'display') === 'ruby' && computedStyle(rt, null, 'display') === 'ruby-text' || // for IE8+
computedStyle(rp, null, 'fontSize') === '6pt' && computedStyle(rt, null, 'fontSize') === '6pt') { // for IE6 & IE7
cleanUp();
return true;
@@ -40,18 +37,6 @@ define(['Modernizr', 'createElement', 'docElement'], function(Modernizr, createE
return false;
}
function getStyle(element, styleProperty) {
var result;
if (window.getComputedStyle) { // for non-IE browsers
result = document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProperty);
} else if (element.currentStyle) { // for IE
result = element.currentStyle[styleProperty];
}
return result;
}
function cleanUp() {
docElement.removeChild(ruby);
// the removed child node still exists in memory, so ...
@@ -59,7 +44,5 @@ define(['Modernizr', 'createElement', 'docElement'], function(Modernizr, createE
rt = null;
rp = null;
}
});
});

281
package-lock.json generated
View File

@@ -389,13 +389,14 @@
}
},
"@babel/plugin-proposal-object-rest-spread": {
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.0.tgz",
"integrity": "sha512-UgqBv6bjq4fDb8uku9f+wcm1J7YxJ5nT7WO/jBr0cl0PLKb7t1O6RNR1kZbjgx2LQtsDI9hwoQVmn0yhXeQyow==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz",
"integrity": "sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.8.3",
"@babel/plugin-syntax-object-rest-spread": "^7.8.0"
"@babel/plugin-syntax-object-rest-spread": "^7.8.0",
"@babel/plugin-transform-parameters": "^7.9.5"
}
},
"@babel/plugin-proposal-optional-catch-binding": {
@@ -549,19 +550,49 @@
}
},
"@babel/plugin-transform-classes": {
"version": "7.9.2",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.2.tgz",
"integrity": "sha512-TC2p3bPzsfvSsqBZo0kJnuelnoK9O3welkUpqSqBQuBF6R5MN2rysopri8kNvtlGIb2jmUO7i15IooAZJjZuMQ==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz",
"integrity": "sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.8.3",
"@babel/helper-define-map": "^7.8.3",
"@babel/helper-function-name": "^7.8.3",
"@babel/helper-function-name": "^7.9.5",
"@babel/helper-optimise-call-expression": "^7.8.3",
"@babel/helper-plugin-utils": "^7.8.3",
"@babel/helper-replace-supers": "^7.8.6",
"@babel/helper-split-export-declaration": "^7.8.3",
"globals": "^11.1.0"
},
"dependencies": {
"@babel/helper-function-name": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz",
"integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.8.3",
"@babel/template": "^7.8.3",
"@babel/types": "^7.9.5"
}
},
"@babel/helper-validator-identifier": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
"integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==",
"dev": true
},
"@babel/types": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz",
"integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.9.5",
"lodash": "^4.17.13",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/plugin-transform-computed-properties": {
@@ -574,9 +605,9 @@
}
},
"@babel/plugin-transform-destructuring": {
"version": "7.8.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.8.tgz",
"integrity": "sha512-eRJu4Vs2rmttFCdhPUM3bV0Yo/xPSdPw6ML9KHs/bjB4bLA5HXlbvYXPOD5yASodGod+krjYx21xm1QmL8dCJQ==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz",
"integrity": "sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.8.3"
@@ -722,9 +753,9 @@
}
},
"@babel/plugin-transform-parameters": {
"version": "7.9.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.3.tgz",
"integrity": "sha512-fzrQFQhp7mIhOzmOtPiKffvCYQSK10NR8t6BBz2yPbeUHb9OLW8RZGtgDRBn8z2hGcwvKDL3vC7ojPTLNxmqEg==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz",
"integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.8.3",
@@ -816,9 +847,9 @@
}
},
"@babel/preset-env": {
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.0.tgz",
"integrity": "sha512-712DeRXT6dyKAM/FMbQTV/FvRCms2hPCx+3weRjZ8iQVQWZejWWk1wwG6ViWMyqb/ouBbGOl5b6aCk0+j1NmsQ==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.5.tgz",
"integrity": "sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.9.0",
@@ -830,7 +861,7 @@
"@babel/plugin-proposal-json-strings": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-numeric-separator": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
"@babel/plugin-proposal-optional-catch-binding": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/plugin-proposal-unicode-property-regex": "^7.8.3",
@@ -847,9 +878,9 @@
"@babel/plugin-transform-async-to-generator": "^7.8.3",
"@babel/plugin-transform-block-scoped-functions": "^7.8.3",
"@babel/plugin-transform-block-scoping": "^7.8.3",
"@babel/plugin-transform-classes": "^7.9.0",
"@babel/plugin-transform-classes": "^7.9.5",
"@babel/plugin-transform-computed-properties": "^7.8.3",
"@babel/plugin-transform-destructuring": "^7.8.3",
"@babel/plugin-transform-destructuring": "^7.9.5",
"@babel/plugin-transform-dotall-regex": "^7.8.3",
"@babel/plugin-transform-duplicate-keys": "^7.8.3",
"@babel/plugin-transform-exponentiation-operator": "^7.8.3",
@@ -864,7 +895,7 @@
"@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3",
"@babel/plugin-transform-new-target": "^7.8.3",
"@babel/plugin-transform-object-super": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.8.7",
"@babel/plugin-transform-parameters": "^7.9.5",
"@babel/plugin-transform-property-literals": "^7.8.3",
"@babel/plugin-transform-regenerator": "^7.8.7",
"@babel/plugin-transform-reserved-words": "^7.8.3",
@@ -875,12 +906,31 @@
"@babel/plugin-transform-typeof-symbol": "^7.8.4",
"@babel/plugin-transform-unicode-regex": "^7.8.3",
"@babel/preset-modules": "^0.1.3",
"@babel/types": "^7.9.0",
"@babel/types": "^7.9.5",
"browserslist": "^4.9.1",
"core-js-compat": "^3.6.2",
"invariant": "^2.2.2",
"levenary": "^1.1.1",
"semver": "^5.5.0"
},
"dependencies": {
"@babel/helper-validator-identifier": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
"integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==",
"dev": true
},
"@babel/types": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz",
"integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.9.5",
"lodash": "^4.17.13",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/preset-modules": {
@@ -1028,18 +1078,18 @@
}
},
"@sinonjs/commons": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz",
"integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==",
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz",
"integrity": "sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw==",
"dev": true,
"requires": {
"type-detect": "4.0.8"
}
},
"@sinonjs/fake-timers": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz",
"integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz",
"integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==",
"dev": true,
"requires": {
"@sinonjs/commons": "^1.7.0"
@@ -1520,27 +1570,19 @@
"dev": true
},
"auto-changelog": {
"version": "1.16.4",
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-1.16.4.tgz",
"integrity": "sha512-h7diyELoq692AA4oqO50ULoYKIomUdzuQ+NW+eFPwIX0xzVbXEu9cIcgzZ3TYNVbpkGtcNKh51aRfAQNef7HVA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-2.0.0.tgz",
"integrity": "sha512-A61Oc4A/5L5OlMs+AEQNgy8/sOn5Eu0I2Sw4+qbwk40y6kh+2wmptoY4b30FHlduPh3ghybB94eIVFKkAZtjzg==",
"dev": true,
"requires": {
"commander": "^5.0.0",
"core-js": "^3.6.4",
"handlebars": "^4.7.3",
"lodash.uniqby": "^4.7.0",
"node-fetch": "^2.6.0",
"parse-github-url": "^1.0.2",
"regenerator-runtime": "^0.13.5",
"semver": "^6.3.0"
},
"dependencies": {
"core-js": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
"integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==",
"dev": true
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
@@ -1550,9 +1592,9 @@
}
},
"babel-plugin-dynamic-import-node": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz",
"integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==",
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",
"integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==",
"dev": true,
"requires": {
"object.assign": "^4.1.0"
@@ -1750,13 +1792,13 @@
"dev": true
},
"browserslist": {
"version": "4.11.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.11.1.tgz",
"integrity": "sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g==",
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz",
"integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001038",
"electron-to-chromium": "^1.3.390",
"caniuse-lite": "^1.0.30001043",
"electron-to-chromium": "^1.3.413",
"node-releases": "^1.1.53",
"pkg-up": "^2.0.0"
}
@@ -1814,9 +1856,9 @@
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
},
"caniuse-lite": {
"version": "1.0.30001038",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz",
"integrity": "sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ==",
"version": "1.0.30001048",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz",
"integrity": "sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg==",
"dev": true
},
"center-align": {
@@ -2081,9 +2123,9 @@
"dev": true
},
"commander": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz",
"integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
"dev": true
},
"comment-parser": {
@@ -2207,12 +2249,12 @@
"dev": true
},
"core-js-compat": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.4.tgz",
"integrity": "sha512-zAa3IZPvsJ0slViBQ2z+vgyyTuhd3MFn1rBQjZSKVEgB0UMYhUkCj9jJUVPgGTGqWvsBVmfnruXgTcNyTlEiSA==",
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz",
"integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==",
"dev": true,
"requires": {
"browserslist": "^4.8.3",
"browserslist": "^4.8.5",
"semver": "7.0.0"
},
"dependencies": {
@@ -2500,9 +2542,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.394",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.394.tgz",
"integrity": "sha512-AEbSKBF49P+GgEP34w0VdYWn9SiMHgWUJbOkPEE1WZMIpWXtvfT9N0sd4Lv4jjD6DeSFjRuzm6+btn/yCz6h2Q==",
"version": "1.3.418",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.418.tgz",
"integrity": "sha512-i2QrQtHes5fK/F9QGG5XacM5WKEuR322fxTYF9e8O9Gu0mc0WmjjwGpV8c7Htso6Zf2Di18lc3SIPxmMeRFBug==",
"dev": true
},
"emoji-regex": {
@@ -2551,9 +2593,9 @@
}
},
"es-abstract": {
"version": "1.17.4",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz",
"integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==",
"version": "1.17.5",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz",
"integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
@@ -2975,9 +3017,9 @@
}
},
"eslint-plugin-jsdoc": {
"version": "22.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-22.1.0.tgz",
"integrity": "sha512-54NdbICM7KrxsGUqQsev9aIMqPXyvyBx2218Qcm0TQ16P9CtBI+YY4hayJR6adrxlq4Ej0JLpgfUXWaQVFqmQg==",
"version": "24.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-24.0.0.tgz",
"integrity": "sha512-AGAc9PYpramsJGVmqtxnXBYlq+AMh+hIZdbJ52OLvyJS3f+PaT/PzuckRFOLnth2uhCDv4IjgsB3r5jUFWqUnw==",
"dev": true,
"requires": {
"comment-parser": "^0.7.2",
@@ -5476,9 +5518,9 @@
}
},
"jquery": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==",
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.0.tgz",
"integrity": "sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==",
"dev": true
},
"js-stringify": {
@@ -5953,9 +5995,9 @@
}
},
"mocha": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz",
"integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==",
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz",
"integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==",
"dev": true,
"requires": {
"ansi-colors": "3.2.3",
@@ -5971,7 +6013,7 @@
"js-yaml": "3.13.1",
"log-symbols": "3.0.0",
"minimatch": "3.0.4",
"mkdirp": "0.5.3",
"mkdirp": "0.5.5",
"ms": "2.1.1",
"node-environment-flags": "1.0.6",
"object.assign": "4.1.0",
@@ -6050,16 +6092,16 @@
}
},
"fsevents": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz",
"integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
},
"glob-parent": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
"integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
"dev": true,
"requires": {
"is-glob": "^4.0.1"
@@ -6089,21 +6131,6 @@
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mkdirp": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz",
"integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -7686,13 +7713,13 @@
"dev": true
},
"sinon": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz",
"integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==",
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz",
"integrity": "sha512-0uF8Q/QHkizNUmbK3LRFqx5cpTttEVXudywY9Uwzy8bTfZUhljZ7ARzSxnRHWYWtVTeh4Cw+tTb3iU21FQVO9A==",
"dev": true,
"requires": {
"@sinonjs/commons": "^1.7.0",
"@sinonjs/fake-timers": "^6.0.0",
"@sinonjs/commons": "^1.7.2",
"@sinonjs/fake-timers": "^6.0.1",
"@sinonjs/formatio": "^5.0.1",
"@sinonjs/samsam": "^5.0.3",
"diff": "^4.0.2",
@@ -8036,24 +8063,46 @@
}
}
},
"string.prototype.trimleft": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz",
"integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==",
"string.prototype.trimend": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz",
"integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
"es-abstract": "^1.17.5"
}
},
"string.prototype.trimleft": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz",
"integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.5",
"string.prototype.trimstart": "^1.0.0"
}
},
"string.prototype.trimright": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz",
"integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz",
"integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
"es-abstract": "^1.17.5",
"string.prototype.trimend": "^1.0.0"
}
},
"string.prototype.trimstart": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz",
"integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
"es-abstract": "^1.17.5"
}
},
"string_decoder": {
@@ -8325,14 +8374,13 @@
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
},
"uglify-js": {
"version": "3.8.1",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.1.tgz",
"integrity": "sha512-W7KxyzeaQmZvUFbGj4+YFshhVrMBGSg2IbcYAjGWGvx8DHvJMclbTDMpffdxFUGPBHjIytk7KJUR/KUXstUGDw==",
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz",
"integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==",
"dev": true,
"optional": true,
"requires": {
"commander": "~2.20.3",
"source-map": "~0.6.1"
"commander": "~2.20.3"
},
"dependencies": {
"commander": {
@@ -8341,13 +8389,6 @@
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true,
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"optional": true
}
}
},

View File

@@ -58,13 +58,13 @@
"devDependencies": {
"@alrra/travis-scripts": "^3.0.1",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/register": "^7.9.0",
"auto-changelog": "^1.16.4",
"auto-changelog": "^2.0.0",
"chai": "^4.2.0",
"del": "^5.1.0",
"eslint": "^6.8.0",
"eslint-plugin-jsdoc": "^22.1.0",
"eslint-plugin-jsdoc": "^24.0.0",
"find-parent-dir": "^0.3.0",
"fs-extra": "^9.0.0",
"globby": "^11.0.0",
@@ -73,13 +73,13 @@
"gulp-eslint": "^6.0.0",
"gulp-pug": "^4.0.1",
"joi": "^14.3.1",
"jquery": "^3.4.1",
"jquery": "^3.5.0",
"json3": "^3.3.3",
"mocha": "^7.1.1",
"mocha": "^7.1.2",
"mocha-headless-chrome": "^2.0.3",
"proxyquire": "^2.1.3",
"serve-static": "^1.14.1",
"sinon": "^9.0.1",
"sinon": "^9.0.2",
"ua-parser-js": "^0.7.21"
},
"scripts": {

View File

@@ -1,4 +1,4 @@
define(['ModernizrProto', 'injectElementWithStyles'], function(ModernizrProto, injectElementWithStyles) {
define(['ModernizrProto', 'injectElementWithStyles', 'computedStyle'], function(ModernizrProto, injectElementWithStyles, computedStyle) {
/**
* Modernizr.mq tests a given media query, live against the current state of the window
* adapted from matchMedia polyfill by Scott Jehl and Paul Irish
@@ -57,9 +57,7 @@ define(['ModernizrProto', 'injectElementWithStyles'], function(ModernizrProto, i
var bool = false;
injectElementWithStyles('@media ' + mq + ' { #modernizr { position: absolute; } }', function(node) {
bool = (window.getComputedStyle ?
window.getComputedStyle(node, null) :
node.currentStyle).position === 'absolute';
bool = computedStyle(node, null, 'position') === 'absolute';
});
return bool;