mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-09 23:57:57 -05:00
* added detection of workeroption and aspectratio css property * update aspectration.js rename workeroptions.js to workertypeoption.js update config-all.json and caniuse.js and all testcase passed * update caniuse * revert package-lock.json file * apply requested changes on both files
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/*!
|
|
{
|
|
"name": "aspectratio css property",
|
|
"property": "aspectratio",
|
|
"tags": ["css aspectratio", "aspect-ratio"],
|
|
"builderAliases": ["aspectratio"],
|
|
"caniuse":"mdn-css_properties_aspect-ratio",
|
|
"authors": ["Debadutta Panda"],
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio"
|
|
}]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detect working status of all aspectratio css property
|
|
https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio
|
|
*/
|
|
define(['Modernizr', 'createElement'], function (Modernizr, createElement) {
|
|
Modernizr.addTest("aspectratio", function () {
|
|
if (typeof CSS !== "object" && typeof CSS.supports === "function") {
|
|
return CSS.supports('aspect-ratio', '1 / 1')
|
|
} else {
|
|
var element = createElement('p'),
|
|
elStyle = element.style
|
|
if ('aspectRatio' in elStyle) {
|
|
elStyle.cssText = 'aspect-ratio:1 / 1'
|
|
element.remove()
|
|
return (elStyle['aspectRatio'] === '1 / 1');
|
|
} else {
|
|
element.remove();
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
}); |