first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
/*!
{
"name": "SVG as an <img> tag source",
"property": "svgasimg",
"caniuse": "svg-img",
"tags": ["svg"],
"aliases": ["svgincss"],
"authors": ["Chris Coyier"],
"notes": [{
"name": "HTML5 Spec",
"href": "https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element"
}]
}
!*/
define(['Modernizr', 'addTest'], function(Modernizr) {
// Original Async test by Stu Cox
// https://gist.github.com/chriscoyier/8774501
// Now a Sync test based on good results here
// https://codepen.io/chriscoyier/pen/bADFx
// Note http://www.w3.org/TR/SVG11/feature#Image is *supposed* to represent
// support for the `<image>` tag in SVG, not an SVG file linked from an `<img>`
// tag in HTML – but it’s a heuristic which works
Modernizr.addTest('svgasimg', document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'));
});
+22
View File
@@ -0,0 +1,22 @@
/*!
{
"name": "SVG clip paths",
"property": "svgclippaths",
"tags": ["svg"],
"notes": [{
"name": "Demo",
"href": "http://srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg"
}]
}
!*/
/* DOC
Detects support for clip paths in SVG (only, not on HTML content).
See [this discussion](https://github.com/Modernizr/Modernizr/issues/213) regarding applying SVG clip paths to HTML content.
*/
define(['Modernizr', 'toStringFn'], function(Modernizr, toStringFn) {
Modernizr.addTest('svgclippaths', function() {
return !!document.createElementNS &&
/SVGClipPath/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'clipPath')));
});
});
+26
View File
@@ -0,0 +1,26 @@
/*!
{
"name": "SVG filters",
"property": "svgfilters",
"caniuse": "svg-filters",
"tags": ["svg"],
"builderAliases": ["svg_filters"],
"authors": ["Erik Dahlstrom"],
"notes": [{
"name": "W3C Spec",
"href": "https://www.w3.org/TR/SVG11/filters.html"
}]
}
!*/
define(['Modernizr'], function(Modernizr) {
// Should fail in Safari: https://stackoverflow.com/questions/9739955/feature-detecting-support-for-svg-filters.
Modernizr.addTest('svgfilters', function() {
var result = false;
try {
result = 'SVGFEColorMatrixElement' in window &&
SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE === 2;
}
catch (e) {}
return result;
});
});
+20
View File
@@ -0,0 +1,20 @@
/*!
{
"name": "SVG foreignObject",
"property": "svgforeignobject",
"tags": ["svg"],
"notes": [{
"name": "W3C Spec",
"href": "https://www.w3.org/TR/SVG11/extend.html"
}]
}
!*/
/* DOC
Detects support for foreignObject tag in SVG.
*/
define(['Modernizr', 'toStringFn'], function(Modernizr, toStringFn) {
Modernizr.addTest('svgforeignobject', function() {
return !!document.createElementNS &&
/SVGForeignObject/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')));
});
});
+27
View File
@@ -0,0 +1,27 @@
/*!
{
"name": "Inline SVG",
"property": "inlinesvg",
"caniuse": "svg-html5",
"tags": ["svg"],
"notes": [{
"name": "Test page",
"href": "https://paulirish.com/demo/inline-svg"
}, {
"name": "Test page and results",
"href": "https://codepen.io/eltonmesquita/full/GgXbvo/"
}],
"polyfills": ["inline-svg-polyfill"],
"knownBugs": ["False negative on some Chromia browsers."]
}
!*/
/* DOC
Detects support for inline SVG in HTML (not within XHTML).
*/
define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
Modernizr.addTest('inlinesvg', function() {
var div = createElement('div');
div.innerHTML = '<svg/>';
return (typeof SVGRect !== 'undefined' && div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';
});
});
+19
View File
@@ -0,0 +1,19 @@
/*!
{
"name": "SVG SMIL animation",
"property": "smil",
"caniuse": "svg-smil",
"tags": ["svg"],
"notes": [{
"name": "W3C Spec",
"href": "https://www.w3.org/AudioVideo/"
}]
}
!*/
define(['Modernizr', 'toStringFn'], function(Modernizr, toStringFn) {
// SVG SMIL animation
Modernizr.addTest('smil', function() {
return !!document.createElementNS &&
/SVGAnimate/.test(toStringFn.call(document.createElementNS('http://www.w3.org/2000/svg', 'animate')));
});
});